Update coding convention
[apps/livebox/livebox-cpp.git] / src / CModule.cpp
index cecf12e..e37cc52 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Copyright 2013  Samsung Electronics Co., Ltd
  *
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org
+ * http://floralicense.org/license/
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -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);
 }