SPRAAK
|
Data Structures | |
struct | SprEditLine |
Functions | |
SprStream * | spr_edit_log (const char *fname, SprEditLine *ledit) |
SprEditLine * | spr_edit_free (SprEditLine *ledit) |
SprEditLine * | spr_edit_setup (SprStream *fdi, SprStream *fdo) |
char * | spr_edit_read (SprEditLine *ledit, const char *lm, const char *rm) |
int | spr_edit_history (SprStream *dest, const char *fname, SprEditLine *ledit, int size) |
int | spr_edit_peek (SprEditLine *ledit) |
SprStream* spr_edit_log | ( | const char * | fname, |
SprEditLine * | ledit | ||
) |
Log all commands read to a specified file. The logging is turned off by specifying an empty file name or a "/" as file name.
SprEditLine* spr_edit_free | ( | SprEditLine * | ledit | ) |
SprEditLine* spr_edit_setup | ( | SprStream * | fdi, |
SprStream * | fdo | ||
) |
Check if fdi maps to a terminal, and if so, allow editing the input (cf. readline). If fdi equals NULL, "stdin" will be assumed. If fdo equals NULL, "stdout" will be assumed.
char* spr_edit_read | ( | SprEditLine * | ledit, |
const char * | lm, | ||
const char * | rm | ||
) |
int spr_edit_history | ( | SprStream * | dest, |
const char * | fname, | ||
SprEditLine * | ledit, | ||
int | size | ||
) |
Write the command history to the given file fname or file pointer dest. The file pointer will only be used if the file name in empty.
int spr_edit_peek | ( | SprEditLine * | ledit | ) |
Look if there is data waiting to be read. Returns (1) if data is waiting, zero otherwise. Not functional on Windows.