openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/template.c
void tplDeleteAll(rsconf_t* conf)
{
    struct template *pTpl, *pTplDel;
    struct templateEntry *pTpe, *pTpeDel;

    pTpl = conf->templates.root;
    while (pTpl != NULL)
    {
        pTpe = pTpl->pEntryRoot;
        while (pTpe != NULL)
        {
            pTpeDel = pTpe;
            pTpe = pTpe->pNext;
            switch (pTpeDel->eEntryType)
            {
                case UNDEFINED:
                    break;
                case CONSTANT:
                    free(pTpeDel->data.constant.pConstant);
                    break;
                case FIELD:
                    /* check if we have a regexp and, if so, delete it */
#ifdef FEATURE_REGEXP
                    if (pTpeDel->data.field.has_regex != 0)
                    {
                        if (objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK)
                        {
                            regexp.regfree(&(pTpeDel->data.field.re));
                        }
                    }
#endif
                    msgPropDescrDestruct(&pTpeDel->data.field.msgProp);
                    break;
            }
            free(pTpeDel->fieldName);
            free(pTpeDel);
        }
        pTplDel = pTpl;
        pTpl = pTpl->pNext;
        free(pTplDel->pszName);
        if (pTplDel->bHaveSubtree)
            msgPropDescrDestruct(&pTplDel->subtree);
        free(pTplDel);
    }
}
/* Destroy the template structure. This is for de-initialization
 * at program end. Everything is deleted.
 * rgerhards 2005-02-22
 * I have commented out dbgprintfs, because they are not needed for
 * "normal" debugging. Uncomment them, if they are needed.
 * rgerhards, 2007-07-05
 */
Destroy the template structure. This is for de-initialization
at program end. Everything is deleted.
rgerhards 2005-02-22
I have commented out dbgprintfs, because they are not needed for
"normal" debugging. Uncomment them, if they are needed.
Destroy the template structure . This is for de - initialization at program end . Everything is deleted . rgerhards 2005 - 02 - 22 I have commented out dbgprintfs because they are not needed for " normal " debugging . Uncomment them if they are needed .
void tplDeleteAll(rsconf_t* conf)
{
    struct template *pTpl, *pTplDel;
    struct templateEntry *pTpe, *pTpeDel;
    pTpl = conf->templates.root;
    while (pTpl != NULL)
    {
        pTpe = pTpl->pEntryRoot;
        while (pTpe != NULL)
        {
            pTpeDel = pTpe;
            pTpe = pTpe->pNext;
            switch (pTpeDel->eEntryType)
            {
                case UNDEFINED:
                    break;
                case CONSTANT:
                    free(pTpeDel->data.constant.pConstant);
                    break;
                case FIELD:
#ifdef FEATURE_REGEXP
                    if (pTpeDel->data.field.has_regex != 0)
                    {
                        if (objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK)
                        {
                            regexp.regfree(&(pTpeDel->data.field.re));
                        }
                    }
#endif
                    msgPropDescrDestruct(&pTpeDel->data.field.msgProp);
                    break;
            }
            free(pTpeDel->fieldName);
            free(pTpeDel);
        }
        pTplDel = pTpl;
        pTpl = pTpl->pNext;
        free(pTplDel->pszName);
        if (pTplDel->bHaveSubtree)
            msgPropDescrDestruct(&pTplDel->subtree);
        free(pTplDel);
    }
}
void tplDeleteAll ( rsconf_t * conf ) { struct template * pTpl , * pTplDel ; struct templateEntry * pTpe , * pTpeDel ; pTpl = conf -> templates . root ; while ( pTpl != NULL ) { pTpe = pTpl -> pEntryRoot ; while ( pTpe != NULL ) { pTpeDel = pTpe ; pTpe = pTpe -> pNext ; switch ( pTpeDel -> eEntryType ) { case UNDEFINED : break ; case CONSTANT : free ( pTpeDel -> data . constant . pConstant ) ; break ; case FIELD : #ifdef FEATURE_REGEXP if ( pTpeDel -> data . field . has_regex != 0 ) { if ( objUse ( regexp , LM_REGEXP_FILENAME ) == RS_RET_OK ) { regexp . regfree ( & ( pTpeDel -> data . field . re ) ) ; } } #endif msgPropDescrDestruct ( & pTpeDel -> data . field . msgProp ) ; break ; } free ( pTpeDel -> fieldName ) ; free ( pTpeDel ) ; } pTplDel = pTpl ; pTpl = pTpl -> pNext ; free ( pTplDel -> pszName ) ; if ( pTplDel -> bHaveSubtree ) msgPropDescrDestruct ( & pTplDel -> subtree ) ; free ( pTplDel ) ; } }
Destroy the template structure.
Destroy the template structure .
/* check if we have a regexp and, if so, delete it */