version 1.6.4.5, 2012/04/02 16:11:13
|
version 1.9, 2012/07/25 15:24:20
|
Line 69 _selectAttribute(cfg_root_t * __restrict cfg, const ch
|
Line 69 _selectAttribute(cfg_root_t * __restrict cfg, const ch
|
return RB_FIND(tagRC, cfg, &fav); |
return RB_FIND(tagRC, cfg, &fav); |
} |
} |
|
|
static inline void |
|
_destroyAttribute(struct tagCfg *av) |
|
{ |
|
if (!av) |
|
return; |
|
|
|
} |
|
|
|
/* --------------------------------------------------------------- */ |
/* --------------------------------------------------------------- */ |
|
|
/* |
/* |
Line 143 cfg_unsetAttribute(cfg_root_t * __restrict cfg, const
|
Line 135 cfg_unsetAttribute(cfg_root_t * __restrict cfg, const
|
AIT_FREE_VAL(&av->cfg_val); |
AIT_FREE_VAL(&av->cfg_val); |
AIT_FREE_VAL(&av->cfg_attr); |
AIT_FREE_VAL(&av->cfg_attr); |
AIT_FREE_VAL(&av->cfg_sec); |
AIT_FREE_VAL(&av->cfg_sec); |
free(av); | io_free(av); |
return 1; |
return 1; |
} |
} |
|
|
Line 169 cfg_setAttribute(cfg_root_t * __restrict cfg, const ch
|
Line 161 cfg_setAttribute(cfg_root_t * __restrict cfg, const ch
|
/* adding new element */ |
/* adding new element */ |
section = _selectAttribute(cfg, csSec, NULL); |
section = _selectAttribute(cfg, csSec, NULL); |
|
|
av = malloc(sizeof(struct tagCfg)); | av = io_malloc(sizeof(struct tagCfg)); |
if (!av) { |
if (!av) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
Line 256 cfg_loadAttribute(cfg_root_t * __restrict cfg, const c
|
Line 248 cfg_loadAttribute(cfg_root_t * __restrict cfg, const c
|
return -1; |
return -1; |
} |
} |
|
|
|
AIT_INIT_VAL(val); |
av = _selectAttribute(cfg, csSec, csAttr); |
av = _selectAttribute(cfg, csSec, csAttr); |
if (!av) { |
if (!av) { |
/* not found item */ |
/* not found item */ |
if (csDefValue) { |
if (csDefValue) { |
AIT_SET_STR(val, csDefValue); |
AIT_SET_STR(val, csDefValue); |
ret = AIT_LEN(val); |
ret = AIT_LEN(val); |
} | } else |
| AIT_INIT_VAL(val); |
return ret; |
return ret; |
} |
} |
|
|
Line 271 cfg_loadAttribute(cfg_root_t * __restrict cfg, const c
|
Line 265 cfg_loadAttribute(cfg_root_t * __restrict cfg, const c
|
if (csDefValue) { |
if (csDefValue) { |
AIT_SET_STR(val, csDefValue); |
AIT_SET_STR(val, csDefValue); |
ret = AIT_LEN(val); |
ret = AIT_LEN(val); |
} | } else |
| AIT_INIT_VAL(val); |
} else { |
} else { |
/* copy value */ |
/* copy value */ |
AIT_SET_STR(val, AIT_GET_STR(&av->cfg_val)); |
AIT_SET_STR(val, AIT_GET_STR(&av->cfg_val)); |