--- libaitcfg/inc/aitcfg.h 2014/01/29 23:46:35 1.11.4.1 +++ libaitcfg/inc/aitcfg.h 2014/03/03 09:41:09 1.14 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitcfg.h,v 1.11.4.1 2014/01/29 23:46:35 misho Exp $ +* $Id: aitcfg.h,v 1.14 2014/03/03 09:41:09 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -56,13 +56,14 @@ struct tagCfg { ait_val_t cfg_attr; ait_val_t cfg_val; - SLIST_ENTRY(tagCfg) cfg_next; + TAILQ_ENTRY(tagCfg) cfg_next; RB_ENTRY(tagCfg) cfg_node; }; typedef struct tagRC { pthread_mutex_t rc_mtx; - struct tagCfg *slh_first; + struct tagCfg *tqh_first; + struct tagCfg **tqh_last; struct tagCfg *rbh_root; } cfg_root_t; #define CFG_RC_LOCK(x) pthread_mutex_lock(&(x)->rc_mtx) @@ -84,10 +85,16 @@ const char *cfg_GetError(); /* * cfgInitConfig() - Init config root * - * @cfg = Config root - * return: -1 error or 0 ok + * return: NULL error or !=NULL allocated config root */ -int cfgInitConfig(cfg_root_t * __restrict cfg); +cfg_root_t *cfgInitConfig(); +/* + * cfgEndConfig() - Free resources & config root + * + * @pcfg = Config root + * return: none + */ +void cfgEndConfig(cfg_root_t **pcfg); /* * cfgLoadConfig() - Load config from file *