Sync the alternative readline interface with reality:

+ the rl_callback_handler_install takes a pointer to a void function
  which has one char * argument (it's called that way in the readline
  emulation source, otherwise there's no way to pass the line buffer
  to the function which processes the line when EOL is encountered)

+ provide a prototype for that function signature and use it

Makes the callback readline interface work now.
This commit is contained in:
agc 2005-05-27 11:35:07 +00:00
parent 4cb475ede3
commit 26abf58dee
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: readline.c,v 1.53 2005/05/07 16:01:25 dsl Exp $ */
/* $NetBSD: readline.c,v 1.54 2005/05/27 11:35:07 agc Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: readline.c,v 1.53 2005/05/07 16:01:25 dsl Exp $");
__RCSID("$NetBSD: readline.c,v 1.54 2005/05/27 11:35:07 agc Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@ -1588,7 +1588,7 @@ rl_callback_read_char()
}
void
rl_callback_handler_install (const char *prompt, VFunction *linefunc)
rl_callback_handler_install (const char *prompt, VCPFunction *linefunc)
{
if (e == NULL) {
rl_initialize();

View File

@ -1,4 +1,4 @@
/* $NetBSD: readline.h,v 1.13 2005/04/12 22:01:40 christos Exp $ */
/* $NetBSD: readline.h,v 1.14 2005/05/27 11:35:07 agc Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -45,6 +45,7 @@
/* typedefs */
typedef int Function(const char *, int);
typedef void VFunction(void);
typedef void VCPFunction(char *);
typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int);
@ -167,7 +168,7 @@ void rl_reset_terminal(const char *);
int rl_bind_key(int, int (*)(int, int));
int rl_newline(int, int);
void rl_callback_read_char(void);
void rl_callback_handler_install(const char *, VFunction *);
void rl_callback_handler_install(const char *, VCPFunction *);
void rl_callback_handler_remove(void);
void rl_redisplay(void);
int rl_get_previous_history(int, int);