Change naming style 06/278306/5
authorTaeminYeom <taemin.yeom@samsung.com>
Tue, 19 Jul 2022 02:30:43 +0000 (11:30 +0900)
committerTaeminYeom <taemin.yeom@samsung.com>
Tue, 19 Jul 2022 04:52:49 +0000 (13:52 +0900)
-Add "api" prefix to api body files
-Change under-bar to hyphen

Change-Id: I9a52de1339257eeaf05455b362941adaadcb40cc
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
36 files changed:
include/private/sensor-types-private.h
packaging/capi-system-sensor.spec
src/api/CMakeLists.txt
src/api/api-sensor-internal.cpp [moved from src/api/sensor-internal.cpp with 99% similarity]
src/api/api-sensor-provider.cpp [moved from src/api/sensor_provider.cpp with 100% similarity]
src/api/api-sensor-recorder-dummy.cpp [moved from src/api/sensor_recorder/sensor_recorder_dummy.cpp with 100% similarity]
src/api/api-sensor-recorder.cpp [moved from src/api/sensor_recorder/sensor_recorder.cpp with 100% similarity]
src/api/api-sensor.cpp [moved from src/api/sensor.cpp with 100% similarity]
src/api/fusion-util.c [moved from src/api/fusion_util.c with 100% similarity]
src/api/geomagnetic-field.c [moved from src/api/geomagnetic_field.c with 100% similarity]
src/api/sensor-listener.cpp [moved from src/api/sensor_listener.cpp with 99% similarity]
src/api/sensor-listener.h [moved from src/api/sensor_listener.h with 97% similarity]
src/api/sensor-manager-channel-handler.cpp [moved from src/api/sensor_manager_channel_handler.cpp with 96% similarity]
src/api/sensor-manager-channel-handler.h [moved from src/api/sensor_manager_channel_handler.h with 97% similarity]
src/api/sensor-manager.cpp [moved from src/api/sensor_manager.cpp with 98% similarity]
src/api/sensor-manager.h [moved from src/api/sensor_manager.h with 96% similarity]
src/api/sensor-provider-channel-handler.cpp [moved from src/api/sensor_provider_channel_handler.cpp with 96% similarity]
src/api/sensor-provider-channel-handler.h [moved from src/api/sensor_provider_channel_handler.h with 96% similarity]
src/api/sensor-provider.cpp [moved from src/api/sensor_provider_internal.cpp with 96% similarity]
src/api/sensor-provider.h [moved from src/api/sensor_provider_internal.h with 89% similarity]
src/api/sensor-reader.cpp [moved from src/api/sensor_reader.cpp with 98% similarity]
src/api/sensor-reader.h [moved from src/api/sensor_reader.h with 97% similarity]
src/shared/channel-event-handler.cpp [moved from src/shared/channel_event_handler.cpp with 96% similarity]
src/shared/channel-event-handler.h [moved from src/shared/channel_event_handler.h with 96% similarity]
src/shared/channel-handler.h [moved from src/shared/channel_handler.h with 100% similarity]
src/shared/channel.cpp
src/shared/channel.h
src/shared/command-types.h [moved from src/shared/command_types.h with 99% similarity]
src/shared/event-handler.h [moved from src/shared/event_handler.h with 100% similarity]
src/shared/event-loop.cpp [moved from src/shared/event_loop.cpp with 98% similarity]
src/shared/event-loop.h [moved from src/shared/event_loop.h with 98% similarity]
src/shared/sensor-info.cpp [moved from src/shared/sensor_info.cpp with 99% similarity]
src/shared/sensor-info.h [moved from src/shared/sensor_info.h with 100% similarity]
src/shared/sensor-utils.cpp [moved from src/shared/sensor_utils.cpp with 99% similarity]
src/shared/sensor-utils.h [moved from src/shared/sensor_utils.h with 99% similarity]
src/shared/sensor_types_private.h [deleted file]

index a2028d3..6e777c7 100644 (file)
@@ -48,6 +48,26 @@ extern "C"
 #define NAME_MAX 256
 #endif
 
