cfsection=items;
}
-byte *cf_set_item(byte *sect, byte *name, byte *value)
+struct cfitem *cf_get_item(byte *sect, byte *name)
{
struct cfitem *item;
- byte *msg=NULL;
item=cfsection;
while(item && strcasecmp(item->name,sect))
item=item->var;
- if(!item) /* ignore unknown section */
+ if(!item) /* unknown section */
return NULL;
for(item++; item->type && strcasecmp(item->name,name); item++);
+ return item; /* item->type == 0 if not found */
+}
+
+byte *cf_set_item(byte *sect, byte *name, byte *value)
+{
+ struct cfitem *item;
+ byte *msg=NULL;
+
+ item=cf_get_item(sect,name);
+ if(!item) /* ignore unknown section */
+ return NULL;
+
switch(item->type){
case CT_INT:
{
* Direct setting of configuration items and parsing the configuration file.
*/
+struct cfitem *cf_get_item(byte *sect, byte *name);
byte *cf_set_item(byte *sect, byte *name, byte *value);
void cf_read(byte *filename);