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 tplPrintList(rsconf_t* conf)
{
    struct template* pTpl;
    struct templateEntry* pTpe;

    pTpl = conf->templates.root;
    while (pTpl != NULL)
    {
        dbgprintf("Template: Name='%s' ",
                  pTpl->pszName == NULL ? "NULL" : pTpl->pszName);
        if (pTpl->optFormatEscape == SQL_ESCAPE)
            dbgprintf("[SQL-Format (MySQL)] ");
        else if (pTpl->optFormatEscape == JSON_ESCAPE)
            dbgprintf("[JSON-Escaped Format] ");
        else if (pTpl->optFormatEscape == STDSQL_ESCAPE)
            dbgprintf("[SQL-Format (standard SQL)] ");
        else if (pTpl->optFormatEscape == JSONF)
            dbgprintf("[JSON fields] ");
        if (pTpl->optCaseSensitive)
            dbgprintf("[Case Sensitive Vars] ");
        dbgprintf("\n");
        pTpe = pTpl->pEntryRoot;
        while (pTpe != NULL)
        {
            dbgprintf("\tEntry(%lx): type %d, ", (unsigned long)pTpe,
                      pTpe->eEntryType);
            switch (pTpe->eEntryType)
            {
                case UNDEFINED:
                    dbgprintf("(UNDEFINED)");
                    break;
                case CONSTANT:
                    dbgprintf("(CONSTANT), value: '%s'",
                              pTpe->data.constant.pConstant);
                    break;
                case FIELD:
                    dbgprintf("(FIELD), value: '%d' ",
                              pTpe->data.field.msgProp.id);
                    if (pTpe->data.field.msgProp.id == PROP_CEE)
                    {
                        dbgprintf("[EE-Property: '%s'] ",
                                  pTpe->data.field.msgProp.name);
                    }
                    else if (pTpe->data.field.msgProp.id == PROP_LOCAL_VAR)
                    {
                        dbgprintf("[Local Var: '%s'] ",
                                  pTpe->data.field.msgProp.name);
                    }
                    switch (pTpe->data.field.eDateFormat)
                    {
                        case tplFmtDefault:
                            break;
                        case tplFmtMySQLDate:
                            dbgprintf("[Format as MySQL-Date] ");
                            break;
                        case tplFmtPgSQLDate:
                            dbgprintf("[Format as PgSQL-Date] ");
                            break;
                        case tplFmtRFC3164Date:
                            dbgprintf("[Format as RFC3164-Date] ");
                            break;
                        case tplFmtRFC3339Date:
                            dbgprintf("[Format as RFC3339-Date] ");
                            break;
                        case tplFmtUnixDate:
                            dbgprintf("[Format as Unix timestamp] ");
                            break;
                        case tplFmtSecFrac:
                            dbgprintf("[fractional seconds, only] ");
                            break;
                        case tplFmtRFC3164BuggyDate:
                            dbgprintf("[Format as buggy RFC3164-Date] ");
                            break;
                        case tplFmtWDayName:
                            dbgprintf("[Format as weekday name] ");
                            break;
                        case tplFmtYear:
                            dbgprintf("[Format as year] ");
                            break;
                        case tplFmtMonth:
                            dbgprintf("[Format as month] ");
                            break;
                        case tplFmtDay:
                            dbgprintf("[Format as day] ");
                            break;
                        case tplFmtHour:
                            dbgprintf("[Format as hour] ");
                            break;
                        case tplFmtMinute:
                            dbgprintf("[Format as minute] ");
                            break;
                        case tplFmtSecond:
                            dbgprintf("[Format as second] ");
                            break;
                        case tplFmtTZOffsHour:
                            dbgprintf("[Format as offset hour] ");
                            break;
                        case tplFmtTZOffsMin:
                            dbgprintf("[Format as offset minute] ");
                            break;
                        case tplFmtTZOffsDirection:
                            dbgprintf("[Format as offset direction] ");
                            break;
                        case tplFmtWDay:
                            dbgprintf("[Format as weekday] ");
                            break;
                        case tplFmtOrdinal:
                            dbgprintf("[Format as ordinal] ");
                            break;
                        case tplFmtWeek:
                            dbgprintf("[Format as week] ");
                            break;
                        default:
                            dbgprintf("[UNKNOWN eDateFormat %d] ",
                                      pTpe->data.field.eDateFormat);
                    }
                    switch (pTpe->data.field.eCaseConv)
                    {
                        case tplCaseConvNo:
                            break;
                        case tplCaseConvLower:
                            dbgprintf("[Converted to Lower Case] ");
                            break;
                        case tplCaseConvUpper:
                            dbgprintf("[Converted to Upper Case] ");
                            break;
                    }
                    if (pTpe->data.field.options.bEscapeCC)
                    {
                        dbgprintf("[escape control-characters] ");
                    }
                    if (pTpe->data.field.options.bDropCC)
                    {
                        dbgprintf("[drop control-characters] ");
                    }
                    if (pTpe->data.field.options.bSpaceCC)
                    {
                        dbgprintf("[replace control-characters with space] ");
                    }
                    if (pTpe->data.field.options.bSecPathDrop)
                    {
                        dbgprintf("[slashes are dropped] ");
                    }
                    if (pTpe->data.field.options.bSecPathReplace)
                    {
                        dbgprintf("[slashes are replaced by '_'] ");
                    }
                    if (pTpe->data.field.options.bSPIffNo1stSP)
                    {
                        dbgprintf("[SP iff no first SP] ");
                    }
                    if (pTpe->data.field.options.bCSV)
                    {
                        dbgprintf("[format as CSV (RFC4180)]");
                    }
                    if (pTpe->data.field.options.bJSON)
                    {
                        dbgprintf("[format as JSON] ");
                    }
                    if (pTpe->data.field.options.bJSONf)
                    {
                        dbgprintf("[format as JSON field] ");
                    }
                    if (pTpe->data.field.options.bJSONr)
                    {
                        dbgprintf("[format as JSON without re-escaping] ");
                    }
                    if (pTpe->data.field.options.bJSONfr)
                    {
                        dbgprintf(
                            "[format as JSON field without re-escaping] ");
                    }
                    if (pTpe->data.field.options.bMandatory)
                    {
                        dbgprintf("[mandatory field] ");
                    }
                    if (pTpe->data.field.options.bDropLastLF)
                    {
                        dbgprintf("[drop last LF in msg] ");
                    }
                    if (pTpe->data.field.has_fields == 1)
                    {
                        dbgprintf("[substring, field #%d only (delemiter %d)] ",
                                  pTpe->data.field.iFieldNr,
                                  pTpe->data.field.field_delim);
                    }
                    if (pTpe->data.field.iFromPos != 0 ||
                        pTpe->data.field.iToPos != 0)
                    {
                        dbgprintf("[substring, from character %d to %d] ",
                                  pTpe->data.field.iFromPos,
                                  pTpe->data.field.iToPos);
                    }
                    break;
            }
            if (pTpe->bComplexProcessing)
                dbgprintf("[COMPLEX]");
            dbgprintf("\n");
            pTpe = pTpe->pNext;
        }
        pTpl = pTpl->pNext; /* done, go next */
    }
}
/* Print the template structure. This is more or less a
 * debug or test aid, but anyhow I think it's worth it...
 */
