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/tools/rsyslogd.c
static rsRetVal rsyslogd_InitGlobalClasses(void)
{
    DEFiRet;
    const char* pErrObj; /* tells us which object failed if that happens (useful
                            for troubleshooting!) */

    /* Intialize the runtime system */
    pErrObj = "rsyslog runtime"; /* set in case the runtime errors before
                                    setting an object */
    CHKiRet(rsrtInit(&pErrObj, &obj));
    rsrtSetErrLogger(rsyslogd_submitErrMsg);

    /* Now tell the system which classes we need ourselfs */
    pErrObj = "glbl";
    CHKiRet(objUse(glbl, CORE_COMPONENT));
    pErrObj = "module";
    CHKiRet(objUse(module, CORE_COMPONENT));
    pErrObj = "datetime";
    CHKiRet(objUse(datetime, CORE_COMPONENT));
    pErrObj = "ruleset";
    CHKiRet(objUse(ruleset, CORE_COMPONENT));
    pErrObj = "prop";
    CHKiRet(objUse(prop, CORE_COMPONENT));
    pErrObj = "parser";
    CHKiRet(objUse(parser, CORE_COMPONENT));
    pErrObj = "rsconf";
    CHKiRet(objUse(rsconf, CORE_COMPONENT));

    /* intialize some dummy classes that are not part of the runtime */
    pErrObj = "action";
    CHKiRet(actionClassInit());
    pErrObj = "template";
    CHKiRet(templateInit());

    /* TODO: the dependency on net shall go away! -- rgerhards, 2008-03-07 */
    pErrObj = "net";
    CHKiRet(objUse(net, LM_NET_FILENAME));

    dnscacheInit();
    initRainerscript();
    ratelimitModInit();

    /* we need to create the inputName property (only once during our lifetime)
     */
    CHKiRet(prop.Construct(&pInternalInputName));
    CHKiRet(prop.SetString(pInternalInputName, UCHAR_CONSTANT("rsyslogd"),
                           sizeof("rsyslogd") - 1));
    CHKiRet(prop.ConstructFinalize(pInternalInputName));

finalize_it:
    if (iRet != RS_RET_OK)
    {
        /* we know we are inside the init sequence, so we can safely emit
         * messages to stderr. -- rgerhards, 2008-04-02
         */
        fprintf(stderr,
                "Error during class init for object '%s' - failing...\n",
                pErrObj);
        fprintf(stderr, "rsyslogd initializiation failed - global classes "
                        "could not be initialized.\n"
                        "Did you do a \"make install\"?\n"
                        "Suggested action: run rsyslogd with -d -n options to "
                        "see what exactly "
                        "fails.\n");
    }

    RETiRet;
}
/* Method to initialize all global classes and use the objects that we need.
 * rgerhards, 2008-01-04
 * rgerhards, 2008-04-16: the actual initialization is now carried out by the
 * runtime
 */
Method to initialize all global classes and use the objects that we need.
rgerhards, 2008-01-04
rgerhards, 2008-04-16: the actual initialization is now carried out by the
runtime
Method to initialize all global classes and use the objects that we need . rgerhards 2008 - 01 - 04 rgerhards 2008 - 04 - 16 : the actual initialization is now carried out by the runtime
static rsRetVal rsyslogd_InitGlobalClasses(void)
{
    DEFiRet;
    const char* pErrObj; 
    pErrObj = "rsyslog runtime"; 
    CHKiRet(rsrtInit(&pErrObj, &obj));
    rsrtSetErrLogger(rsyslogd_submitErrMsg);
    pErrObj = "glbl";
    CHKiRet(objUse(glbl, CORE_COMPONENT));
    pErrObj = "module";
    CHKiRet(objUse(module, CORE_COMPONENT));
    pErrObj = "datetime";
    CHKiRet(objUse(datetime, CORE_COMPONENT));
    pErrObj = "ruleset";
    CHKiRet(objUse(ruleset, CORE_COMPONENT));
    pErrObj = "prop";
    CHKiRet(objUse(prop, CORE_COMPONENT));
    pErrObj = "parser";
    CHKiRet(objUse(parser, CORE_COMPONENT));
    pErrObj = "rsconf";
    CHKiRet(objUse(rsconf, CORE_COMPONENT));
    pErrObj = "action";
    CHKiRet(actionClassInit());
    pErrObj = "template";
    CHKiRet(templateInit());
    pErrObj = "net";
    CHKiRet(objUse(net, LM_NET_FILENAME));
    dnscacheInit();
    initRainerscript();
    ratelimitModInit();
    CHKiRet(prop.Construct(&pInternalInputName));
    CHKiRet(prop.SetString(pInternalInputName, UCHAR_CONSTANT("rsyslogd"),
                           sizeof("rsyslogd") - 1));
    CHKiRet(prop.ConstructFinalize(pInternalInputName));
finalize_it:
    if (iRet != RS_RET_OK)
    {
        fprintf(stderr,
                "Error during class init for object '%s' - failing...\n",
                pErrObj);
        fprintf(stderr, "rsyslogd initializiation failed - global classes "
                        "could not be initialized.\n"
                        "Did you do a \"make install\"?\n"
                        "Suggested action: run rsyslogd with -d -n options to "
                        "see what exactly "
                        "fails.\n");
    }
    RETiRet;
}
static rsRetVal rsyslogd_InitGlobalClasses ( void ) { DEFiRet ; const char * pErrObj ; pErrObj = " " ; CHKiRet ( rsrtInit ( & pErrObj , & obj ) ) ; rsrtSetErrLogger ( rsyslogd_submitErrMsg ) ; pErrObj = " " ; CHKiRet ( objUse ( glbl , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( module , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( datetime , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( ruleset , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( prop , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( parser , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( objUse ( rsconf , CORE_COMPONENT ) ) ; pErrObj = " " ; CHKiRet ( actionClassInit ( ) ) ; pErrObj = " " ; CHKiRet ( templateInit ( ) ) ; pErrObj = " " ; CHKiRet ( objUse ( net , LM_NET_FILENAME ) ) ; dnscacheInit ( ) ; initRainerscript ( ) ; ratelimitModInit ( ) ; CHKiRet ( prop . Construct ( & pInternalInputName ) ) ; CHKiRet ( prop . SetString ( pInternalInputName , UCHAR_CONSTANT ( " " ) , sizeof ( " " ) - 1 ) ) ; CHKiRet ( prop . ConstructFinalize ( pInternalInputName ) ) ; finalize_it : if ( iRet != RS_RET_OK ) { fprintf ( stderr , " \n " , pErrObj ) ; fprintf ( stderr , " " " \n " " \" \" \n " " " " " " \n " ) ; } RETiRet ; }
Method to initialize all global classes and use the objects that we need.
Method to initialize all global classes and use the objects that we need .
/* tells us which object failed if that happens (useful
                            for troubleshooting!) */ /* Intialize the runtime system */ /* set in case the runtime errors before
                                    setting an object */ /* Now tell the system which classes we need ourselfs */ /* intialize some dummy classes that are not part of the runtime */ /* TODO: the dependency on net shall go away! -- rgerhards, 2008-03-07 */ /* we need to create the inputName property (only once during our lifetime)
     */ /* we know we are inside the init sequence, so we can safely emit
         * messages to stderr. -- rgerhards, 2008-04-02
         */