r2070: Let's try to overload srnlen and strndup for AIX where they are natly broken.
[tprouty/samba.git] / source / lib / readline.c
index 8b90c32c7f9f1066c388f2c3bef10248b5b5baab..78b99fd7fb03168fe78c71d1e4d8feea61e6d1cb 100644 (file)
@@ -51,7 +51,7 @@
 ****************************************************************************/
 
 static char *smb_readline_replacement(char *prompt, void (*callback)(void), 
-                               char **(completion_fn)(char *text, int start, int end))
+                               char **(completion_fn)(const char *text, int start, int end))
 {
        fd_set fds;
        static pstring line;
@@ -83,7 +83,7 @@ static char *smb_readline_replacement(char *prompt, void (*callback)(void),
 ****************************************************************************/
 
 char *smb_readline(char *prompt, void (*callback)(void), 
-                  char **(completion_fn)(char *text, int start, int end))
+                  char **(completion_fn)(const char *text, int start, int end))
 {
 #if HAVE_LIBREADLINE
        if (isatty(x_fileno(x_stdin))) {
@@ -115,6 +115,29 @@ char *smb_readline(char *prompt, void (*callback)(void),
        return smb_readline_replacement(prompt, callback, completion_fn);
 }
 
+/****************************************************************************
+ * return line buffer text
+ ****************************************************************************/
+const char *smb_readline_get_line_buffer(void)
+{
+#if defined(HAVE_LIBREADLINE)
+       return rl_line_buffer;
+#else
+       return NULL;
+#endif
+}
+
+
+/****************************************************************************
+ * set completion append character
+ ***************************************************************************/
+void smb_readline_ca_char(char c)
+{
+#if defined(HAVE_LIBREADLINE)
+       rl_completion_append_character = c;
+#endif
+}
+
 /****************************************************************************
 history
 ****************************************************************************/
@@ -135,3 +158,4 @@ int cmd_history(void)
 
        return 0;
 }
+