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
rsRetVal objClassInit(modInfo_t* pModInfo)
{
    pthread_mutexattr_t mutAttr;
    int i;
    DEFiRet;

    /* first, initialize the object system itself. This must be done
     * before any other object is created.
     */
    for (i = 0; i < OBJ_NUM_IDS; ++i)
    {
        arrObjInfo[i] = NULL;
    }

    /* the mutex must be recursive, because objects may call into other
     * object identifiers recursively.
     */
    pthread_mutexattr_init(&mutAttr);
    pthread_mutexattr_settype(&mutAttr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutex_init(&mutObjGlobalOp, &mutAttr);

    /* request objects we use */
    CHKiRet(objGetObjInterface(&obj)); /* get ourselves ;) */

    /* init classes we use (limit to as few as possible!) */
    CHKiRet(datetimeClassInit(pModInfo));
    CHKiRet(cfsyslineInit());
    CHKiRet(varClassInit(pModInfo));
    CHKiRet(moduleClassInit(pModInfo));
    CHKiRet(strmClassInit(pModInfo));
    CHKiRet(objUse(var, CORE_COMPONENT));
    CHKiRet(objUse(module, CORE_COMPONENT));
    CHKiRet(objUse(strm, CORE_COMPONENT));

finalize_it:
    RETiRet;
}
/* initialize our own class
 * Please note that this also initializes those classes that we rely on.
 * Though this is a bit dirty, we need to do it - otherwise we can't get
 * around that bootstrap problem. We need to face the fact the the obj
 * class is a little different from the rest of the system, as it provides
 * the core class loader functionality.
 * rgerhards, 2008-02-29
 */
initialize our own class
Please note that this also initializes those classes that we rely on.
Though this is a bit dirty, we need to do it - otherwise we can't get
around that bootstrap problem. We need to face the fact the the obj
class is a little different from the rest of the system, as it provides
the core class loader functionality.
initialize our own class Please note that this also initializes those classes that we rely on . Though this is a bit dirty we need to do it - otherwise we can ' t get around that bootstrap problem . We need to face the fact the the obj class is a little different from the rest of the system as it provides the core class loader functionality .
rsRetVal objClassInit(modInfo_t* pModInfo)
{
    pthread_mutexattr_t mutAttr;
    int i;
    DEFiRet;
    for (i = 0; i < OBJ_NUM_IDS; ++i)
    {
        arrObjInfo[i] = NULL;
    }
    pthread_mutexattr_init(&mutAttr);
    pthread_mutexattr_settype(&mutAttr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutex_init(&mutObjGlobalOp, &mutAttr);
    CHKiRet(objGetObjInterface(&obj)); 
    CHKiRet(datetimeClassInit(pModInfo));
    CHKiRet(cfsyslineInit());
    CHKiRet(varClassInit(pModInfo));
    CHKiRet(moduleClassInit(pModInfo));
    CHKiRet(strmClassInit(pModInfo));
    CHKiRet(objUse(var, CORE_COMPONENT));
    CHKiRet(objUse(module, CORE_COMPONENT));
    CHKiRet(objUse(strm, CORE_COMPONENT));
finalize_it:
    RETiRet;
}
rsRetVal objClassInit ( modInfo_t * pModInfo ) { pthread_mutexattr_t mutAttr ; int i ; DEFiRet ; for ( i = 0 ; i < OBJ_NUM_IDS ; ++ i ) { arrObjInfo [ i ] = NULL ; } pthread_mutexattr_init ( & mutAttr ) ; pthread_mutexattr_settype ( & mutAttr , PTHREAD_MUTEX_RECURSIVE ) ; pthread_mutex_init ( & mutObjGlobalOp , & mutAttr ) ; CHKiRet ( objGetObjInterface ( & obj ) ) ; CHKiRet ( datetimeClassInit ( pModInfo ) ) ; CHKiRet ( cfsyslineInit ( ) ) ; CHKiRet ( varClassInit ( pModInfo ) ) ; CHKiRet ( moduleClassInit ( pModInfo ) ) ; CHKiRet ( strmClassInit ( pModInfo ) ) ; CHKiRet ( objUse ( var , CORE_COMPONENT ) ) ; CHKiRet ( objUse ( module , CORE_COMPONENT ) ) ; CHKiRet ( objUse ( strm , CORE_COMPONENT ) ) ; finalize_it : RETiRet ; }
initialize our own class
 Please note that this also initializes those classes that we rely on.
initialize our own class Please note that this also initializes those classes that we rely on .
/* first, initialize the object system itself. This must be done
     * before any other object is created.
     */ /* the mutex must be recursive, because objects may call into other
     * object identifiers recursively.
     */ /* request objects we use */ /* get ourselves ;) */ /* init classes we use (limit to as few as possible!) */