MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / rl_callback_read_char

Function rl_callback_read_char

extern/editline/src/readline.c:1978–2002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1976}
1977
1978void
1979rl_callback_read_char(void)
1980{
1981 int count = 0, done = 0;
1982 const char *buf = el_gets(e, &count);
1983 char *wbuf;
1984
1985 if (buf == NULL || count-- <= 0)
1986 return;
1987 if (count == 0 && buf[0] == e->el_tty.t_c[TS_IO][C_EOF])
1988 done = 1;
1989 if (buf[count] == '\n' || buf[count] == '\r')
1990 done = 2;
1991
1992 if (done && rl_linefunc != NULL) {
1993 el_set(e, EL_UNBUFFERED, 0);
1994 if (done == 2) {
1995 if ((wbuf = strdup(buf)) != NULL)
1996 wbuf[count] = '\0';
1997 } else
1998 wbuf = NULL;
1999 (*(void (*)(const char *))rl_linefunc)(wbuf);
2000 el_set(e, EL_UNBUFFERED, 1);
2001 }
2002}
2003
2004void
2005rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)

Callers

nothing calls this directly

Calls 2

el_getsFunction · 0.85
el_setFunction · 0.85

Tested by

no test coverage detected