+#define URI_REGEX(CATEGORY) R"~(^http:\/\/[\w-]+(\.[\w-]+)*\/)~" CATEGORY R"~(\/(general|healthinfo)\/[\w-]+(\.[\w-]+)*(\/[\w-]+(\.[\w-]+)*)$)~"
+#define SENSOR_URI_REGEX URI_REGEX("sensor")
+
+#define PREDEFINED_TYPE_URI "http://tizen.org/sensor/"
+
+#define PRIV_DELIMITER ";"
+#define URI_DELIMITER "/"
+
+#define PRIVILEGE_HEALTHINFO_STR "healthinfo"
+#define PRIVILEGE_HEALTHINFO_URI "http://tizen.org/privilege/healthinfo"
+
+#define PRIVILEGE_LOCATION_STR "location"
+#define PRIVILEGE_LOCATION_URI "http://tizen.org/privilege/location"
+
+#define PRIVILEGE_PLATFORM_STR "platform"
+#define PRIVILEGE_PLATFORM_URI "http://tizen.org/privilege/internal/default/platform"
+
+#define URI_PRIV_INDEX 4
+#define URI_SENSOR_TYPE_INDEX 5
+
 #define SENSOR_TYPE_SHIFT 32
 #define SENSOR_EVENT_SHIFT 16
 #define SENSOR_INDEX_MASK 0xFFFFFFFF
index 2ac2408..1a0fbfe 100644 (file)
@@ -15,6 +15,7 @@ Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libsystemd)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-base-common)
index 2e70720..a71efe4 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(capi-system-sensor)
 INCLUDE(GNUInstallDirs)
 
-SET(DEPENDENTS "dlog hal-api-sensor capi-base-common")
+SET(DEPENDENTS "dlog glib-2.0 hal-api-sensor capi-base-common")
 
 IF("${SENSOR_RECORDER}" STREQUAL "on")
        SET(DEPENDENTS "${DEPENDENTS} context-sensor-recorder-client")
@@ -41,12 +41,23 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 #ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
 # Compile Source files
-FILE(GLOB SOURCES *.c *.cpp)
+SET(SOURCES
+                       fusion-util.c
+                       geomagnetic-field.c
+                       api-sensor.cpp
+                       api-sensor-internal.cpp
+                       api-sensor-provider.cpp
+                       sensor-listener.cpp
+                       sensor-manager-channel-handler.cpp
+                       sensor-manager.cpp
+                       sensor-provider-channel-handler.cpp
+                       sensor-provider.cpp
+                       sensor-reader.cpp)
 
 IF("${SENSOR_RECORDER}" STREQUAL "on")
-       SET(SOURCES ${SOURCES} sensor_recorder/sensor_recorder.cpp)
+       SET(SOURCES ${SOURCES} api-sensor-recorder.cpp)
 ELSE()
-       SET(SOURCES ${SOURCES} sensor_recorder/sensor_recorder_dummy.cpp)
+       SET(SOURCES ${SOURCES} api-sensor-recorder-dummy.cpp)
 ENDIF()
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES})
similarity index 99%
rename from src/api/sensor-internal.cpp
rename to src/api/api-sensor-internal.cpp
index 77d3c58..87b6d49 100644 (file)
 
 #include <errno.h>
 
-#include <sensor-internal.h>
 #include <sensor.h>
-#include <sensor-types-private.h>
-#include <sensor_types_private.h>
-#include <sensor_utils.h>
-#include <channel_handler.h>
-#include <sensor_manager.h>
-#include <sensor_listener.h>
-#include <sensor_provider_internal.h>
+#include <sensor-internal.h>
+#include <sensor-manager.h>
+#include <sensor-listener.h>
+#include <sensor-provider.h>
+#include <sensor-reader.h>
+#include <sensor-utils.h>
 #include <sensor-log-private.h>
+#include <sensor-types-private.h>
+#include <channel-handler.h>
 #include <lock.h>
-#include <command_types.h>
-#include "sensor_reader.h"
+#include <command-types.h>
 
 #include <unordered_map>
 #include <regex>
similarity index 100%
rename from src/api/sensor.cpp
rename to src/api/api-sensor.cpp
similarity index 100%
rename from src/api/fusion_util.c
rename to src/api/fusion-util.c
similarity index 99%
rename from src/api/sensor_listener.cpp
rename to src/api/sensor-listener.cpp
index 12a1920..d0f0cc4 100644 (file)
  *
  */
 
-#include "sensor_listener.h"
+#include "sensor-listener.h"
 
