27 #include <sys/types.h>
42 char * cnf_file = va_arg(*params,
char *);
43 size_t ncnf_file = strlen(cnf_file);
45 this->cnf_file =
memMalloc(ncnf_file + 1);
46 memcpy(this->cnf_file, cnf_file, ncnf_file);
47 this->cnf_file[ncnf_file] =
'\0';
49 handle = fopen(this->cnf_file,
"r");
66 while (isspace(*key)) {
70 if (
'#' == *key || 0 == *key) {
74 while (! isspace(key[nkey])) {
78 value = &(key[nkey+1]);
79 while (isspace(*value)) {
83 while (
'\0' != value[nvalue+nspaces]
84 &&
'\n' != value[nvalue+nspaces])
86 if (isspace(value[nvalue+nspaces])) {
99 if (0 != nkey && 0 != nvalue) {
102 new(ConfigValue, key, nkey, value, nvalue));
static int configCtor(void *_this, va_list *params)
INIT_IFACE(Class, configCtor, configDtor, NULL)
static void configDtor(void *_this)
CREATE_CLASS(Config, NULL, IFACE(Class))
void * hashAdd(Hash, void *)