Sat Feb 19 17:45:02 2022 UTC ()
PR/56695: Walter Lozano: Correct declaration of hook functions.


(christos)
diff -r1.172 -r1.173 src/lib/libedit/readline.c
diff -r1.52 -r1.53 src/lib/libedit/readline/readline.h

cvs diff -r1.172 -r1.173 src/lib/libedit/readline.c (expand / switch to context diff)
--- src/lib/libedit/readline.c 2022/02/08 15:05:10 1.172
+++ src/lib/libedit/readline.c 2022/02/19 17:45:02 1.173
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.172 2022/02/08 15:05:10 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.173 2022/02/19 17:45:02 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.172 2022/02/08 15:05:10 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.173 2022/02/19 17:45:02 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -113,8 +113,8 @@
 rl_compentry_func_t *rl_completion_entry_function = NULL;
 char *(*rl_completion_word_break_hook)(void) = NULL;
 rl_completion_func_t *rl_attempted_completion_function = NULL;
-Function *rl_pre_input_hook = NULL;
-Function *rl_startup1_hook = NULL;
+rl_hook_func_t *rl_pre_input_hook = NULL;
+rl_hook_func_t *rl_startup1_hook = NULL;
 int (*rl_getc_function)(FILE *) = NULL;
 char *rl_terminal_name = NULL;
 int rl_already_prompted = 0;
@@ -123,7 +123,7 @@
 int readline_echoing_p = 1;
 int _rl_print_completions_horizontally = 0;
 VFunction *rl_redisplay_function = NULL;
-Function *rl_startup_hook = NULL;
+rl_hook_func_t *rl_startup_hook = NULL;
 VFunction *rl_completion_display_matches_hook = NULL;
 VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
 VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
@@ -445,7 +445,7 @@
 	if (e == NULL || h == NULL)
 		rl_initialize();
 	if (rl_startup_hook) {
-		(*rl_startup_hook)(NULL, 0);
+		(*rl_startup_hook)();
 	}
 	tty_init(e);
 
@@ -460,7 +460,7 @@
 		goto out;
 
 	if (rl_pre_input_hook)
-		(*rl_pre_input_hook)(NULL, 0);
+		(*rl_pre_input_hook)();
 
 	if (rl_event_hook && !(e->el_flags & NO_TTY)) {
 		el_set(e, EL_GETCFN, _rl_event_read_char);

cvs diff -r1.52 -r1.53 src/lib/libedit/readline/readline.h (expand / switch to context diff)
--- src/lib/libedit/readline/readline.h 2022/02/08 15:05:10 1.52
+++ src/lib/libedit/readline/readline.h 2022/02/19 17:45:02 1.53
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.h,v 1.52 2022/02/08 15:05:10 christos Exp $	*/
+/*	$NetBSD: readline.h,v 1.53 2022/02/19 17:45:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -127,8 +127,8 @@
 extern const char	*rl_special_prefixes;
 extern int		rl_completion_append_character;
 extern int		rl_inhibit_completion;
-extern Function		*rl_pre_input_hook;
-extern Function		*rl_startup_hook;
+extern rl_hook_func_t		*rl_pre_input_hook;
+extern rl_hook_func_t		*rl_startup_hook;
 extern char		*rl_terminal_name;
 extern int		rl_already_prompted;
 extern char		*rl_prompt;