Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit PR/53983: Jonathan Perkins: Fix types for readli...



details:   https://anonhg.NetBSD.org/src/rev/6086fa88227f
branches:  trunk
changeset: 448957:6086fa88227f
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 15 23:20:35 2019 +0000

description:
PR/53983: Jonathan Perkins: Fix types for readline compatibility

diffstat:

 lib/libedit/readline.c          |  18 ++++++++++--------
 lib/libedit/readline/readline.h |  12 ++++++------
 lib/libedit/terminal.c          |   6 +++---
 3 files changed, 19 insertions(+), 17 deletions(-)

diffs (167 lines):

diff -r d7b30b75ef6f -r 6086fa88227f lib/libedit/readline.c
--- a/lib/libedit/readline.c    Fri Feb 15 22:49:24 2019 +0000
+++ b/lib/libedit/readline.c    Fri Feb 15 23:20:35 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.150 2019/02/14 20:09:12 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.151 2019/02/15 23:20:35 christos Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.150 2019/02/14 20:09:12 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.151 2019/02/15 23:20:35 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -72,7 +72,7 @@
 static char expand_chars[] = { ' ', '\t', '\n', '=', '(', '\0' };
 static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
     '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
-char *rl_readline_name = empty;
+const char *rl_readline_name = empty;
 FILE *rl_instream = NULL;
 FILE *rl_outstream = NULL;
 int rl_point = 0;
@@ -105,7 +105,7 @@
 
 int rl_inhibit_completion = 0;
 int rl_attempted_completion_over = 0;
-char *rl_basic_word_break_characters = break_chars;
+const char *rl_basic_word_break_characters = break_chars;
 char *rl_completer_word_break_characters = NULL;
 char *rl_completer_quote_characters = NULL;
 rl_compentry_func_t *rl_completion_entry_function = NULL;
@@ -150,7 +150,7 @@
  * in the parsed text when it is passed to the completion function.
  * Shell uses this to help determine what kind of completing to do.
  */
-char *rl_special_prefixes = NULL;
+const char *rl_special_prefixes = NULL;
 
 /*
  * This is the character appended to the completed words if at the end of
@@ -1885,7 +1885,7 @@
 rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
 {
        static ct_buffer_t wbreak_conv, sprefix_conv;
-       char *breakchars;
+       const char *breakchars;
 
        if (h == NULL || e == NULL)
                rl_initialize();
@@ -1971,13 +1971,14 @@
  * reset the terminal
  */
 /* ARGSUSED */
-void
+int
 rl_reset_terminal(const char *p __attribute__((__unused__)))
 {
 
        if (h == NULL || e == NULL)
                rl_initialize();
        el_reset(e);
+       return 0;
 }
 
 
@@ -2166,7 +2167,7 @@
        return el_set(e, EL_BIND, "", var, value, NULL) == -1 ? 1 : 0;
 }
 
-void
+int
 rl_stuff_char(int c)
 {
        char buf[2];
@@ -2174,6 +2175,7 @@
        buf[0] = (char)c;
        buf[1] = '\0';
        el_insertstr(e, buf);
+       return 1;
 }
 
 static int
diff -r d7b30b75ef6f -r 6086fa88227f lib/libedit/readline/readline.h
--- a/lib/libedit/readline/readline.h   Fri Feb 15 22:49:24 2019 +0000
+++ b/lib/libedit/readline/readline.h   Fri Feb 15 23:20:35 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.h,v 1.44 2018/12/02 16:58:13 christos Exp $   */
+/*     $NetBSD: readline.h,v 1.45 2019/02/15 23:20:35 christos Exp $   */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -99,14 +99,14 @@
 #endif
 extern const char      *rl_library_version;
 extern int             rl_readline_version;
-extern char            *rl_readline_name;
+extern const char      *rl_readline_name;
 extern FILE            *rl_instream;
 extern FILE            *rl_outstream;
 extern char            *rl_line_buffer;
 extern int              rl_point, rl_end;
 extern int              history_base, history_length;
 extern int              max_input_history;
-extern char            *rl_basic_word_break_characters;
+extern const char      *rl_basic_word_break_characters;
 extern char            *rl_completer_word_break_characters;
 extern char            *rl_completer_quote_characters;
 extern rl_compentry_func_t *rl_completion_entry_function;
@@ -115,7 +115,7 @@
 extern int              rl_attempted_completion_over;
 extern int             rl_completion_type;
 extern int             rl_completion_query_items;
-extern char            *rl_special_prefixes;
+extern const char      *rl_special_prefixes;
 extern int             rl_completion_append_character;
 extern int             rl_inhibit_completion;
 extern Function                *rl_pre_input_hook;
@@ -185,7 +185,7 @@
 
 int             rl_insert(int, int);
 int             rl_insert_text(const char *);
-void            rl_reset_terminal(const char *);
+int             rl_reset_terminal(const char *);
 void            rl_resize_terminal(void);
 int             rl_bind_key(int, rl_command_func_t *);
 int             rl_newline(int, int);
@@ -199,7 +199,7 @@
 int             rl_read_init_file(const char *);
 int             rl_parse_and_bind(const char *);
 int             rl_variable_bind(const char *, const char *);
-void            rl_stuff_char(int);
+int             rl_stuff_char(int);
 int             rl_add_defun(const char *, rl_command_func_t *, int);
 HISTORY_STATE  *history_get_history_state(void);
 void            rl_get_screen_size(int *, int *);
diff -r d7b30b75ef6f -r 6086fa88227f lib/libedit/terminal.c
--- a/lib/libedit/terminal.c    Fri Feb 15 22:49:24 2019 +0000
+++ b/lib/libedit/terminal.c    Fri Feb 15 23:20:35 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: terminal.c,v 1.34 2018/11/24 12:17:35 christos Exp $   */
+/*     $NetBSD: terminal.c,v 1.35 2019/02/15 23:20:35 christos Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c     8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.34 2018/11/24 12:17:35 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.35 2019/02/15 23:20:35 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -419,7 +419,7 @@
        return 0;
 }
 
-static wchar_t **
+static wint_t **
 terminal_alloc_buffer(EditLine *el)
 {
        wint_t **b;



Home | Main Index | Thread Index | Old Index