Ignore:
Timestamp:
Mar 21, 2007, 12:48:32 PM (13 years ago)
Author:
Bruno Cornec
Message:

Begining of work on conf file introduction in mondo

  • create a new struct mr_ar_conf to store conf info
  • adds a static mr_ar_store_conf function to store conf file info in that struc
  • mondo.conf is now the .dist version
  • md5 not done yet

Not tested may not work at all nor compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/lib/mr_conf.c

    r1227 r1256  
    207207}
    208208
     209
    209210/*
    210211  reads string outstr after string str in the current file (between
     
    256257    mr_free(q);
    257258
     259    return ret;
     260}
     261
     262/*read boolean after string str in the current file*/
     263bool mr_conf_bread(const char *field_name) {
     264    char *p = NULL;             /*pointer to the field */
     265    bool ret = FALSE;
     266   
     267    p = mr_conf_sread(field_name);
     268    if (p != NULL) {
     269        /* match if yes/true/1 */
     270        if ((strncasecmp(p, "y" , (size_t)1) == 0) ||
     271            (strncasecmp(p, "t" , (size_t)1) == 0) ||
     272            (strncasecmp(p, "1" , (size_t)1) == 0)) {
     273            ret = TRUE;
     274        }
     275    }
    258276    return ret;
    259277}
Note: See TracChangeset for help on using the changeset viewer.