Most of the code was kept in as few files as possible, with the smallest possible number of parameters.
Whenever more parameters are required, it should always be possible to give
as values to get a default behavior.
For example, the
read_line_alloc takes many parameters:
int read_line_alloc(void* in, DataSourceType in_type, char** line, int* sz_line, int i0, char from, char to, int keep_fromto, char interest, int* interest_count);The only really mandatory parameters are obviously
line. All others can be set to
read_line_alloc(f, DATA_SOURCE_FILE, &line, NULL, 0, 0, 0, 0, 0, NULL);will read bytes from
linestarting from current position in
funtil a newline character (or end-of-file) has been reached.
linewill be allocated but its size will not be returned (only the number of characters read). No special character will be counted during file reading.
So, if you are not too sure what to put as a parameter, just zero it, it should be fine! :)