38 while (*d ==
' ' || *d ==
'\t' || *d ==
'\n' || *d ==
'\r') {
41 }
while ((*s++ = *d++));
52 FILE *f = fopen(filename,
"rt");
54 printf(
"Warning: could not open %s. %s.\n", filename, strerror(errno));
57 fseek(f, 0, SEEK_END);
58 const long len = ftell(f);
59 fseek(f, 0, SEEK_SET);
64 if (fgets(line_buff,
MAXLEN - 2, f) == NULL) {
68 if (strnlen(line_buff,
MAXLEN) == 0 || line_buff[0] ==
'#') {
71 char *ptr = strchr(line_buff,
'#');
75 strncat(file_buff, line_buff,
MAXLEN);
void config_read(struct XCSF *xcsf, const char *filename)
Reads the specified configuration file.
static void config_trim(char *s)
Removes tabs/spaces/lf/cr.
#define MAXLEN
Maximum config file line length to read.
Configuration file handling functions.
void param_json_import(struct XCSF *xcsf, const char *json_str)
Sets the parameters from a json formatted string.
Functions for setting and printing parameters.