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/obj.c
static rsRetVal RegisterObj(uchar* pszObjName, objInfo_t* pInfo)
{
    DEFiRet;
    int bFound;
    int i;

    assert(pszObjName != NULL);
    assert(pInfo != NULL);

    bFound = 0;
    i = 0;
    while (!bFound && i < OBJ_NUM_IDS && arrObjInfo[i] != NULL)
    {
        if (arrObjInfo[i] != NULL && !ustrcmp(arrObjInfo[i]->pszID, pszObjName))
        {
            bFound = 1;
            break;
        }
        ++i;
    }

    if (bFound)
        ABORT_FINALIZE(RS_RET_OBJ_ALREADY_REGISTERED);
    if (i >= OBJ_NUM_IDS)
        ABORT_FINALIZE(RS_RET_OBJ_REGISTRY_OUT_OF_SPACE);

    arrObjInfo[i] = pInfo;
    /* DEV debug only: dbgprintf("object '%s' successfully registered with
    index %d, qIF %p\n", pszObjName, i, pInfo->QueryIF); */

finalize_it:
    if (iRet != RS_RET_OK)
    {
        LogError(0, NO_ERRCODE,
                 "registering object '%s' failed with error code %d",
                 pszObjName, iRet);
    }

    RETiRet;
}
/* register a classes' info pointer, so that we can reference it later, if
 * needed to (e.g. for de-serialization support). rgerhards, 2008-01-07 In this
 * function, we look for a free space in the object table. While we do so, we
 * also detect if the same object has already been registered, which is not
 * valid. rgerhards, 2008-02-29
 */
register a classes' info pointer, so that we can reference it later, if
needed to . rgerhards, 2008-01-07 In this
function, we look for a free space in the object table. While we do so, we
also detect if the same object has already been registered, which is not
valid.
register a classes ' info pointer so that we can reference it later if needed to . rgerhards 2008 - 01 - 07 In this function we look for a free space in the object table . While we do so we also detect if the same object has already been registered which is not valid .
static rsRetVal RegisterObj(uchar* pszObjName, objInfo_t* pInfo)
{
    DEFiRet;
    int bFound;
    int i;
    assert(pszObjName != NULL);
    assert(pInfo != NULL);
    bFound = 0;
    i = 0;
    while (!bFound && i < OBJ_NUM_IDS && arrObjInfo[i] != NULL)
    {
        if (arrObjInfo[i] != NULL && !ustrcmp(arrObjInfo[i]->pszID, pszObjName))
        {
            bFound = 1;
            break;
        }
        ++i;
    }
    if (bFound)
        ABORT_FINALIZE(RS_RET_OBJ_ALREADY_REGISTERED);
    if (i >= OBJ_NUM_IDS)
        ABORT_FINALIZE(RS_RET_OBJ_REGISTRY_OUT_OF_SPACE);
    arrObjInfo[i] = pInfo;
finalize_it:
    if (iRet != RS_RET_OK)
    {
        LogError(0, NO_ERRCODE,
                 "registering object '%s' failed with error code %d",
                 pszObjName, iRet);
    }
    RETiRet;
}
static rsRetVal RegisterObj ( uchar * pszObjName , objInfo_t * pInfo ) { DEFiRet ; int bFound ; int i ; assert ( pszObjName != NULL ) ; assert ( pInfo != NULL ) ; bFound = 0 ; i = 0 ; while ( ! bFound && i < OBJ_NUM_IDS && arrObjInfo [ i ] != NULL ) { if ( arrObjInfo [ i ] != NULL && ! ustrcmp ( arrObjInfo [ i ] -> pszID , pszObjName ) ) { bFound = 1 ; break ; } ++ i ; } if ( bFound ) ABORT_FINALIZE ( RS_RET_OBJ_ALREADY_REGISTERED ) ; if ( i >= OBJ_NUM_IDS ) ABORT_FINALIZE ( RS_RET_OBJ_REGISTRY_OUT_OF_SPACE ) ; arrObjInfo [ i ] = pInfo ; finalize_it : if ( iRet != RS_RET_OK ) { LogError ( 0 , NO_ERRCODE , " " , pszObjName , iRet ) ; } RETiRet ; }
register a classes' info pointer, so that we can reference it later, if
 needed to (e.g.
register a classes ' info pointer so that we can reference it later if needed to ( e . g .
/* DEV debug only: dbgprintf("object '%s' successfully registered with
    index %d, qIF %p\n", pszObjName, i, pInfo->QueryIF); */