From 9c4927d3624c594ea6647d946540ce286a948805 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 18 Mar 2001 13:24:57 +0000 Subject: much better readline support from Simo Sorce, with some mods from me to make it a bit simpler (This used to be commit e1487eb2c4626dbe0cc3b17606eda702cedef28b) --- source3/include/config.h.in | 3 +++ source3/include/includes.h | 20 ++---------------- source3/include/proto.h | 13 ++++++++++-- source3/include/smb_readline.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 source3/include/smb_readline.h (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 82fd2910ca..53599a0959 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -960,3 +960,6 @@ /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET + +/* Define if you have the termcap library (-ltermcap). */ +#undef HAVE_LIBTERMCAP diff --git a/source3/include/includes.h b/source3/include/includes.h index 1102f99d05..f2c185e086 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -616,6 +616,8 @@ extern int errno; #include "messages.h" #include "util_list.h" +#include "smb_readline.h" /* SSS: samba readline support */ + #ifndef UBI_BINTREE_H #include "ubi_Cache.h" #endif /* UBI_BINTREE_H */ @@ -787,24 +789,6 @@ enum nss_status { #define ULTRIX_AUTH 1 #endif -#ifdef HAVE_LIBREADLINE -# ifdef HAVE_READLINE_READLINE_H -# include -# ifdef HAVE_READLINE_HISTORY_H -# include -# endif -# else -# ifdef HAVE_READLINE_H -# include -# ifdef HAVE_HISTORY_H -# include -# endif -# else -# undef HAVE_LIBREADLINE -# endif -# endif -#endif - #ifndef HAVE_STRDUP char *strdup(const char *s); #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index d244329470..2abbada5a7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -164,6 +164,14 @@ int ms_fnmatch(char *pattern, char *string); pid_t pidfile_pid(char *name); void pidfile_create(char *name); +/*The following definitions come from lib/readline.c */ + +void smb_rl_read_char (void); +void init_smb_readline(char *prg_name, char *cline_ptr, int *event_ptr); +void smb_readline_prompt(char *prompt); +void smb_readline_remove_handler(void); +void cmd_history(void); + /*The following definitions come from lib/replace.c */ char *rep_inet_ntoa(struct in_addr ip); @@ -2003,8 +2011,9 @@ void pcap_printer_fn(void (*fn)(char *, char *)); /*The following definitions come from printing/print_cups.c */ -void cups_printer_fn(void (*fn)(char *, char *)); -int cups_printername_ok(char *name); + +/*The following definitions come from printing/print_generic.c */ + /*The following definitions come from printing/print_svid.c */ diff --git a/source3/include/smb_readline.h b/source3/include/smb_readline.h new file mode 100644 index 0000000000..1b46c5f6ea --- /dev/null +++ b/source3/include/smb_readline.h @@ -0,0 +1,46 @@ +/* + Unix SMB/Netbios implementation. + Version 3.0. + SMB client + Copyright (C) Simo Sorce 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_LIBREADLINE +# ifdef HAVE_READLINE_READLINE_H +# include +# ifdef HAVE_READLINE_HISTORY_H +# include +# endif +# else +# ifdef HAVE_READLINE_H +# include +# ifdef HAVE_HISTORY_H +# include +# endif +# else +# undef HAVE_LIBREADLINE +# endif +# endif +#endif + +#define RL_NO_EVENTS 0 +#define RL_GOT_LINE 1 +#define RL_GOT_EOF 2 +#define RL_ERROR -1 + + + -- cgit