Part of the CCNx C Library. More...
Go to the source code of this file.
Functions | |
int | lned_run (int, char **, const char *, int(*)(int, char **)) |
Interpose a simple line editor in front of a command-line utility. |
Part of the CCNx C Library.
Definition in file lned.h.
int lned_run | ( | int | argc, | |
char ** | argv, | |||
const char * | prompt, | |||
int(*)(int, char **) | worker | |||
) |
Interpose a simple line editor in front of a command-line utility.
This should be called early in the application's main program, in particular before the creation of threads or the use of stdio.
If both stdin and stdout are tty devices, worker() is called in a forked process, and it may use the standard file descriptors in a conventional fashion. Otherwise worker() is just called directly.
Definition at line 316 of file lned.c.
Referenced by main().