From da8e71cb35ed0ba62f39bf2abcb5055016874b03 Mon Sep 17 00:00:00 2001 From: t-kmt123 Date: Tue, 6 Jul 2021 14:16:38 +0900 Subject: rename libipc --- CMakeLists.txt | 8 +++--- cluster_ipc.pc.in | 10 ++++++++ include/cluster_ipc.h | 49 ++++++++++++++++++++++++++++++++++++ include/ipc.h | 49 ------------------------------------ ipc.pc.in | 10 -------- ipc_unit_test/ipc_unit_test_client.c | 2 +- ipc_unit_test/ipc_unit_test_common.c | 2 +- ipc_unit_test/ipc_unit_test_server.c | 2 +- src/CMakeLists.txt | 2 +- src/ipc_client.c | 2 +- src/ipc_internal.c | 2 +- src/ipc_server.c | 2 +- src/ipc_usage_info_table.c | 2 +- 13 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 cluster_ipc.pc.in create mode 100644 include/cluster_ipc.h delete mode 100644 include/ipc.h delete mode 100644 ipc.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a09fff5..6db6abb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2021, Nippon Seiki Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -project(ipc C) +project(cluster_ipc C) cmake_minimum_required(VERSION 2.8) @@ -20,7 +20,7 @@ include(GNUInstallDirs) set(IPC_LIBRARY_VERSION "1.0.0") # Name of library API -set(TARGET_NAME ipc) +set(TARGET_NAME cluster_ipc) # Name of IC-service server API #set(SERVER_API_NAME cluster_server_api) @@ -29,7 +29,7 @@ set(TARGET_NAME ipc) add_subdirectory(src) add_subdirectory(ipc_unit_test) -configure_file(ipc.pc.in ipc.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ipc.pc +configure_file(cluster_ipc.pc.in cluster_ipc.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cluster_ipc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/cluster_ipc.pc.in b/cluster_ipc.pc.in new file mode 100644 index 0000000..dac9b70 --- /dev/null +++ b/cluster_ipc.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ + +Name: @TARGET_NAME@ +Description: client and server ipc library by domain socket with defined shared data protocol +Version: @IPC_LIBRARY_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} -lcluster_ipc diff --git a/include/cluster_ipc.h b/include/cluster_ipc.h new file mode 100644 index 0000000..64b731c --- /dev/null +++ b/include/cluster_ipc.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021, Nippon Seiki Co., Ltd. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef IPC_H +#define IPC_H + +#include + +// Environment Variable for unix-domain-socket file path +#define IPC_ENV_DOMAIN_SOCKET_PATH "IPC_DOMAIN_PATH" + +// return value for API +typedef enum { + IPC_RET_OK = 0, + IPC_ERR_PARAM, + IPC_ERR_SEQUENCE, + IPC_ERR_NO_RESOURCE, + IPC_ERR_OTHER +} IPC_RET_E; + +// format of callback function +typedef void (*IPC_CHANGE_NOTIFY_CB)(void* pData, signed int size, int kind); + +// for Server Function +IPC_RET_E ipcServerStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcSendMessage(IPC_USAGE_TYPE_E usageType, const void* pData, signed int size); +IPC_RET_E ipcServerStop(IPC_USAGE_TYPE_E usageType); + +// for Client Function +IPC_RET_E ipcClientStart(IPC_USAGE_TYPE_E usageType); +IPC_RET_E ipcReadDataPool(IPC_USAGE_TYPE_E usageType, void* pData, signed int* pSize); +IPC_RET_E ipcRegisterCallback(IPC_USAGE_TYPE_E usageType, IPC_CHANGE_NOTIFY_CB changeNotifyCb); +IPC_RET_E ipcClientStop(IPC_USAGE_TYPE_E usageType); + +#endif // IPC_H diff --git a/include/ipc.h b/include/ipc.h deleted file mode 100644 index 64b731c..0000000 --- a/include/ipc.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021, Nippon Seiki Co., Ltd. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef IPC_H -#define IPC_H - -#include - -// Environment Variable for unix-domain-socket file path -#define IPC_ENV_DOMAIN_SOCKET_PATH "IPC_DOMAIN_PATH" - -// return value for API -typedef enum { - IPC_RET_OK = 0, - IPC_ERR_PARAM, - IPC_ERR_SEQUENCE, - IPC_ERR_NO_RESOURCE, - IPC_ERR_OTHER -} IPC_RET_E; - -// format of callback function -typedef void (*IPC_CHANGE_NOTIFY_CB)(void* pData, signed int size, int kind); - -// for Server Function -IPC_RET_E ipcServerStart(IPC_USAGE_TYPE_E usageType); -IPC_RET_E ipcSendMessage(IPC_USAGE_TYPE_E usageType, const void* pData, signed int size); -IPC_RET_E ipcServerStop(IPC_USAGE_TYPE_E usageType); - -// for Client Function -IPC_RET_E ipcClientStart(IPC_USAGE_TYPE_E usageType); -IPC_RET_E ipcReadDataPool(IPC_USAGE_TYPE_E usageType, void* pData, signed int* pSize); -IPC_RET_E ipcRegisterCallback(IPC_USAGE_TYPE_E usageType, IPC_CHANGE_NOTIFY_CB changeNotifyCb); -IPC_RET_E ipcClientStop(IPC_USAGE_TYPE_E usageType); - -#endif // IPC_H diff --git a/ipc.pc.in b/ipc.pc.in deleted file mode 100644 index 55c1157..0000000 --- a/ipc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ - -Name: @TARGET_NAME@ -Description: client and server ipc library by domain socket with defined shared data protocol -Version: @IPC_LIBRARY_VERSION@ - -Cflags: -I${includedir} -Libs: -L${libdir} -lipc \ No newline at end of file diff --git a/ipc_unit_test/ipc_unit_test_client.c b/ipc_unit_test/ipc_unit_test_client.c index f6e2f5c..cc09d2a 100644 --- a/ipc_unit_test/ipc_unit_test_client.c +++ b/ipc_unit_test/ipc_unit_test_client.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "ipc_unit_test_common.h" diff --git a/ipc_unit_test/ipc_unit_test_common.c b/ipc_unit_test/ipc_unit_test_common.c index 05169bf..26d4830 100644 --- a/ipc_unit_test/ipc_unit_test_common.c +++ b/ipc_unit_test/ipc_unit_test_common.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#include +#include #include "ipc_unit_test_common.h" IPC_UNIT_TEST_DATA_LIST IcServiceList[] = { diff --git a/ipc_unit_test/ipc_unit_test_server.c b/ipc_unit_test/ipc_unit_test_server.c index f627dca..807db2c 100644 --- a/ipc_unit_test/ipc_unit_test_server.c +++ b/ipc_unit_test/ipc_unit_test_server.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include "ipc_unit_test_common.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 45088cb..dc9366a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,4 +34,4 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} # PUBLIC_HEADER DESTINATION include ) -install(FILES ../include/ipc.h ../include/ipc_protocol.h DESTINATION include) +install(FILES ../include/cluster_ipc.h ../include/ipc_protocol.h DESTINATION include) diff --git a/src/ipc_client.c b/src/ipc_client.c index 7e404e7..1a4a031 100644 --- a/src/ipc_client.c +++ b/src/ipc_client.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include "ipc_internal.h" #define IPC_CLIENT_USAGE_MAX_NUM (4) diff --git a/src/ipc_internal.c b/src/ipc_internal.c index 1958655..7a37866 100644 --- a/src/ipc_internal.c +++ b/src/ipc_internal.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include "ipc_internal.h" int ipcCreateDomainName(IPC_USAGE_TYPE_E usageType, char *pOutName, int *pSize) diff --git a/src/ipc_server.c b/src/ipc_server.c index 74eb7bc..301409c 100644 --- a/src/ipc_server.c +++ b/src/ipc_server.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include "ipc_internal.h" diff --git a/src/ipc_usage_info_table.c b/src/ipc_usage_info_table.c index e127fde..a1f0939 100644 --- a/src/ipc_usage_info_table.c +++ b/src/ipc_usage_info_table.c @@ -16,7 +16,7 @@ */ -#include +#include #include "ipc_internal.h" #define DEFINE_OFFSET_SIZE(struct_name, member, kind) \ -- cgit 1.2.3-korg