--- libaitcfg/src/parse.c 2011/05/01 17:24:28 1.6 +++ libaitcfg/src/parse.c 2011/05/10 20:52:36 1.6.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: parse.c,v 1.6 2011/05/01 17:24:28 misho Exp $ +* $Id: parse.c,v 1.6.2.1 2011/05/10 20:52:36 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -48,7 +48,8 @@ SUCH DAMAGE. // cfgDbg() Debug/Log operation -static inline int cfgDbg(FILE *f, char *fmt, ...) +static inline int +cfgDbg(FILE *f, char *fmt, ...) { int ret = 0; va_list lst; @@ -64,7 +65,8 @@ static inline int cfgDbg(FILE *f, char *fmt, ...) * InvertQueue() InvertQueue order //{cfg} list of elements for revert * @cfg = Head list element for revert */ -static inline void InvertQueue(sl_config * __restrict cfg) +static inline void +InvertQueue(sl_config * __restrict cfg) { struct tagPair *item, *next, *prev = NULL; @@ -77,7 +79,8 @@ static inline void InvertQueue(sl_config * __restrict } // cfgWrite() Write to file from config list -static inline int cfgWrite(FILE *f, sl_config * __restrict cfg, int whitespace) +static inline int +cfgWrite(FILE *f, sl_config * __restrict cfg, int whitespace) { struct tagPair *av; time_t tim; @@ -144,7 +147,8 @@ static inline int cfgWrite(FILE *f, sl_config * __rest * @cfg = Head list element * return: 0 ok; -1 error:: can`t allocate memory */ -int ReadConfig(FILE *f, sl_config * __restrict cfg) +int +ReadConfig(FILE *f, sl_config * __restrict cfg) { u_char szLine[MAX_STR + 1]; u_char szSection[MAX_STR + 1], *psAttr, *psVal; @@ -259,7 +263,8 @@ int ReadConfig(FILE *f, sl_config * __restrict cfg) * @cfg = Head list element * return: 0 ok; -1 error:: can`t write to file */ -int WriteConfig(FILE *f, sl_config * __restrict cfg) +int +WriteConfig(FILE *f, sl_config * __restrict cfg) { return cfgWrite(f, cfg, 1); } @@ -270,7 +275,8 @@ int WriteConfig(FILE *f, sl_config * __restrict cfg) * @cfg = Head list element * return: 0 ok; -1 error:: can`t write to file */ -int cfg_WriteConfig(FILE *f, sl_config * __restrict cfg) +int +cfg_WriteConfig(FILE *f, sl_config * __restrict cfg) { return cfgWrite(f, cfg, 0); } @@ -281,7 +287,8 @@ int cfg_WriteConfig(FILE *f, sl_config * __restrict cf * @add_cfg = Head list element of added list * return: 0 ok; -1 error:: can`t concat lists */ -int ConcatConfig(sl_config * __restrict cfg, sl_config * __restrict add_cfg) +int +ConcatConfig(sl_config * __restrict cfg, sl_config * __restrict add_cfg) { struct tagPair *item; int ret = 0; @@ -303,7 +310,8 @@ int ConcatConfig(sl_config * __restrict cfg, sl_config * @add_cfg = Head list element of merged list (destroy after all!) * return: 0 ok; -1 error:: can`t merge lists */ -int MergeConfig(sl_config * __restrict cfg, sl_config * __restrict add_cfg) +int +MergeConfig(sl_config * __restrict cfg, sl_config * __restrict add_cfg) { struct tagPair *item, *merge, *add_next, *next = NULL; int flg;