ClRcT clPubsAppInitialize(ClUint32T argc, ClCharT *argv[])
{

    ClRcT rc = CL_OK;
    ClEoExecutionObjT* pEvtPubsEoObj;

    rc = clEoMyEoObjectGet(&pEvtPubsEoObj);
    if( rc != CL_OK )
    {
        clOsalPrintf("EO Object Get failed [%#X]\n",rc);
    }
                                                                                
    rc = clEoClientInstall(pEvtPubsEoObj, CL_EO_NATIVE_COMPONENT_TABLE_ID,gClEvtPubsTestFuncList, 0,
                                          (int)(sizeof(gClEvtPubsTestFuncList)/sizeof (ClEoPayloadWithReplyCallbackT)));
    if( rc != CL_OK )
    {
        clOsalPrintf("Installing Native table failed [%#X]\n",rc);
    }
    
    clEvtPubsCpmInit(); 

    clPubsEventLibrayInitialize();
    
    return CL_OK;
}
ClRcT clEvtTestContInitialize(ClUint32T argc, ClCharT *argv[])
{
    ClRcT rc = CL_OK;
    ClEoExecutionObjT *pEoObj;

#if 0
    ClSvcHandleT svcHandle = { 0 };
    ClOsalTaskIdT taskId = 0;
#endif

    clEvtContTestDbInit();
    rc = clEoMyEoObjectGet(&pEoObj);
    rc = clEoClientInstall(pEoObj, CL_EO_NATIVE_COMPONENT_TABLE_ID,
                           gClEvtTestContFuncList, (ClEoDataT) NULL,
                           (int) sizeof(gClEvtTestContFuncList) /
                           (int) sizeof(ClEoPayloadWithReplyCallbackT));

    rc = clEvtCpmInit();

#if 0
    svcHandle.cpmHandle = &gClEvtTestContCpmHandle;
    rc = clDispatchThreadCreate(pEoObj, &taskId, svcHandle);
#endif

    clEvtContAppAddressGet();

    clEvtContParseTestInfo();

    return CL_OK;
}
ClRcT clEvtTestAppInitialize(ClUint32T argc, ClCharT *argv[])
{
    ClRcT rc = CL_OK;
    ClEoExecutionObjT *pEoObj;

#if 0
    ClSvcHandleT svcHandle = { 0 };
    ClOsalTaskIdT taskId = 0;
#endif

    /*
     * Create the list to hold the mapping b/n Init Name & evtHandle 
     */
    rc = clCntLlistCreate(clEvtContInitKeyCompare, clEvtContInitDataDelete,
                          clEvtContInitDataDelete, CL_CNT_UNIQUE_KEY,
                          &gEvtTestInitInfo);
    if (CL_OK != rc)
    {
        clOsalPrintf("Creating linked list for Init Failed, rc[0x%X]\r\n", rc);
        return rc;
    }

    rc = clCntLlistCreate(clChanContainerKeyCompare, clChanContainerDataDelete,
                          clChanContainerDataDelete, CL_CNT_UNIQUE_KEY,
                          &gChanHandleInitInfo);
    if(rc!=CL_OK)
    {
        clOsalPrintf("Creating Linked List for Channel handles failed\n\r");
        return rc;
    }
    /*
     * Create a Mutex to lock the containers before accessing them 
     */
    rc = clOsalMutexCreate(&gEvtTestInitMutex);
    if (CL_OK != rc)
    {
        clOsalPrintf("Creating Mutex for Init Failed, rc[0x%X]\r\n", rc);
        return rc;
    }

    rc = clEoMyEoObjectGet(&pEoObj);
    rc = clEoClientInstall(pEoObj, CL_EO_NATIVE_COMPONENT_TABLE_ID,
                           gClEvtTestAppFuncList, (ClEoDataT) NULL,
                           (int) sizeof(gClEvtTestAppFuncList) /
                           (int) sizeof(ClEoPayloadWithReplyCallbackT));
    rc = clEvtCpmInit();

#if 0
    svcHandle.cpmHandle = &gEvtTestAppCpmHandle;
    rc = clDispatchThreadCreate(pEoObj, &taskId, svcHandle);
#endif

    return CL_OK;
}
/******************************************************************************
  Static Functions
*******************************************************************************/
static ClRcT
clAmsLibInitialize(void)
{
    ClRcT rc = CL_OK;
    ClEoExecutionObjT *eo;

    if (lib_initialized == CL_FALSE)
    {
        if ( (rc = clHandleDatabaseCreate(
                        ams_handle_instance_destructor,
                        &handle_database))
                != CL_OK )
            goto error_exit;

        /*
         * XXX: On the long run, when multiple EOs can exist in same process,
         * the following function installation may be devorced from the lib
         * initialization, so that it can be called multiple times.
         */

        if ( ( rc = clEoMyEoObjectGet(
                        &eo)) 
                != CL_OK )
            goto error_exit;

        if ( ( rc = clEoClientInstall(
                        eo,
                        CL_AMS_CLIENT_TABLE_ID,
                        cl_ams_client_callback_list,
                        /*
                         * cdata passsed to each function call 
                         */
                        0,
                        (int)(sizeof(cl_ams_client_callback_list)/
                              sizeof(ClEoPayloadWithReplyCallbackT))))
                != CL_OK )
            goto error_exit;
        lib_initialized = CL_TRUE;
    }

    return CL_OK;

error_exit:

    return CL_AMS_RC (rc);
}