# code will generate warnings on one of them unless we have a few
# special cases.
AC_CHECK_LIB(readline, rl_completion_matches,
- [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
+ [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
[Do we have rl_completion_matches?])],
[],
[$TERMLIBS])
-/*
+/*
Unix SMB/CIFS implementation.
Samba readline wrapper implementation
Copyright (C) Simo Sorce 2001
Copyright (C) Andrew Tridgell 2001
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "../lib/util/select.h"
+#include "system/filesys.h"
+#include "system/select.h"
+#include "system/readline.h"
+#include "libcli/smbreadline/smbreadline.h"
+
+#undef malloc
#ifdef HAVE_LIBREADLINE
# ifdef HAVE_READLINE_READLINE_H
Display the prompt and wait for input. Call callback() regularly
****************************************************************************/
-static char *smb_readline_replacement(const char *prompt, void (*callback)(void),
+static char *smb_readline_replacement(const char *prompt, void (*callback)(void),
char **(completion_fn)(const char *text, int start, int end))
{
fd_set fds;
x_fflush(x_stdout);
}
- line = (char *)SMB_MALLOC(BUFSIZ);
+ line = (char *)malloc(BUFSIZ);
if (!line) {
return NULL;
}
#ifndef __SMBREADLINE_H__
#define __SMBREADLINE_H__
-char *smb_readline(const char *prompt, void (*callback)(void),
+char *smb_readline(const char *prompt, void (*callback)(void),
char **(completion_fn)(const char *text, int start, int end));
const char *smb_readline_get_line_buffer(void);
void smb_readline_ca_char(char c);
+void smb_readline_done(void);
#endif /* __SMBREADLINE_H__ */
LIB_DUMMY_OBJ = lib/dummysmbd.o lib/dummyroot.o
LIB_NONSMBD_OBJ = $(LIB_OBJ) $(LIB_DUMMY_OBJ)
-READLINE_OBJ = lib/readline.o
+READLINE_OBJ = ../libcli/smbreadline/smbreadline.o
# Also depends on $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
# Be sure to include them into your application
#include "client/client_proto.h"
#include "../librpc/gen_ndr/cli_srvsvc.h"
#include "../lib/util/select.h"
+#include "system/readline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#ifndef REGISTER
#define REGISTER 0
bool is_privileged_sid( const struct dom_sid *sid );
bool grant_all_privileges( const struct dom_sid *sid );
-/* The following definitions come from lib/readline.c */
-
-void smb_readline_done(void);
-char *smb_readline(const char *prompt, void (*callback)(void),
- char **(completion_fn)(const char *text, int start, int end));
-const char *smb_readline_get_line_buffer(void);
-void smb_readline_ca_char(char c);
-
/* The following definitions come from lib/recvfile.c */
ssize_t sys_recvfile(int fromfd,
#include "rpc_client/cli_lsarpc.h"
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_client/cli_netlogon.h"
+#include "../libcli/smbreadline/smbreadline.h"
enum pipe_auth_type_spnego {
PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
#include "includes.h"
#include "popt_common.h"
#include "vfstest.h"
+#include "../libcli/smbreadline/smbreadline.h"
/* List to hold groups of commands */
static struct cmd_list {
#include "utils/net.h"
#include "../librpc/gen_ndr/ndr_samr.h"
#include "lib/netapi/netapi.h"
+#include "../libcli/smbreadline/smbreadline.h"
static NTSTATUS rpc_sh_info(struct net_context *c,
TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
conf.RECURSE('../lib/nss_wrapper')
conf.RECURSE('../lib/socket_wrapper')
conf.RECURSE('../lib/zlib')
+ conf.RECURSE('../libcli/smbreadline')
conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h netdb.h')
LIB_DUMMY_SRC = '''lib/dummysmbd.c lib/dummyroot.c'''
LIB_NONSMBD_SRC = '''${LIB_DUMMY_SRC}'''
-READLINE_SRC = '''lib/readline.c'''
-
POPT_LIB_SRC = '''lib/popt_common.c'''
PARAM_WITHOUT_REG_SRC = '''param/loadparm.c param/util.c param/loadparm_server_role.c
bld.SETUP_BUILD_GROUPS()
bld.RECURSE('../lib/replace')
+bld.RECURSE('../libcli/smbreadline')
print "SBINDIR=%s" % bld.env.SBINDIR
bld.RECURSE('build')
source='${PROFILE_SRC}',
vars=locals())
-bld.SAMBA_SUBSYSTEM('READLINE',
- source=READLINE_SRC,
- vars=locals())
-
bld.SAMBA_SUBSYSTEM('PRINTBASE',
source=PRINTBASE_SRC,
vars=locals())
source=RPCCLIENT_SRC,
deps='''talloc tdb cap resolv POPT_SAMBA PASSDB LIBSMB LIB_NONSMBD
PARAM_WITHOUT_REG libwbclient PARAM KRBCLIENT LIBMSRPC_GEN LIBMSRPC
- LIBADS READLINE DISPLAY_SEC DCUTIL''',
+ LIBADS SMBREADLINE DISPLAY_SEC DCUTIL''',
vars=locals())
bld.SAMBA_BINARY('smbclient',
source=CLIENT_SRC,
deps='''talloc tdb cap resolv POPT_SAMBA PASSDB LIBSMB LIB_NONSMBD
PARAM_WITHOUT_REG libwbclient PARAM KRBCLIENT LIBMSRPC_GEN
- LIBMSRPC READLINE DISPLAY_SEC SOCKET_WRAPPER''',
+ LIBMSRPC SMBREADLINE DISPLAY_SEC SOCKET_WRAPPER''',
vars=locals())
bld.SAMBA_BINARY('net',
source=NET_SRC,
deps='''talloc tdb libnetapi libaddns cap resolv POPT_SAMBA PASSDB LIBSMB LIB_NONSMBD
PARAM_WITHOUT_REG libwbclient PARAM KRBCLIENT LIBMSRPC_GEN LIBMSRPC LIBGPO LIBADS LIBADS_SERVER LIBADS_PRINTER
- LOCALE_DIR LIBAFS LIBAFS_SETTOKEN READLINE PASSWD_UTIL LIBNET
+ LOCALE_DIR LIBAFS LIBAFS_SETTOKEN SMBREADLINE PASSWD_UTIL LIBNET
LIBNET_DSSYNC LIBNET_SAMSYNC LIBEVENTLOG DISPLAY_SEC DCUTIL
REGFIO NDR_NTPRINTING''',
vars=locals())
bld.SAMBA_BINARY('vfstest',
source=VFSTEST_SRC,
- deps='''SMBD_BASE READLINE''',
+ deps='''SMBD_BASE SMBREADLINE''',
vars=locals())
bld.SAMBA_BINARY('smbiconv',
ldbsrcdir := lib/ldb
libtlssrcdir := lib/tls
libregistrysrcdir := lib/registry
-smbreadlinesrcdir := lib/smbreadline
+smbreadlinesrcdir := ../libcli/smbreadline
libmessagingsrcdir := lib/messaging
libteventsrcdir := ../lib/tevent
libeventssrcdir := lib/events
#include "system/time.h" /* needed by some systems for asctime() */
#include "libcli/resolve/resolve.h"
#include "libcli/security/security.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
#include "libcli/raw/raw_proto.h"
# Configuration rules.
m4_include(build/m4/env.m4)
m4_include(../lib/replace/samba.m4)
-m4_include(lib/smbreadline/readline.m4)
+m4_include(../libcli/smbreadline/readline.m4)
m4_include(heimdal_build/config.m4)
m4_include(../lib/util/fault.m4)
m4_include(../lib/util/signal.m4)
#include "lib/cmdline/popt_common.h"
#include "lib/events/events.h"
#include "system/time.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "lib/registry/tools/common.h"
#include "param/param.h"
#include "includes.h"
#include "system/readline.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "lib/cmdline/popt_common.h"
#include "auth/credentials/credentials.h"
#include "torture/smbtorture.h"
#include "system/wait.h"
#include "system/filesys.h"
#include "system/readline.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "libcli/libcli.h"
#include "lib/events/events.h"
conf.RECURSE('../lib/uid_wrapper')
conf.RECURSE('../lib/popt')
conf.RECURSE('../lib/subunit/c')
- conf.RECURSE('lib/smbreadline')
+ conf.RECURSE('../libcli/smbreadline')
conf.RECURSE('../pidl')
conf.RECURSE('selftest')
bld.RECURSE('lib/policy')
bld.RECURSE('../libcli/named_pipe_auth')
bld.RECURSE('heimdal_build')
-bld.RECURSE('lib/smbreadline')
+bld.RECURSE('../libcli/smbreadline')
bld.RECURSE('../codepages')
bld.RECURSE('setup')
bld.RECURSE('scripting')