int config(&c);
stralloc *config_data(&c);
int config_default(&c,s);
int config_copy(&c,&d);
int config_env(&c,s);
int config_readline(&c,s);
int config_readfile(&c,s);
config_str c = CONFIG_STR;
config_str d = CONFIG_STR;
The configuration string is stored inside a stralloc. config_data returns a pointer to the stralloc.
config returns 1 if c has been configured, 0 otherwise.
Initially c is set to CONFIG_STR, which is unconfigured.
config_default configures c as a copy of the \0-terminated string s, if s is not the zero pointer.
config_copy configures c as a copy of d if d is configured.
config_env configures c as a copy of the first environment variable named s, if the environment has such a variable.
config_readline configures c as the first line of the file named s, if that file exists. It removes any trailing spaces or tabs from the line. It also converts every \0 inside the line to \n, so that the string can be used as a \0-terminated string after stralloc_0.
config_readfile configures c as the entire contents of the file named s, if that file exists. For each line, it removes any trailing spaces or tabs, converts every \0 inside the line to \n, and puts a \0 at the end of the line (even if the line was originally a partial final line). It skips blank lines and lines beginning with #.