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
static rsRetVal tplAddTplMod(struct template* pTpl, uchar** ppRestOfConfLine)
{
    uchar* pSrc;
    uchar szMod[2048];
    unsigned lenMod;
    strgen_t* pStrgen;
    DEFiRet;

    pSrc = *ppRestOfConfLine;
    lenMod = 0;
    while (*pSrc && !isspace(*pSrc) && lenMod < sizeof(szMod) - 1)
    {
        szMod[lenMod] = *pSrc++;
        lenMod++;
    }
    szMod[lenMod] = '\0';
    *ppRestOfConfLine = pSrc;
    CHKiRet(strgen.FindStrgen(&pStrgen, szMod));
    pTpl->pStrgen = pStrgen->pModule->mod.sm.strgen;
    DBGPRINTF("template bound to strgen '%s'\n", szMod);
    /* check if the name potentially contains some well-known options
     * Note: we have opted to let the name contain all options. This sounds
     * useful, because the strgen MUST actually implement a specific set
     * of options. Doing this via the name looks to the enduser as if the
     * regular syntax were used, and it make sure the strgen postively
     * acknowledged implementing the option. -- rgerhards, 2011-03-21
     */
    if (lenMod > 6 && !strcasecmp((char*)szMod + lenMod - 7, ",stdsql"))
    {
        pTpl->optFormatEscape = STDSQL_ESCAPE;
        DBGPRINTF("strgen supports the stdsql option\n");
    }
    else if (lenMod > 3 && !strcasecmp((char*)szMod + lenMod - 4, ",sql"))
    {
        pTpl->optFormatEscape = SQL_ESCAPE;
        DBGPRINTF("strgen supports the sql option\n");
    }
    else if (lenMod > 4 && !strcasecmp((char*)szMod + lenMod - 4, ",json"))
    {
        pTpl->optFormatEscape = JSON_ESCAPE;
        DBGPRINTF("strgen supports the json option\n");
    }

finalize_it:
    RETiRet;
}
/* Add a new entry for a template module.
 * returns pointer to new object if it succeeds, NULL otherwise.
 * rgerhards, 2010-05-31
 */
Add a new entry for a template module.
returns pointer to new object if it succeeds, NULL otherwise.
Add a new entry for a template module . returns pointer to new object if it succeeds NULL otherwise .
static rsRetVal tplAddTplMod(struct template* pTpl, uchar** ppRestOfConfLine)
{
    uchar* pSrc;
    uchar szMod[2048];
    unsigned lenMod;
    strgen_t* pStrgen;
    DEFiRet;
    pSrc = *ppRestOfConfLine;
    lenMod = 0;
    while (*pSrc && !isspace(*pSrc) && lenMod < sizeof(szMod) - 1)
    {
        szMod[lenMod] = *pSrc++;
        lenMod++;
    }
    szMod[lenMod] = '\0';
    *ppRestOfConfLine = pSrc;
    CHKiRet(strgen.FindStrgen(&pStrgen, szMod));
    pTpl->pStrgen = pStrgen->pModule->mod.sm.strgen;
    DBGPRINTF("template bound to strgen '%s'\n", szMod);
    if (lenMod > 6 && !strcasecmp((char*)szMod + lenMod - 7, ",stdsql"))
    {
        pTpl->optFormatEscape = STDSQL_ESCAPE;
        DBGPRINTF("strgen supports the stdsql option\n");
    }
    else if (lenMod > 3 && !strcasecmp((char*)szMod + lenMod - 4, ",sql"))
    {
        pTpl->optFormatEscape = SQL_ESCAPE;
        DBGPRINTF("strgen supports the sql option\n");
    }
    else if (lenMod > 4 && !strcasecmp((char*)szMod + lenMod - 4, ",json"))
    {
        pTpl->optFormatEscape = JSON_ESCAPE;
        DBGPRINTF("strgen supports the json option\n");
    }
finalize_it:
    RETiRet;
}
static rsRetVal tplAddTplMod ( struct template * pTpl , uchar * * ppRestOfConfLine ) { uchar * pSrc ; uchar szMod [ 2048 ] ; unsigned lenMod ; strgen_t * pStrgen ; DEFiRet ; pSrc = * ppRestOfConfLine ; lenMod = 0 ; while ( * pSrc && ! isspace ( * pSrc ) && lenMod < sizeof ( szMod ) - 1 ) { szMod [ lenMod ] = * pSrc ++ ; lenMod ++ ; } szMod [ lenMod ] = ' \0 ' ; * ppRestOfConfLine = pSrc ; CHKiRet ( strgen . FindStrgen ( & pStrgen , szMod ) ) ; pTpl -> pStrgen = pStrgen -> pModule -> mod . sm . strgen ; DBGPRINTF ( " \n " , szMod ) ; if ( lenMod > 6 && ! strcasecmp ( ( char * ) szMod + lenMod - 7 , " " ) ) { pTpl -> optFormatEscape = STDSQL_ESCAPE ; DBGPRINTF ( " \n " ) ; } else if ( lenMod > 3 && ! strcasecmp ( ( char * ) szMod + lenMod - 4 , " " ) ) { pTpl -> optFormatEscape = SQL_ESCAPE ; DBGPRINTF ( " \n " ) ; } else if ( lenMod > 4 && ! strcasecmp ( ( char * ) szMod + lenMod - 4 , " " ) ) { pTpl -> optFormatEscape = JSON_ESCAPE ; DBGPRINTF ( " \n " ) ; } finalize_it : RETiRet ; }
Add a new entry for a template module.
Add a new entry for a template module .
/* check if the name potentially contains some well-known options
     * Note: we have opted to let the name contain all options. This sounds
     * useful, because the strgen MUST actually implement a specific set
     * of options. Doing this via the name looks to the enduser as if the
     * regular syntax were used, and it make sure the strgen postively
     * acknowledged implementing the option. -- rgerhards, 2011-03-21
     */