#include #include #include #include #include "config.h" typedef struct { char *key; char *val; } ENTRY; static ENTRY *Config=NULL; static int nConfig=0; static char *strip (char *s) { char *p; while (isblank(*s)) s++; for (p=s; *p; p++) { if (*p=='"') do p++; while (*p && *p!='\n' && *p!='"'); if (*p=='\'') do p++; while (*p && *p!='\n' && *p!='\''); if (*p=='#' || *p=='\n') { *p='\0'; break; } } for (p--; p>s && isblank(*p); p--) *p='\0'; return s; } void set_cfg (char *key, char *val) { int i; for (i=0; i