SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Functions
API_LowLvl::lib::io
+ Collaboration diagram for API_LowLvl::lib::io:

Data Structures

struct  SprEditLine
 

Functions

SprStreamspr_edit_log (const char *fname, SprEditLine *ledit)
 
SprEditLinespr_edit_free (SprEditLine *ledit)
 
SprEditLinespr_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)
 

Detailed Description

Function Documentation

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.

Returns
A handler on success and NULL on failure.
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.