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

This commit is contained in:
christos 2019-02-15 23:20:35 +00:00
parent b46d30012f
commit 52b10dfde0
3 changed files with 19 additions and 17 deletions

View File

@ -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 empty[] = { '\0' };
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 @@ char *history_arg_extract(int start, int end, const char *str);
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 @@ int rl_completion_query_items = 100;
* 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 @@ int
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 @@ rl_read_key(void)
* 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 @@ rl_variable_bind(const char *var, const char *value)
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 @@ rl_stuff_char(int c)
buf[0] = (char)c;
buf[1] = '\0';
el_insertstr(e, buf);
return 1;
}
static int

View File

@ -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 @@ extern "C" {
#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 rl_completion_func_t *rl_attempted_completion_function;
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 @@ void rl_display_match_list(char **, int, int);
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 @@ void rl_deprep_terminal(void);
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 *);

View File

@ -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 @@ terminal_rebuffer_display(EditLine *el)
return 0;
}
static wchar_t **
static wint_t **
terminal_alloc_buffer(EditLine *el)
{
wint_t **b;