#include #include #include #include #include #include #include #include TSTR_LIST read_config(const char *filename) { FILE *f; TSTR_LIST ls; char buff[256]; f=fopen_icase(filename,"r"); if (f==NULL) return NULL; ls=create_list(256); while (!feof(f)) { char *c; buff[0]=0; if (fgets(buff,256,f)==NULL) break; c=strchr(buff,'\n');if (c!=NULL) *c=0; if (ferror(f)) { release_list(ls); fclose(f); return NULL; } str_add(&ls,buff); } fclose(f); return ls; } TSTR_LIST merge_configs(TSTR_LIST target, TSTR_LIST source) { char buff[256]; int i; char *c; for (i=0;i