diff options
Diffstat (limited to 'src/CModule.cpp')
-rw-r--r-- | src/CModule.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/CModule.cpp b/src/CModule.cpp index e06f365..e37cc52 100644 --- a/src/CModule.cpp +++ b/src/CModule.cpp @@ -81,8 +81,9 @@ CModule *CModule::Load(const char *pkgname) } inst->m_fNeedToCreate = (int (*)(const char *, const char *))dlsym(inst->m_pHandle, "livebox_need_to_create"); - if (!inst->m_fNeedToCreate) + if (!inst->m_fNeedToCreate) { DbgPrint("%s has no livebox_need_to_create\n", pkgname); + } inst->m_fInitialize = (int (*)(const char *))dlsym(inst->m_pHandle, "livebox_initialize"); if (!inst->m_fInitialize) { @@ -99,8 +100,9 @@ CModule *CModule::Load(const char *pkgname) } inst->m_fFinalize = (int (*)(void))dlsym(inst->m_pHandle, "livebox_finalize"); - if (!inst->m_fFinalize) + if (!inst->m_fFinalize) { DbgPrint("%s has no livebox_finalize\n", pkgname); + } m_pModuleList = dlist_append(m_pModuleList, inst); return inst; @@ -125,14 +127,14 @@ int CModule::Unload(void) return LB_STATUS_SUCCESS; } -int CModule::Create(const char *filename, const char *content, const char *cluster, const char *category) +int CModule::Create(const char *id, const char *content, const char *cluster, const char *category) { CLiveBoxImpl *inst; inst = (CLiveBoxImpl *)m_fNew(); if (inst) { int ret; - ret = inst->Create(filename, content, cluster, category); + ret = inst->Create(id, content, cluster, category); if (ret < 0) { delete inst; return ret; @@ -150,15 +152,16 @@ int CModule::Destroy(CLiveBoxImpl *inst) struct dlist *l; l = dlist_find_data(m_pList, inst); - if (!l) + if (!l) { return LB_STATUS_ERROR_NOT_EXIST; + } m_pList = dlist_remove(m_pList, l); delete inst; return LB_STATUS_SUCCESS; } -CLiveBoxImpl *CModule::FindLiveBox(const char *filename) +CLiveBoxImpl *CModule::FindLiveBox(const char *id) { struct dlist *l; void *item; @@ -166,8 +169,9 @@ CLiveBoxImpl *CModule::FindLiveBox(const char *filename) dlist_foreach(m_pList, l, item) { box = (CLiveBoxImpl *)item; - if (!strcmp(filename, box->Filename())) + if (!strcmp(id, box->Filename())) { return box; + } } return NULL; @@ -175,8 +179,9 @@ CLiveBoxImpl *CModule::FindLiveBox(const char *filename) int CModule::NeedToCreate(const char *cluster, const char *category) { - if (!m_fNeedToCreate) + if (!m_fNeedToCreate) { return 0; + } return m_fNeedToCreate(cluster, category); } |