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 InfoConstruct(objInfo_t** ppThis, uchar* pszID, int iObjVers,
                              rsRetVal (*pConstruct)(void*),
                              rsRetVal (*pDestruct)(void*),
                              rsRetVal (*pQueryIF)(interface_t*),
                              modInfo_t* pModInfo)
{
    DEFiRet;
    int i;
    objInfo_t* pThis;

    assert(ppThis != NULL);

    if ((pThis = calloc(1, sizeof(objInfo_t))) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);

    pThis->pszID = pszID;
    pThis->lenID = ustrlen(pszID);
    pThis->pszName = ustrdup(pszID); /* it's OK if we have NULL ptr, GetName()
                                        will deal with that! */
    pThis->iObjVers = iObjVers;
    pThis->QueryIF = pQueryIF;
    pThis->pModInfo = pModInfo;

    pThis->objMethods[0] = pConstruct;
    pThis->objMethods[1] = pDestruct;
    for (i = 2; i < OBJ_NUM_METHODS; ++i)
    {
        pThis->objMethods[i] = objInfoNotImplementedDummy;
    }

    *ppThis = pThis;

finalize_it:
    RETiRet;
}
/* construct an object Info object. Each class shall do this on init. The
 * resulting object shall be cached during the lifetime of the class and each
 * object shall receive a reference. A constructor and destructor MUST be
 * provided for all objects, thus they are in the parameter list. pszID is the
 * identifying object name and must point to constant pool memory. It is never
 * freed.
 */
construct an object Info object. Each class shall do this on init. The
resulting object shall be cached during the lifetime of the class and each
object shall receive a reference. A constructor and destructor MUST be
provided for all objects, thus they are in the parameter list. pszID is the
identifying object name and must point to constant pool memory. It is never
freed.
construct an object Info object . Each class shall do this on init . The resulting object shall be cached during the lifetime of the class and each object shall receive a reference . A constructor and destructor MUST be provided for all objects thus they are in the parameter list . pszID is the identifying object name and must point to constant pool memory . It is never freed .
static rsRetVal InfoConstruct(objInfo_t** ppThis, uchar* pszID, int iObjVers,
                              rsRetVal (*pConstruct)(void*),
                              rsRetVal (*pDestruct)(void*),
                              rsRetVal (*pQueryIF)(interface_t*),
                              modInfo_t* pModInfo)
{
    DEFiRet;
    int i;
    objInfo_t* pThis;
    assert(ppThis != NULL);
    if ((pThis = calloc(1, sizeof(objInfo_t))) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
    pThis->pszID = pszID;
    pThis->lenID = ustrlen(pszID);
    pThis->pszName = ustrdup(pszID); 
    pThis->iObjVers = iObjVers;
    pThis->QueryIF = pQueryIF;
    pThis->pModInfo = pModInfo;
    pThis->objMethods[0] = pConstruct;
    pThis->objMethods[1] = pDestruct;
    for (i = 2; i < OBJ_NUM_METHODS; ++i)
    {
        pThis->objMethods[i] = objInfoNotImplementedDummy;
    }
    *ppThis = pThis;
finalize_it:
    RETiRet;
}
static rsRetVal InfoConstruct ( objInfo_t * * ppThis , uchar * pszID , int iObjVers , rsRetVal ( * pConstruct ) ( void * ) , rsRetVal ( * pDestruct ) ( void * ) , rsRetVal ( * pQueryIF ) ( interface_t * ) , modInfo_t * pModInfo ) { DEFiRet ; int i ; objInfo_t * pThis ; assert ( ppThis != NULL ) ; if ( ( pThis = calloc ( 1 , sizeof ( objInfo_t ) ) ) == NULL ) ABORT_FINALIZE ( RS_RET_OUT_OF_MEMORY ) ; pThis -> pszID = pszID ; pThis -> lenID = ustrlen ( pszID ) ; pThis -> pszName = ustrdup ( pszID ) ; pThis -> iObjVers = iObjVers ; pThis -> QueryIF = pQueryIF ; pThis -> pModInfo = pModInfo ; pThis -> objMethods [ 0 ] = pConstruct ; pThis -> objMethods [ 1 ] = pDestruct ; for ( i = 2 ; i < OBJ_NUM_METHODS ; ++ i ) { pThis -> objMethods [ i ] = objInfoNotImplementedDummy ; } * ppThis = pThis ; finalize_it : RETiRet ; }
construct an object Info object.
construct an object Info object .
/* it's OK if we have NULL ptr, GetName()
                                        will deal with that! */