version 1.6, 2011/05/01 17:24:28
|
version 1.6.2.1, 2011/05/10 20:52:36
|
Line 54 SUCH DAMAGE.
|
Line 54 SUCH DAMAGE.
|
* @csAttr = Config attribute //{csAttr} = ..., if NULL search in *any* attribute |
* @csAttr = Config attribute //{csAttr} = ..., if NULL search in *any* attribute |
* return: NULL not found attribute; //{tagPair} selected first seen attribute item from list |
* return: NULL not found attribute; //{tagPair} selected first seen attribute item from list |
*/ |
*/ |
static inline struct tagPair *SelectAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) | static inline struct tagPair * |
| SelectAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) |
{ |
{ |
struct tagPair *av; |
struct tagPair *av; |
|
|
Line 83 static inline struct tagPair *SelectAttribute(sl_confi
|
Line 84 static inline struct tagPair *SelectAttribute(sl_confi
|
* DestroyAttribute() Free //{tagPair} item elements memory and destroy resource |
* DestroyAttribute() Free //{tagPair} item elements memory and destroy resource |
* @pair = Free this element |
* @pair = Free this element |
*/ |
*/ |
static inline void DestroyAttribute(struct tagPair *pair) | static inline void |
| DestroyAttribute(struct tagPair *pair) |
{ |
{ |
if (!pair) |
if (!pair) |
return; |
return; |
Line 107 static inline void DestroyAttribute(struct tagPair *pa
|
Line 109 static inline void DestroyAttribute(struct tagPair *pa
|
* @csAttr = Config attribute //{csAttr} = ... |
* @csAttr = Config attribute //{csAttr} = ... |
* return: 0 not found item; -1 error: null parameters; >0 position in list |
* return: 0 not found item; -1 error: null parameters; >0 position in list |
*/ |
*/ |
inline int cfg_FindAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) | inline int |
| cfg_FindAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) |
{ |
{ |
struct tagPair *av; |
struct tagPair *av; |
register int cx = 0; |
register int cx = 0; |
Line 135 inline int cfg_FindAttribute(sl_config * __restrict cf
|
Line 138 inline int cfg_FindAttribute(sl_config * __restrict cf
|
* @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute |
* @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute |
* return: 0 item not found, -1 error: null parameters; >0 position in list |
* return: 0 item not found, -1 error: null parameters; >0 position in list |
*/ |
*/ |
int cfg_UnsetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) | int |
| cfg_UnsetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) |
{ |
{ |
struct tagPair *av, *curr; |
struct tagPair *av, *curr; |
register int cx = 0; |
register int cx = 0; |
Line 175 int cfg_UnsetAttribute(sl_config * __restrict cfg, con
|
Line 179 int cfg_UnsetAttribute(sl_config * __restrict cfg, con
|
* @csVal = Config value //... = {csVal} to setup |
* @csVal = Config value //... = {csVal} to setup |
* return: 0 nothing changed, -1 error: not enough memory; 1 find and update item; 2 added new item |
* return: 0 nothing changed, -1 error: not enough memory; 1 find and update item; 2 added new item |
*/ |
*/ |
int cfg_SetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr, const u_char *csVal) | int |
| cfg_SetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr, const u_char *csVal) |
{ |
{ |
struct tagPair *av, *section; |
struct tagPair *av, *section; |
int len; |
int len; |
Line 271 int cfg_SetAttribute(sl_config * __restrict cfg, const
|
Line 276 int cfg_SetAttribute(sl_config * __restrict cfg, const
|
* @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute |
* @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute |
* return: NULL item not found or null parameters; !=NULL value const string |
* return: NULL item not found or null parameters; !=NULL value const string |
*/ |
*/ |
inline const u_char *cfg_GetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) | inline const u_char * |
| cfg_GetAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr) |
{ |
{ |
struct tagPair *av; |
struct tagPair *av; |
|
|
Line 290 inline const u_char *cfg_GetAttribute(sl_config * __re
|
Line 296 inline const u_char *cfg_GetAttribute(sl_config * __re
|
* @cfg = Head list element |
* @cfg = Head list element |
* return: NULL if no items in list; !=NULL first pair item |
* return: NULL if no items in list; !=NULL first pair item |
*/ |
*/ |
inline struct tagPair *cfg_FirstItem(sl_config * __restrict cfg) | inline struct tagPair * |
| cfg_FirstItem(sl_config * __restrict cfg) |
{ |
{ |
return cfg->slh_first; |
return cfg->slh_first; |
} |
} |
Line 307 inline struct tagPair *cfg_FirstItem(sl_config * __res
|
Line 314 inline struct tagPair *cfg_FirstItem(sl_config * __res
|
* @csDefValue = *Default Value* for return in //{psVal}, if not found item in config list |
* @csDefValue = *Default Value* for return in //{psVal}, if not found item in config list |
* return: 0 item not found, -1 error: null parameters; >0 number of copied bytes in //{psVal} |
* return: 0 item not found, -1 error: null parameters; >0 number of copied bytes in //{psVal} |
*/ |
*/ |
int cfg_LoadAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr, | int |
| cfg_LoadAttribute(sl_config * __restrict cfg, const u_char *csSec, const u_char *csAttr, |
u_char * __restrict psVal, int ValLen, const char *csDefValue) |
u_char * __restrict psVal, int ValLen, const char *csDefValue) |
{ |
{ |
struct tagPair *av; |
struct tagPair *av; |