rename about module : mmi-core to mmi-client 91/281591/1
authordyamy-lee <dyamy.lee@samsung.com>
Mon, 5 Sep 2022 05:05:12 +0000 (14:05 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 20 Sep 2022 04:45:08 +0000 (13:45 +0900)
this module's role is more related saving client data.
So, changed module name from mmi-core to mmi-client

Change-Id: Iaa90457d8bc60996c26789e79ec32c62804048eb

src/meson.build
src/mmi-client.c [new file with mode: 0644]
src/mmi-client.h [new file with mode: 0644]
src/mmi-core.c [deleted file]
src/mmi-core.h [deleted file]
src/mmi.c
tests/mmi-main-test.cpp

index 13c5ee4a239b44723873a55097e62774cb98b5a5..aea3c8b5a706c80185223022b0655dc295bac520 100644 (file)
@@ -6,8 +6,8 @@ mmi_srcs = [
        'mmi-dbg.h',
        'mmi_proxy.h',
        'mmi_proxy.c',
-       'mmi-core.h',
-       'mmi-core.c',
+       'mmi-client.h',
+       'mmi-client.c',
        ]
 
 install_headers(
diff --git a/src/mmi-client.c b/src/mmi-client.c
new file mode 100644 (file)
index 0000000..f6ae932
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+* Copyright © 2022 Samsung Electronics co., Ltd. All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice (including the next
+* paragraph) shall be included in all copies or substantial portions of the
+* Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*/
+
+#include "mmi-ipc.h"
+#include "mmi-dbg.h"
+#include "mmi-client.h"
+
+static mmi_handle mmi_h = NULL;
+
+int mmi_client_create(void)
+{
+       mmi_h = (mmi_handle)calloc(1, sizeof(mmi_struct_s));
+
+       if (mmi_h == NULL) {
+               LOGE("Failed to allocate memory for mmi_h !\n");
+               return MMI_ERROR_OUT_OF_MEMORY;
+       }
+
+       if (mmi_ipc_init()) {
+               LOGE("Failed to init mmi ipc !\n");
+               if(mmi_h != NULL) {
+                       free(mmi_h);
+                       mmi_h = NULL;
+               }
+               return MMI_ERROR_NOT_SUPPORTED;
+       }
+
+       mmi_h->rpc_h = mmi_ipc_get_rpc_h();
+       mmi_h->stub_appid = mmi_ipc_get_stub_appid();
+       mmi_h->state = mmi_ipc_get_state();
+
+       return MMI_ERROR_NONE;
+}
+
+int mmi_client_destroy(void)
+{
+       if (mmi_h == NULL) {
+               LOGE("A mmi_h is already NULL");
+               return MMI_ERROR_NONE;
+       }
+
+       mmi_ipc_shutdown();
+       free(mmi_h);
+       mmi_h = NULL;
+
+       return MMI_ERROR_NONE;
+}
diff --git a/src/mmi-client.h b/src/mmi-client.h
new file mode 100644 (file)
index 0000000..aa0248a
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+* Copyright © 2022 Samsung Electronics co., Ltd. All Rights Reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice (including the next
+* paragraph) shall be included in all copies or substantial portions of the
+* Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+* DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef __MMI_CLIENT_H__
+#define __MMI_CLIENT_H__
+
+#include "mmi-common.h"
+
+typedef void* mmi_rpc_h;
+
+typedef struct {
+       mmi_rpc_h rpc_h;
+       const char *stub_appid;
+       int state;
+} mmi_struct_s;
+
+typedef mmi_struct_s* mmi_handle;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int mmi_client_create(void);
+int mmi_client_destroy(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__MMI_CLIENT_H__
\ No newline at end of file
diff --git a/src/mmi-core.c b/src/mmi-core.c
deleted file mode 100644 (file)
index 35b8e3a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-* Copyright © 2022 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include "mmi-ipc.h"
-#include "mmi-dbg.h"
-#include "mmi-core.h"
-
-static mmi_handle mmi_h = NULL;
-
-int mmi_core_create(void)
-{
-       mmi_h = (mmi_handle)calloc(1, sizeof(mmi_struct_s));
-
-       if (mmi_h == NULL) {
-               LOGE("Failed to allocate memory for mmi_h !\n");
-               return MMI_ERROR_OUT_OF_MEMORY;
-       }
-
-       if (mmi_ipc_init()) {
-               LOGE("Failed to init mmi ipc !\n");
-               if(mmi_h != NULL) {
-                       free(mmi_h);
-                       mmi_h = NULL;
-               }
-               return MMI_ERROR_NOT_SUPPORTED;
-       }
-
-       mmi_h->rpc_h = mmi_ipc_get_rpc_h();
-       mmi_h->stub_appid = mmi_ipc_get_stub_appid();
-       mmi_h->state = mmi_ipc_get_state();
-
-       return MMI_ERROR_NONE;
-}
-
-int mmi_core_destroy(void)
-{
-       if (mmi_h == NULL) {
-               LOGE("A mmi_h is already NULL");
-               return MMI_ERROR_NONE;
-       }
-
-       mmi_ipc_shutdown();
-       free(mmi_h);
-       mmi_h = NULL;
-
-       return MMI_ERROR_NONE;
-}
diff --git a/src/mmi-core.h b/src/mmi-core.h
deleted file mode 100644 (file)
index 2d86325..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-* Copyright © 2022 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_CORE_H__
-#define __MMI_CORE_H__
-
-#include "mmi-common.h"
-
-typedef void* mmi_rpc_h;
-
-typedef struct {
-       mmi_rpc_h rpc_h;
-       const char *stub_appid;
-       int state;
-} mmi_struct_s;
-
-typedef mmi_struct_s* mmi_handle;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int mmi_core_create(void);
-int mmi_core_destroy(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__MMI_CORE_H__
\ No newline at end of file
index 54370a72efa26af4181103419f6542850f2cbdc4..022974c1b0f4462fcba766dbc5c7470ed2f0e763 100644 (file)
--- a/src/mmi.c
+++ b/src/mmi.c
 */
 
 #include "mmi.h"
-#include "mmi-core.h"
+#include "mmi-client.h"
 #include "mmi-dbg.h"
 
 MMI_API int mmi_init(void)
 {
-       int ret = mmi_core_create();
+       int ret = mmi_client_create();
        if(ret != MMI_ERROR_NONE) {
-               LOGE("Fail to create mmi handle instance(%d)", ret);
+               LOGE("Fail to create mmi client(%d)", ret);
                return MMI_ERROR_NOT_SUPPORTED;
        }
 
@@ -38,9 +38,9 @@ MMI_API int mmi_init(void)
 
 MMI_API int mmi_shutdown(void)
 {
-       int ret = mmi_core_destroy();
+       int ret = mmi_client_destroy();
        if(ret != MMI_ERROR_NONE) {
-               LOGE("Fail to destroy mmi handle instance(%d)", ret);
+               LOGE("Fail to destroy mmi client(%d)", ret);
                return MMI_ERROR_NOT_SUPPORTED;
        }
 
index ca59c5af6324d5b8c9bf3b22502c6513d7dfb69d..fced459386602ebfb8b1c6996aefe438b75bbd96 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 #include "mmi.h"
-#include "mmi-core.h"
+#include "mmi-client.h"
 #include "mmi-tests.h"
 #include "mmi-ipc.h"
 
@@ -52,11 +52,11 @@ TEST_F(MMIMainTest, MMIMainInit)
        mmi_shutdown();
 }
 
-TEST_F(MMIMainTest, MmiInstanceCreateSuccess)
+TEST_F(MMIMainTest, MmiClientCreateSuccess)
 {
-       int res = mmi_core_create();
+       int res = mmi_client_create();
 
        EXPECT_EQ(res, MMI_ERROR_NONE);
 
-       mmi_core_destroy();
+       mmi_client_destroy();
 }