Diff for /libaitcfg/src/parse.c between versions 1.13.2.1 and 1.13.2.2

version 1.13.2.1, 2014/01/30 08:13:09 version 1.13.2.2, 2014/01/30 08:14:56
Line 47  SUCH DAMAGE. Line 47  SUCH DAMAGE.
   
   
 /*  /*
 static inline void  
 _invertQueue(cfg_root_t * __restrict cfg)  
 {  
         struct tagCfg *item, *next, *prev = NULL;  
   
         SLIST_FOREACH_SAFE(item, cfg, cfg_next, next) {  
                 item->cfg_next.sle_next = prev;  
                 prev = item;  
         }  
         cfg->slh_first = prev;  
 }  
 */  
   
   
 /*  
  * cfgReadConfig() - Read file and add new item at config root   * cfgReadConfig() - Read file and add new item at config root
  *   *
  * @f = File resource   * @f = File resource
Line 206  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i Line 191  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i
         }          }
   
         CFG_RC_LOCK(cfg);          CFG_RC_LOCK(cfg);
 //      _invertQueue(cfg);  
         TAILQ_FOREACH(av, cfg, cfg_next) {          TAILQ_FOREACH(av, cfg, cfg_next) {
                 /* empty lines or comment */                  /* empty lines or comment */
                 if (AIT_ISEMPTY(&av->cfg_attr)) {                  if (AIT_ISEMPTY(&av->cfg_attr)) {
Line 222  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i Line 206  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i
                         strlcpy(szSection, AIT_GET_STR(&av->cfg_sec), sizeof szSection);                          strlcpy(szSection, AIT_GET_STR(&av->cfg_sec), sizeof szSection);
                         if (!cfg_Write(f, "[%s]\n", AIT_GET_STR(&av->cfg_sec))) {                          if (!cfg_Write(f, "[%s]\n", AIT_GET_STR(&av->cfg_sec))) {
                                 LOGERR;                                  LOGERR;
 //                              _invertQueue(cfg);  
                                 CFG_RC_UNLOCK(cfg);                                  CFG_RC_UNLOCK(cfg);
                                 return -1;                                  return -1;
                         }                          }
Line 230  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i Line 213  cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i
                         memset(szSection, 0, sizeof szSection);                          memset(szSection, 0, sizeof szSection);
                         if (!cfg_Write(f, "[]\n")) {                          if (!cfg_Write(f, "[]\n")) {
                                 LOGERR;                                  LOGERR;
 //                              _invertQueue(cfg);  
                                 CFG_RC_UNLOCK(cfg);                                  CFG_RC_UNLOCK(cfg);
                                 return -1;                                  return -1;
                         }                          }
Line 251  skip_sec: Line 233  skip_sec:
                 /* write */                  /* write */
                 if (!cfg_Write(f, "%s\n", line)) {                  if (!cfg_Write(f, "%s\n", line)) {
                         LOGERR;                          LOGERR;
 //                      _invertQueue(cfg);  
                         CFG_RC_UNLOCK(cfg);                          CFG_RC_UNLOCK(cfg);
                         return -1;                          return -1;
                 }                  }
         }          }
 //      _invertQueue(cfg);  
         CFG_RC_UNLOCK(cfg);          CFG_RC_UNLOCK(cfg);
   
         if (whitespace) {          if (whitespace) {

Removed from v.1.13.2.1  
changed lines
  Added in v.1.13.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>