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.
This commit is contained in:
christos 2018-06-09 17:41:55 +00:00
parent 84a5dd583d
commit a3c16b5549
2 changed files with 12 additions and 12 deletions

View File

@ -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. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include "config.h" #include "config.h"
#if !defined(lint) && !defined(SCCSID) #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 */ #endif /* not lint && not SCCSID */
#include <sys/types.h> #include <sys/types.h>
@ -80,7 +80,7 @@ int rl_end = 0;
char *rl_line_buffer = NULL; char *rl_line_buffer = NULL;
rl_vcpfunc_t *rl_linefunc = NULL; rl_vcpfunc_t *rl_linefunc = NULL;
int rl_done = 0; int rl_done = 0;
VFunction *rl_event_hook = NULL; rl_hook_func_t *rl_event_hook = NULL;
KEYMAP_ENTRY_ARRAY emacs_standard_keymap, KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
emacs_meta_keymap, emacs_meta_keymap,
emacs_ctlx_keymap; emacs_ctlx_keymap;
@ -2079,10 +2079,7 @@ rl_callback_read_char(void)
} else } else
wbuf = NULL; wbuf = NULL;
(*(void (*)(const char *))rl_linefunc)(wbuf); (*(void (*)(const char *))rl_linefunc)(wbuf);
if (!rl_already_prompted) {
el_set(e, EL_UNBUFFERED, 1); el_set(e, EL_UNBUFFERED, 1);
rl_already_prompted = 1;
}
} }
} }

View File

@ -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. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -38,11 +38,13 @@
/* typedefs */ /* typedefs */
typedef int Function(const char *, int); typedef int Function(const char *, int);
typedef char *CPFunction(const char *, int);
typedef void VFunction(void); typedef void VFunction(void);
typedef void rl_vcpfunc_t(char *); typedef void rl_vcpfunc_t(char *);
typedef char **rl_completion_func_t(const char *, int, int); typedef char **rl_completion_func_t(const char *, int, int);
typedef char *rl_compentry_func_t(const char *, int); typedef char *rl_compentry_func_t(const char *, int);
typedef int rl_command_func_t(int, int); typedef int rl_command_func_t(int, int);
typedef int rl_hook_func_t(void);
/* only supports length */ /* only supports length */
typedef struct { typedef struct {
@ -137,6 +139,7 @@ extern VFunction *rl_redisplay_function;
extern VFunction *rl_completion_display_matches_hook; extern VFunction *rl_completion_display_matches_hook;
extern VFunction *rl_prep_term_function; extern VFunction *rl_prep_term_function;
extern VFunction *rl_deprep_term_function; extern VFunction *rl_deprep_term_function;
extern rl_hook_func_t *rl_event_hook;
extern int readline_echoing_p; extern int readline_echoing_p;
extern int _rl_print_completions_horizontally; extern int _rl_print_completions_horizontally;
@ -177,7 +180,7 @@ char *filename_completion_function(const char *, int);
char *username_completion_function(const char *, int); char *username_completion_function(const char *, int);
int rl_complete(int, int); int rl_complete(int, int);
int rl_read_key(void); 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); void rl_display_match_list(char **, int, int);
int rl_insert(int, int); int rl_insert(int, int);