Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit Provide more compatibility with readline headers...



details:   https://anonhg.NetBSD.org/src/rev/6009c83d4323
branches:  trunk
changeset: 323312:6009c83d4323
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jun 09 17:41:55 2018 +0000

description:
Provide more compatibility with readline headers; now python-3.6.5 works
when changing 'readline' -> 'edit' in setup.py.
Revert previous conditional setting of unbuffered.

diffstat:

 lib/libedit/readline.c          |  17 +++++++----------
 lib/libedit/readline/readline.h |   7 +++++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (95 lines):

diff -r 7339faecb645 -r 6009c83d4323 lib/libedit/readline.c
--- a/lib/libedit/readline.c    Sat Jun 09 02:25:52 2018 +0000
+++ b/lib/libedit/readline.c    Sat Jun 09 17:41:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.146 2018/01/01 22:32:46 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.147 2018/06/09 17:41:55 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.146 2018/01/01 22:32:46 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.147 2018/06/09 17:41:55 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -80,7 +80,7 @@
 char *rl_line_buffer = NULL;
 rl_vcpfunc_t *rl_linefunc = NULL;
 int rl_done = 0;
-VFunction *rl_event_hook = NULL;
+rl_hook_func_t *rl_event_hook = NULL;
 KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
     emacs_meta_keymap,
     emacs_ctlx_keymap;
@@ -429,7 +429,7 @@
        if (rl_pre_input_hook)
                (*rl_pre_input_hook)(NULL, 0);
 
-       if (rl_event_hook && !(e->el_flags&NO_TTY)) {
+       if (rl_event_hook && !(e->el_flags & NO_TTY)) {
                el_set(e, EL_GETCFN, _rl_event_read_char);
                used_event_hook = 1;
        }
@@ -2074,15 +2074,12 @@
        if (done && rl_linefunc != NULL) {
                el_set(e, EL_UNBUFFERED, 0);
                if (done == 2) {
-                   if ((wbuf = strdup(buf)) != NULL)
-                       wbuf[count] = '\0';
+                       if ((wbuf = strdup(buf)) != NULL)
+                               wbuf[count] = '\0';
                } else
                        wbuf = NULL;
                (*(void (*)(const char *))rl_linefunc)(wbuf);
-               if (!rl_already_prompted) {
-                   el_set(e, EL_UNBUFFERED, 1);
-                   rl_already_prompted = 1;
-               }
+               el_set(e, EL_UNBUFFERED, 1);
        }
 }
 
diff -r 7339faecb645 -r 6009c83d4323 lib/libedit/readline/readline.h
--- a/lib/libedit/readline/readline.h   Sat Jun 09 02:25:52 2018 +0000
+++ b/lib/libedit/readline/readline.h   Sat Jun 09 17:41:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.h,v 1.42 2017/09/01 10:19:10 christos Exp $   */
+/*     $NetBSD: readline.h,v 1.43 2018/06/09 17:41:55 christos Exp $   */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -38,11 +38,13 @@
 
 /* typedefs */
 typedef int      Function(const char *, int);
+typedef char     *CPFunction(const char *, int);
 typedef void     VFunction(void);
 typedef void     rl_vcpfunc_t(char *);
 typedef char   **rl_completion_func_t(const char *, int, int);
 typedef char     *rl_compentry_func_t(const char *, int);
 typedef int      rl_command_func_t(int, int);
+typedef int      rl_hook_func_t(void);
 
 /* only supports length */
 typedef struct {
@@ -137,6 +139,7 @@
 extern VFunction       *rl_completion_display_matches_hook;
 extern VFunction       *rl_prep_term_function;
 extern VFunction       *rl_deprep_term_function;
+extern rl_hook_func_t  *rl_event_hook;
 extern int             readline_echoing_p;
 extern int             _rl_print_completions_horizontally;
 
@@ -177,7 +180,7 @@
 char           *username_completion_function(const char *, int);
 int             rl_complete(int, int);
 int             rl_read_key(void);
-char          **completion_matches(const char *, rl_compentry_func_t *);
+char          **completion_matches(/* const */ char *, rl_compentry_func_t *);
 void            rl_display_match_list(char **, int, int);
 
 int             rl_insert(int, int);



Home | Main Index | Thread Index | Old Index