heart: Remove interdependence between heart and logging 80/320480/6
authorUnsung Lee <unsung.lee@samsung.com>
Wed, 13 Nov 2024 11:57:11 +0000 (20:57 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Mon, 25 Nov 2024 02:34:23 +0000 (11:34 +0900)
Remove interdependent between heart and logging by preventing
logging from directly referencing the heart module.
Previously, heart.c includes logging.h and logging.c includes heart.h.

Change-Id: I7ecba8fc57fdbb03786fd7102b4b2c0f39591265
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-monitor/heart-path.h [new file with mode: 0644]
src/resource-monitor/heart.h
src/resource-monitor/logging.c

diff --git a/src/resource-monitor/heart-path.h b/src/resource-monitor/heart-path.h
new file mode 100644 (file)
index 0000000..4c51073
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+ * resourced
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+/**
+ * @file heart-path.h
+ * @desc definition of heart path
+ **/
+
+#ifndef __HEART_PATH_H__
+#define __HEART_PATH_H__
+
+#include "resourced.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define HEART_CONF_FILE_PATH           RD_CONFIG_FILE(monitor)
+#define HEART_FILE_PATH                        RD_SYS_DATA"/heart"
+#define HEART_USER_FILE_PATH           "%s/data/heart"
+
+#endif /*__HEART_PATH_H__*/
index ecf8087fbce5b85aa129c422dda394a23670218f..e1c4e2a959175e849b8670615a6a3516faabc48a 100644 (file)
 #include <time.h>
 
 #include "dbus-handler.h"
+#include "heart-path.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-#define HEART_CONF_FILE_PATH           RD_CONFIG_FILE(monitor)
-#define HEART_FILE_PATH                                RD_SYS_DATA"/heart"
-#define HEART_USER_FILE_PATH           "%s/data/heart"
 #define HEART_CONF_SECTION                     "HEART"
 
 #define MEM_NAME                                       "memory"
index 0d29712024329d1ab362c3e302a216c42809e442..104587cfc86cb5311be4fea90b550fbe8f5496bb 100644 (file)
 #include <assert.h>
 
 #include "trace.h"
-#include "heart.h"
 #include "logging.h"
 #include "resourced.h"
 #include "macro.h"
 #include "notifier.h"
 #include "userinfo-list.h"
+#include "heart-path.h"
 
 #define MAX_STRLEN(a,b) (sizeof a > sizeof b ? sizeof a : sizeof b)
 #define LOGGING_BUF_MAX                        (PATH_MAX + MAX_STRLEN(USER_DEFAULT_DB_NAME, USER_OWN_DB_NAME))