Print the template structure. This is more or less a
debug or test aid, but anyhow I think it's worth it
Print the template structure . This is more or less a debug or test aid but anyhow I think it ' s worth it
void tplPrintList(rsconf_t* conf)
{
    struct template* pTpl;
    struct templateEntry* pTpe;
    pTpl = conf->templates.root;
    while (pTpl != NULL)
    {
        dbgprintf("Template: Name='%s' ",
                  pTpl->pszName == NULL ? "NULL" : pTpl->pszName);
        if (pTpl->optFormatEscape == SQL_ESCAPE)
            dbgprintf("[SQL-Format (MySQL)] ");
        else if (pTpl->optFormatEscape == JSON_ESCAPE)
            dbgprintf("[JSON-Escaped Format] ");
        else if (pTpl->optFormatEscape == STDSQL_ESCAPE)
            dbgprintf("[SQL-Format (standard SQL)] ");
        else if (pTpl->optFormatEscape == JSONF)
            dbgprintf("[JSON fields] ");
        if (pTpl->optCaseSensitive)
            dbgprintf("[Case Sensitive Vars] ");
        dbgprintf("\n");
        pTpe = pTpl->pEntryRoot;
        while (pTpe != NULL)
        {
            dbgprintf("\tEntry(%lx): type %d, ", (unsigned long)pTpe,
                      pTpe->eEntryType);
            switch (pTpe->eEntryType)
            {
                case UNDEFINED:
                    dbgprintf("(UNDEFINED)");
                    break;
                case CONSTANT:
                    dbgprintf("(CONSTANT), value: '%s'",
                              pTpe->data.constant.pConstant);
                    break;
                case FIELD:
                    dbgprintf("(FIELD), value: '%d' ",
                              pTpe->data.field.msgProp.id);
                    if (pTpe->data.field.msgProp.id == PROP_CEE)
                    {
                        dbgprintf("[EE-Property: '%s'] ",
                                  pTpe->data.field.msgProp.name);
                    }
                    else if (pTpe->data.field.msgProp.id == PROP_LOCAL_VAR)
                    {
                        dbgprintf("[Local Var: '%s'] ",
                                  pTpe->data.field.msgProp.name);
                    }
                    switch (pTpe->data.field.eDateFormat)
                    {
                        case tplFmtDefault:
                            break;
                        case tplFmtMySQLDate:
                            dbgprintf("[Format as MySQL-Date] ");
                            break;
                        case tplFmtPgSQLDate:
                            dbgprintf("[Format as PgSQL-Date] ");
                            break;
                        case tplFmtRFC3164Date:
                            dbgprintf("[Format as RFC3164-Date] ");
                            break;
                        case tplFmtRFC3339Date:
                            dbgprintf("[Format as RFC3339-Date] ");
                            break;
                        case tplFmtUnixDate:
                            dbgprintf("[Format as Unix timestamp] ");
                            break;
                        case tplFmtSecFrac:
                            dbgprintf("[fractional seconds, only] ");
                            break;
                        case tplFmtRFC3164BuggyDate:
                            dbgprintf("[Format as buggy RFC3164-Date] ");
                            break;
                        case tplFmtWDayName:
                            dbgprintf("[Format as weekday name] ");
                            break;
                        case tplFmtYear:
                            dbgprintf("[Format as year] ");
                            break;
                        case tplFmtMonth:
                            dbgprintf("[Format as month] ");
                            break;
                        case tplFmtDay:
                            dbgprintf("[Format as day] ");
                            break;
                        case tplFmtHour:
                            dbgprintf("[Format as hour] ");
                            break;
                        case tplFmtMinute:
                            dbgprintf("[Format as minute] ");
                            break;
                        case tplFmtSecond:
                            dbgprintf("[Format as second] ");
                            break;
                        case tplFmtTZOffsHour:
                            dbgprintf("[Format as offset hour] ");
                            break;
                        case tplFmtTZOffsMin:
                            dbgprintf("[Format as offset minute] ");
                            break;
                        case tplFmtTZOffsDirection:
                            dbgprintf("[Format as offset direction] ");
                            break;
                        case tplFmtWDay:
                            dbgprintf("[Format as weekday] ");
                            break;
                        case tplFmtOrdinal:
                            dbgprintf("[Format as ordinal] ");
                            break;
                        case tplFmtWeek:
                            dbgprintf("[Format as week] ");
                            break;
                        default:
                            dbgprintf("[UNKNOWN eDateFormat %d] ",
                                      pTpe->data.field.eDateFormat);
                    }
                    switch (pTpe->data.field.eCaseConv)
                    {
                        case tplCaseConvNo:
                            break;
                        case tplCaseConvLower:
                            dbgprintf("[Converted to Lower Case] ");
                            break;
                        case tplCaseConvUpper:
                            dbgprintf("[Converted to Upper Case] ");
                            break;
                    }
                    if (pTpe->data.field.options.bEscapeCC)
                    {
                        dbgprintf("[escape control-characters] ");
                    }
                    if (pTpe->data.field.options.bDropCC)
                    {
                        dbgprintf("[drop control-characters] ");
                    }
                    if (pTpe->data.field.options.bSpaceCC)
                    {
                        dbgprintf("[replace control-characters with space] ");
                    }
                    if (pTpe->data.field.options.bSecPathDrop)
                    {
                        dbgprintf("[slashes are dropped] ");
                    }
                    if (pTpe->data.field.options.bSecPathReplace)
                    {
                        dbgprintf("[slashes are replaced by '_'] ");
                    }
                    if (pTpe->data.field.options.bSPIffNo1stSP)
                    {
                        dbgprintf("[SP iff no first SP] ");
                    }
                    if (pTpe->data.field.options.bCSV)
                    {
                        dbgprintf("[format as CSV (RFC4180)]");
                    }
                    if (pTpe->data.field.options.bJSON)
                    {
                        dbgprintf("[format as JSON] ");
                    }
                    if (pTpe->data.field.options.bJSONf)
                    {
                        dbgprintf("[format as JSON field] ");
                    }
                    if (pTpe->data.field.options.bJSONr)
                    {
                        dbgprintf("[format as JSON without re-escaping] ");
                    }
                    if (pTpe->data.field.options.bJSONfr)
                    {
                        dbgprintf(
                            "[format as JSON field without re-escaping] ");
                    }
                    if (pTpe->data.field.options.bMandatory)
                    {
                        dbgprintf("[mandatory field] ");
                    }
                    if (pTpe->data.field.options.bDropLastLF)
                    {
                        dbgprintf("[drop last LF in msg] ");
                    }
                    if (pTpe->data.field.has_fields == 1)
                    {
                        dbgprintf("[substring, field #%d only (delemiter %d)] ",
                                  pTpe->data.field.iFieldNr,
                                  pTpe->data.field.field_delim);
                    }
                    if (pTpe->data.field.iFromPos != 0 ||
                        pTpe->data.field.iToPos != 0)
                    {
                        dbgprintf("[substring, from character %d to %d] ",
                                  pTpe->data.field.iFromPos,
                                  pTpe->data.field.iToPos);
                    }
                    break;
            }
            if (pTpe->bComplexProcessing)
                dbgprintf("[COMPLEX]");
            dbgprintf("\n");
            pTpe = pTpe->pNext;
        }
        pTpl = pTpl->pNext; 
    }
}
void tplPrintList ( rsconf_t * conf ) { struct template * pTpl ; struct templateEntry * pTpe ; pTpl = conf -> templates . root ; while ( pTpl != NULL ) { dbgprintf ( " " , pTpl -> pszName == NULL ? " " : pTpl -> pszName ) ; if ( pTpl -> optFormatEscape == SQL_ESCAPE ) dbgprintf ( " " ) ; else if ( pTpl -> optFormatEscape == JSON_ESCAPE ) dbgprintf ( " " ) ; else if ( pTpl -> optFormatEscape == STDSQL_ESCAPE ) dbgprintf ( " " ) ; else if ( pTpl -> optFormatEscape == JSONF ) dbgprintf ( " " ) ; if ( pTpl -> optCaseSensitive ) dbgprintf ( " " ) ; dbgprintf ( " \n " ) ; pTpe = pTpl -> pEntryRoot ; while ( pTpe != NULL ) { dbgprintf ( " \t " , ( unsigned long ) pTpe , pTpe -> eEntryType ) ; switch ( pTpe -> eEntryType ) { case UNDEFINED : dbgprintf ( " " ) ; break ; case CONSTANT : dbgprintf ( " " , pTpe -> data . constant . pConstant ) ; break ; case FIELD : dbgprintf ( " " , pTpe -> data . field . msgProp . id ) ; if ( pTpe -> data . field . msgProp . id == PROP_CEE ) { dbgprintf ( " " , pTpe -> data . field . msgProp . name ) ; } else if ( pTpe -> data . field . msgProp . id == PROP_LOCAL_VAR ) { dbgprintf ( " " , pTpe -> data . field . msgProp . name ) ; } switch ( pTpe -> data . field . eDateFormat ) { case tplFmtDefault : break ; case tplFmtMySQLDate : dbgprintf ( " " ) ; break ; case tplFmtPgSQLDate : dbgprintf ( " " ) ; break ; case tplFmtRFC3164Date : dbgprintf ( " " ) ; break ; case tplFmtRFC3339Date : dbgprintf ( " " ) ; break ; case tplFmtUnixDate : dbgprintf ( " " ) ; break ; case tplFmtSecFrac : dbgprintf ( " " ) ; break ; case tplFmtRFC3164BuggyDate : dbgprintf ( " " ) ; break ; case tplFmtWDayName : dbgprintf ( " " ) ; break ; case tplFmtYear : dbgprintf ( " " ) ; break ; case tplFmtMonth : dbgprintf ( " " ) ; break ; case tplFmtDay : dbgprintf ( " " ) ; break ; case tplFmtHour : dbgprintf ( " " ) ; break ; case tplFmtMinute : dbgprintf ( " " ) ; break ; case tplFmtSecond : dbgprintf ( " " ) ; break ; case tplFmtTZOffsHour : dbgprintf ( " " ) ; break ; case tplFmtTZOffsMin : dbgprintf ( " " ) ; break ; case tplFmtTZOffsDirection : dbgprintf ( " " ) ; break ; case tplFmtWDay : dbgprintf ( " " ) ; break ; case tplFmtOrdinal : dbgprintf ( " " ) ; break ; case tplFmtWeek : dbgprintf ( " " ) ; break ; default : dbgprintf ( " " , pTpe -> data . field . eDateFormat ) ; } switch ( pTpe -> data . field . eCaseConv ) { case tplCaseConvNo : break ; case tplCaseConvLower : dbgprintf ( " " ) ; break ; case tplCaseConvUpper : dbgprintf ( " " ) ; break ; } if ( pTpe -> data . field . options . bEscapeCC ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bDropCC ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bSpaceCC ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bSecPathDrop ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bSecPathReplace ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bSPIffNo1stSP ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bCSV ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bJSON ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bJSONf ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bJSONr ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bJSONfr ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bMandatory ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . options . bDropLastLF ) { dbgprintf ( " " ) ; } if ( pTpe -> data . field . has_fields == 1 ) { dbgprintf ( " " , pTpe -> data . field . iFieldNr , pTpe -> data . field . field_delim ) ; } if ( pTpe -> data . field . iFromPos != 0 || pTpe -> data . field . iToPos != 0 ) { dbgprintf ( " " , pTpe -> data . field . iFromPos , pTpe -> data . field . iToPos ) ; } break ; } if ( pTpe -> bComplexProcessing ) dbgprintf ( " " ) ; dbgprintf ( " \n " ) ; pTpe = pTpe -> pNext ; } pTpl = pTpl -> pNext ; } }
Print the template structure.
Print the template structure .
/* done, go next */