txMain.c: readline needs function shim for prototype difference TxGetChar

USE_READLINE build option
This commit is contained in:
Darryl L. Miles 2025-08-25 11:29:34 +01:00 committed by R. Timothy Edwards
parent 3b57ae1179
commit 0f047b89ce
1 changed files with 9 additions and 1 deletions

View File

@ -101,6 +101,14 @@ TxInit(void)
#ifdef USE_READLINE #ifdef USE_READLINE
/*ARGSUSED*/
static int
TxGetChar_internal(FILE *fp)
{
/* The readline prototype is: typedef int rl_getc_func_t PARAMS((FILE *)); */
return TxGetChar();
}
void void
TxInitReadline(void) TxInitReadline(void)
{ {
@ -108,7 +116,7 @@ TxInitReadline(void)
const char * const *commandTable; const char * const *commandTable;
char nobell[] = "set bell-style none"; char nobell[] = "set bell-style none";
rl_getc_function = TxGetChar; rl_getc_function = TxGetChar_internal;
rl_pre_input_hook = TxPrefix; rl_pre_input_hook = TxPrefix;
rl_readline_name = "magic"; rl_readline_name = "magic";