Diff for /libaitcfg/src/queue.c between versions 1.20 and 1.21

version 1.20, 2025/01/31 00:03:15 version 1.21, 2025/10/09 16:43:05
Line 190  cfg_getSection(cfg_root_t * __restrict cfg, const char Line 190  cfg_getSection(cfg_root_t * __restrict cfg, const char
 }  }
   
 /*  /*
    * cfg_delSection() - Delete entire section
    *
    * @cfg = Config root
    * @csSec = Config section //[{csSec}]
    * return: -1 error, 0 nothing deleted or >0 deleted attributes
    */
   int
   cfg_delSection(cfg_root_t * __restrict cfg, const char *csSec)
   {
           int ret = 0;
           array_t *arr = NULL;
           struct tagCfg *av;
           register int i;
   
           if (!cfg) {
                   cfg_SetErr(EINVAL, "Invalid argument(s)");
                   return -1;
           }
           if (csSec && !*csSec)
                   csSec = NULL;
   
           arr = cfg_getSection(cfg, csSec);
           if (!arr)
                   return ret;
           for (i = 0; i < array_Size(arr); i++)
                   if ((av = array(arr, i, struct tagCfg*)) && AIT_ADDR(&av->cfg_attr))
                           if (cfg_unsetAttribute(cfg, csSec, AIT_GET_STR(&av->cfg_attr)) > 0)
                                   ret++;
           array_Destroy(&arr);
           return ret;
   }
   
   /*
  * cfg_findAttribute() - Find attribute position in config file   * cfg_findAttribute() - Find attribute position in config file
  *   *
  * @cfg = Config root   * @cfg = Config root

Removed from v.1.20  
changed lines
  Added in v.1.21


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