--- libaitcfg/inc/aitcfg.h 2008/08/28 13:17:41 1.1 +++ libaitcfg/inc/aitcfg.h 2009/10/19 14:58:24 1.2.2.4 @@ -1,3 +1,11 @@ +/************************************************************************* +* (C) 2008 AITNET ltd - Sofia/Bulgaria - +* by Michael Pounov +* +* $Author: misho $ +* $Id: aitcfg.h,v 1.2.2.4 2009/10/19 14:58:24 misho Exp $ +* +*************************************************************************/ #ifndef __AITCFG_H #define __AITCFG_H @@ -23,6 +31,13 @@ typedef struct tagHead sl_config; */ inline int InitConfig(sl_config * __restrict cfg); /* + * cfg_CreateConfig() Create config file from memory without whitespaces! + * @csConfigName = New config filename + * @cfg = Head list element + * return: 0 ok; -1 error:: can`t save new config +*/ +int cfg_CreateConfig(const char *csConfigName, sl_config * __restrict cfg); +/* * CreateConfig() Create config file from memory * @csConfigName = New config filename * @cfg = Head list element @@ -63,6 +78,30 @@ int ReadConfig(FILE *f, sl_config * __restrict cfg); * return: 0 ok; -1 error:: can`t write to file */ int WriteConfig(FILE *f, sl_config * __restrict cfg); + +/* + * cfg_WriteConfig() Write to file from items in config list without whitespaces! + * @f = file resource + * @cfg = Head list element + * return: 0 ok; -1 error:: can`t write to file +*/ +int cfg_WriteConfig(FILE *f, sl_config * __restrict cfg); + +/* + * ConcatConfig() Concat two list in one + * @cfg = Head list element of main list + * @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); + +/* + * MergeConfig() Marge two list in one cfg and destroy add_cfg + * @cfg = Head list element of main list + * @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); /*