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/runtime/parser.c
static rsRetVal ParsePRI(smsg_t* pMsg)
{
    syslog_pri_t pri;
    uchar* msg;
    int lenMsg;
    DEFiRet;

    /* pull PRI */
    lenMsg = pMsg->iLenRawMsg;
    msg = pMsg->pszRawMsg;
    pri = DEFUPRI;
    if (pMsg->msgFlags & NO_PRI_IN_RAW)
    {
        /* In this case, simply do so as if the pri would be right at top */
        MsgSetAfterPRIOffs(pMsg, 0);
    }
    else
    {
        if (*msg == '<')
        {
            pri = 0;
            while (--lenMsg > 0 && isdigit((int)*++msg) && pri <= LOG_MAXPRI)
            {
                pri = 10 * pri + (*msg - '0');
            }
            if (*msg == '>')
            {
                ++msg;
            }
            else
            {
                pri = LOG_PRI_INVLD;
            }
            if (pri > LOG_MAXPRI)
                pri = LOG_PRI_INVLD;
        }
        msgSetPRI(pMsg, pri);
        MsgSetAfterPRIOffs(pMsg,
                           (pri == LOG_PRI_INVLD) ? 0 : msg - pMsg->pszRawMsg);
    }
    RETiRet;
}
/* A standard parser to parse out the PRI. This is made available in
 * this module as it is expected that allmost all parsers will need
 * that functionality and so they do not need to implement it themsleves.
 */
A standard parser to parse out the PRI. This is made available in
this module as it is expected that allmost all parsers will need
that functionality and so they do not need to implement it themsleves.
A standard parser to parse out the PRI . This is made available in this module as it is expected that allmost all parsers will need that functionality and so they do not need to implement it themsleves .
static rsRetVal ParsePRI(smsg_t* pMsg)
{
    syslog_pri_t pri;
    uchar* msg;
    int lenMsg;
    DEFiRet;
    lenMsg = pMsg->iLenRawMsg;
    msg = pMsg->pszRawMsg;
    pri = DEFUPRI;
    if (pMsg->msgFlags & NO_PRI_IN_RAW)
    {
        MsgSetAfterPRIOffs(pMsg, 0);
    }
    else
    {
        if (*msg == '<')
        {
            pri = 0;
            while (--lenMsg > 0 && isdigit((int)*++msg) && pri <= LOG_MAXPRI)
            {
                pri = 10 * pri + (*msg - '0');
            }
            if (*msg == '>')
            {
                ++msg;
            }
            else
            {
                pri = LOG_PRI_INVLD;
            }
            if (pri > LOG_MAXPRI)
                pri = LOG_PRI_INVLD;
        }
        msgSetPRI(pMsg, pri);
        MsgSetAfterPRIOffs(pMsg,
                           (pri == LOG_PRI_INVLD) ? 0 : msg - pMsg->pszRawMsg);
    }
    RETiRet;
}
static rsRetVal ParsePRI ( smsg_t * pMsg ) { syslog_pri_t pri ; uchar * msg ; int lenMsg ; DEFiRet ; lenMsg = pMsg -> iLenRawMsg ; msg = pMsg -> pszRawMsg ; pri = DEFUPRI ; if ( pMsg -> msgFlags & NO_PRI_IN_RAW ) { MsgSetAfterPRIOffs ( pMsg , 0 ) ; } else { if ( * msg == ' ' ) { pri = 0 ; while ( -- lenMsg > 0 && isdigit ( ( int ) * ++ msg ) && pri <= LOG_MAXPRI ) { pri = 10 * pri + ( * msg - ' ' ) ; } if ( * msg == ' ' ) { ++ msg ; } else { pri = LOG_PRI_INVLD ; } if ( pri > LOG_MAXPRI ) pri = LOG_PRI_INVLD ; } msgSetPRI ( pMsg , pri ) ; MsgSetAfterPRIOffs ( pMsg , ( pri == LOG_PRI_INVLD ) ? 0 : msg - pMsg -> pszRawMsg ) ; } RETiRet ; }
A standard parser to parse out the PRI.
A standard parser to parse out the PRI .
/* pull PRI */ /* In this case, simply do so as if the pri would be right at top */