-#include <channel_handler.h>
+#include <channel-handler.h>
 #include <sensor-log-private.h>
 #include <sensor-types-private.h>
-#include <command_types.h>
+#include <command-types.h>
 
 using namespace sensor;
 
similarity index 97%
rename from src/api/sensor_listener.h
rename to src/api/sensor-listener.h
index eeb8065..89b9cbe 100644 (file)
 #define __SENSOR_LISTENER_H__
 
 #include <channel.h>
-#include <channel_handler.h>
-#include <event_loop.h>
-#include <sensor_info.h>
+#include <channel-handler.h>
+#include <event-loop.h>
+#include <sensor-info.h>
 #include <sensor-types-private.h>
 #include <lock.h>
+
 #include <map>
 #include <atomic>
 #include <vector>
similarity index 96%
rename from src/api/sensor_manager_channel_handler.cpp
rename to src/api/sensor-manager-channel-handler.cpp
index 223a67e..9dc0b81 100644 (file)
  *
  */
 
-#include "sensor_manager_channel_handler.h"
+#include "sensor-manager-channel-handler.h"
 
 #include <sensor-log-private.h>
-#include <command_types.h>
-#include "sensor_manager.h"
+#include <command-types.h>
+#include "sensor-manager.h"
 
 using namespace sensor;
 
similarity index 97%
rename from src/api/sensor_manager_channel_handler.h
rename to src/api/sensor-manager-channel-handler.h
index 024c6f4..111ce95 100644 (file)
@@ -21,8 +21,8 @@
 #define __SENSOR_MANAGER_CHANNEL_HANDLER__
 
 #include <sensor-internal.h>
