--- libaitcfg/src/queue.c 2011/05/01 17:24:28 1.6 +++ libaitcfg/src/queue.c 2011/05/10 20:52:36 1.6.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: queue.c,v 1.6 2011/05/01 17:24:28 misho Exp $ +* $Id: queue.c,v 1.6.2.1 2011/05/10 20:52:36 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -54,7 +54,8 @@ SUCH DAMAGE. * @csAttr = Config attribute //{csAttr} = ..., if NULL search in *any* attribute * 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; @@ -83,7 +84,8 @@ static inline struct tagPair *SelectAttribute(sl_confi * DestroyAttribute() Free //{tagPair} item elements memory and destroy resource * @pair = Free this element */ -static inline void DestroyAttribute(struct tagPair *pair) +static inline void +DestroyAttribute(struct tagPair *pair) { if (!pair) return; @@ -107,7 +109,8 @@ static inline void DestroyAttribute(struct tagPair *pa * @csAttr = Config attribute //{csAttr} = ... * 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; register int cx = 0; @@ -135,7 +138,8 @@ inline int cfg_FindAttribute(sl_config * __restrict cf * @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute * 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; register int cx = 0; @@ -175,7 +179,8 @@ int cfg_UnsetAttribute(sl_config * __restrict cfg, con * @csVal = Config value //... = {csVal} to setup * 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; int len; @@ -271,7 +276,8 @@ int cfg_SetAttribute(sl_config * __restrict cfg, const * @csAttr = Config attribute //{csAttr} = ..., if NULL unset as *any* attribute * 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; @@ -290,7 +296,8 @@ inline const u_char *cfg_GetAttribute(sl_config * __re * @cfg = Head list element * 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; } @@ -307,7 +314,8 @@ inline struct tagPair *cfg_FirstItem(sl_config * __res * @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} */ -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) { struct tagPair *av;