Пример #1
0
/*
    Load a module. The module is located by searching for the filename by optionally using the module search path.
 */
int mprLoadModule(MprModule *mp)
{
#if BIT_HAS_DYN_LOAD
    mprAssert(mp);

    if (mprLoadNativeModule(mp) < 0) {
        return MPR_ERR_CANT_READ;
    }
    mprStartModule(mp);
    return 0;
#else
    mprError("Product built without the ability to load modules dynamically");
    return MPR_ERR_BAD_STATE;
#endif
}
Пример #2
0
/*
    Load a module. The module is located by searching for the filename by optionally using the module search path.
 */
PUBLIC int mprLoadModule(MprModule *mp)
{
#if ME_COMPILER_HAS_DYN_LOAD
    assert(mp);

    if (mprLoadNativeModule(mp) < 0) {
        return MPR_ERR_CANT_READ;
    }
    mprStartModule(mp);
    return 0;
#else
    mprLog("error mpr", 0, "mprLoadModule: %s failed", mp->name);
    mprLog("error mpr", 0, "Product built without the ability to load modules dynamically");
    return MPR_ERR_BAD_STATE;
#endif
}
Пример #3
0
/*
    Call the start routine for each module
 */
PUBLIC int mprStartModuleService()
{
    MprModuleService    *ms;
    MprModule           *mp;
    int                 next;

    ms = MPR->moduleService;
    assert(ms);

    for (next = 0; (mp = mprGetNextItem(ms->modules, &next)) != 0; ) {
        if (mprStartModule(mp) < 0) {
            return MPR_ERR_CANT_INITIALIZE;
        }
    }
#if VXWORKS && ME_DEBUG && SYM_SYNC_INCLUDED
    symSyncLibInit();
#endif
    return 0;
}