-#include <sensor_manager.h>
-#include <channel_handler.h>
+#include <sensor-manager.h>
+#include <channel-handler.h>
 #include <map>
 
 namespace sensor {
similarity index 98%
rename from src/api/sensor_manager.cpp
rename to src/api/sensor-manager.cpp
index e576b9d..3b534af 100644 (file)
  *
  */
 
-#include "sensor_manager.h"
+#include "sensor-manager.h"
 
 #include <sensor-log-private.h>
-#include <sensor_info.h>
-#include <sensor_utils.h>
-#include <command_types.h>
+#include <sensor-info.h>
+#include <sensor-utils.h>
+#include <command-types.h>
 #include <message.h>
 #include <channel.h>
 
-#include "sensor_manager_channel_handler.h"
+#include "sensor-manager-channel-handler.h"
 
 using namespace sensor;
 
similarity index 96%
rename from src/api/sensor_manager.h
rename to src/api/sensor-manager.h
index 1f6f1f9..1448206 100644 (file)
 #define __SENSOR_MANAGER_H__
 
 #include <channel.h>
-#include <sensor_info.h>
-#include <event_loop.h>
+#include <sensor-info.h>
+#include <event-loop.h>
 #include <list>
 #include <atomic>
 
 #include "sensor-internal.h"
-#include "sensor_provider_internal.h"
+#include "sensor-provider.h"
 
 namespace sensor {
 
similarity index 96%
rename from src/api/sensor_provider_channel_handler.cpp
rename to src/api/sensor-provider-channel-handler.cpp
index b464458..079b863 100644 (file)
  *
  */
 
-#include "sensor_provider_channel_handler.h"
+#include "sensor-provider-channel-handler.h"
 
-#include <command_types.h>
+#include <command-types.h>
 #include <sensor-log-private.h>
-#include "sensor_provider_internal.h"
+#include "sensor-provider.h"
 
 using namespace sensor;
 
similarity index 96%
rename from src/api/sensor_provider_channel_handler.h
rename to src/api/sensor-provider-channel-handler.h
index 9f8bfeb..5435118 100644 (file)
@@ -20,9 +20,9 @@
 #ifndef __SENSOR_PROVIDER_CHANNEL_HANDLER__
 #define __SENSOR_PROVIDER_CHANNEL_HANDLER__
 
-#include <channel_handler.h>
+#include <channel-handler.h>
 #include <sensor-internal.h>
-#include "sensor_provider_internal.h"
+#include "sensor-provider.h"
 
 namespace sensor {
 
similarity index 96%
rename from src/api/sensor_provider_internal.cpp
rename to src/api/sensor-provider.cpp
index 1563ac7..2ad2492 100644 (file)
  *
  */
 
-#include "sensor_provider_internal.h"
+#include "sensor-provider.h"
 
 #include <message.h>
 #include <channel.h>
 #include <sensor-log-private.h>
 #include <sensor-types-private.h>
-#include <sensor_utils.h>
-#include <command_types.h>
+#include <sensor-utils.h>
+#include <command-types.h>
 #include <cfloat>
 #include <cmath>
 
-#include "sensor_provider_channel_handler.h"
+#include "sensor-provider-channel-handler.h"
 
 #define DEFAULT_RESOLUTION 0.1
 
similarity index 89%
rename from src/api/sensor_provider_internal.h
rename to src/api/sensor-provider.h
index 4d49f58..606a5e3 100644 (file)
  *
  */
 
-#ifndef __SENSOR_PROVIDER_INTERNAL_H__
-#define __SENSOR_PROVIDER_INTERNAL_H__
+#ifndef __SENSOR_PROVIDER_H__
+#define __SENSOR_PROVIDER_H__
 
 #include <channel.h>
-#include <channel_handler.h>
-#include <event_loop.h>
+#include <channel-handler.h>
+#include <event-loop.h>
 #include <sensor-internal.h>
-#include <sensor_info.h>
+#include <sensor-info.h>
 #include <sensor-types-private.h>
 #include <map>
 #include <atomic>
@@ -72,4 +72,4 @@ private:
 
 }
 
-#endif /* __SENSOR_PROVIDER_INTERNAL_H__ */
+#endif /* __SENSOR_PROVIDER_H__ */
similarity index 98%
rename from src/api/sensor_reader.cpp
rename to src/api/sensor-reader.cpp
index aa0a5c9..a62248b 100644 (file)
@@ -17,7 +17,7 @@
  *
  */
 
-#include "sensor_reader.h"
+#include "sensor-reader.h"
 
 #include <sensor-log-private.h>
 #include <sensor-types-private.h>
similarity index 97%
rename from src/api/sensor_reader.h
rename to src/api/sensor-reader.h
index 010eb42..66b9561 100644 (file)
@@ -21,7 +21,7 @@
 #define __SENSOR_READER_H__
 
 #include <glib.h>
-#include <event_loop.h>
+#include <event-loop.h>
 
 #include <thread>
 #include <atomic>
similarity index 96%
rename from src/shared/channel_event_handler.cpp
rename to src/shared/channel-event-handler.cpp
index aeba1c3..c05228f 100644 (file)
  *
  */
 
-#include "channel_event_handler.h"
+#include "channel-event-handler.h"
 
 #include "channel.h"
-#include "channel_handler.h"
+#include "channel-handler.h"
 #include "sensor-log-private.h"
 
 using namespace ipc;
similarity index 96%
rename from src/shared/channel_event_handler.h
rename to src/shared/channel-event-handler.h
index 85a3efd..280dfdd 100644 (file)
@@ -22,8 +22,8 @@
 
 #include <unordered_map>
 
-#include "event_handler.h"
-#include "channel_handler.h"
+#include "event-handler.h"
+#include "channel-handler.h"
 
 namespace ipc {
 
index 26091f4..6308b48 100644 (file)
@@ -25,8 +25,8 @@
 #include <algorithm>
 
 #include "sensor-log-private.h"
-#include "channel_event_handler.h"
-#include "command_types.h"
+#include "channel-event-handler.h"
+#include "command-types.h"
 
 #define SYSTEMD_SOCK_BUF_SIZE (128*1024)
 
index 32a200c..017dc14 100644 (file)
@@ -26,8 +26,8 @@
 
 #include "socket.h"
 #include "message.h"
-#include "event_loop.h"
-#include "channel_handler.h"
+#include "event-loop.h"
+#include "channel-handler.h"
 #include "lock.h"
 
 namespace ipc {
similarity index 99%
rename from src/shared/command_types.h
rename to src/shared/command-types.h
index b5570c2..dc43cfd 100644 (file)
@@ -21,7 +21,7 @@
 #define __COMMAND_TYPES_H__
 
 #include <sensor-types-private.h>
-#include "sensor_info.h"
+#include <sensor-info.h>
 
 #define SENSOR_CHANNEL_PATH            "/run/.sensord.socket"
 #define MAX_BUF_SIZE (16*1024)
similarity index 98%
rename from src/shared/event_loop.cpp
rename to src/shared/event-loop.cpp
index 218295f..f8ea3e4 100644 (file)
@@ -17,7 +17,7 @@
  *
  */
 
-#include "event_loop.h"
+#include "event-loop.h"
 
 #include <stdio.h>
 #include <stdint.h>
@@ -29,9 +29,9 @@
 #include <vector>
 #include <queue>
 
-#include "channel_event_handler.h"
+#include "channel-event-handler.h"
 #include "sensor-log-private.h"
-#include "event_handler.h"
+#include "event-handler.h"
 #include "channel.h"
 
 #define BAD_HANDLE 0
similarity index 98%
rename from src/shared/event_loop.h
rename to src/shared/event-loop.h
index 6e560ff..fefc614 100644 (file)
@@ -25,7 +25,7 @@
 #include <atomic>
 #include <map>
 
-#include "event_handler.h"
+#include "event-handler.h"
 #include "lock.h"
 
 namespace ipc {
similarity index 99%
rename from src/shared/sensor_info.cpp
rename to src/shared/sensor-info.cpp
index 39f73ec..1e1ea2c 100644 (file)
  *
  */
 
-#include "sensor_info.h"
+#include "sensor-info.h"
 
 #include <sensor-types-private.h>
-#include <sensor_types_private.h>
 #include <sensor-log-private.h>
+#include <sensor-utils.h>
+
 #include <cfloat>
 #include <algorithm>
 #include <string>
 #include <cmath>
 
-#include "sensor_utils.h"
 
 #define MIN_RANGE -FLT_MAX
 #define MAX_RANGE FLT_MAX
similarity index 99%
rename from src/shared/sensor_utils.cpp
rename to src/shared/sensor-utils.cpp
index d86855f..5f8aae3 100644 (file)
@@ -17,7 +17,7 @@
  *
  */
 
-#include "sensor_utils.h"
+#include "sensor-utils.h"
 
 #include <glib.h>
 #include <unistd.h>
@@ -30,7 +30,6 @@
 
 #include <sensor-log-private.h>
 #include <sensor-types-private.h>
-#include <sensor_types_private.h>
 
 #ifndef PATH_MAX
 #define PATH_MAX 256
similarity index 99%
rename from src/shared/sensor_utils.h
rename to src/shared/sensor-utils.h
index 932619b..f460792 100644 (file)
@@ -20,8 +20,9 @@
 #ifndef __SENSOR_UTILS_H__
 #define __SENSOR_UTILS_H__
 
-#include <time.h>
 #include <sensor-types-private.h>
+
+#include <time.h>
 #include <string>
 #include <vector>
 
diff --git a/src/shared/sensor_types_private.h b/src/shared/sensor_types_private.h
deleted file mode 100644 (file)
index b76a6fe..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * sensord
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * 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 __SENSOR_TYPES_PRIVATE__
-#define __SENSOR_TYPES_PRIVATE__
-
-#define URI_REGEX(CATEGORY) R"~(^http:\/\/[\w-]+(\.[\w-]+)*\/)~" CATEGORY R"~(\/(general|healthinfo)\/[\w-]+(\.[\w-]+)*(\/[\w-]+(\.[\w-]+)*)$)~"
-#define SENSOR_URI_REGEX URI_REGEX("sensor")
-
-#define PREDEFINED_TYPE_URI "http://tizen.org/sensor/"
-
-#define PRIV_DELIMITER ";"
-#define URI_DELIMITER "/"
-
-#define PRIVILEGE_HEALTHINFO_STR "healthinfo"
-#define PRIVILEGE_HEALTHINFO_URI "http://tizen.org/privilege/healthinfo"
-
-#define PRIVILEGE_LOCATION_STR "location"
-#define PRIVILEGE_LOCATION_URI "http://tizen.org/privilege/location"
-
-#define PRIVILEGE_PLATFORM_STR "platform"
-#define PRIVILEGE_PLATFORM_URI "http://tizen.org/privilege/internal/default/platform"
-
-#define URI_PRIV_INDEX 4
-#define URI_SENSOR_TYPE_INDEX 5
-
-#endif /* __SENSOR_TYPES_PRIVATE__ */