Extract macro PKGMGR_LIST_MOVE_NODE_TO_HEAD to separate header 14/41414/1
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 29 May 2015 12:17:01 +0000 (14:17 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Mon, 8 Jun 2015 11:26:50 +0000 (13:26 +0200)
Change-Id: I630a4b554196fd3dee5a5ac59c69e64a3784a659

src/common/security_registration.cc
src/common/step/step_generate_xml.cc
src/utils/clist_helpers.h [new file with mode: 0644]

index 1660829..6d0c718 100644 (file)
@@ -6,16 +6,9 @@
 
 #include <security-manager.h>
 
+#include "utils/clist_helpers.h"
 #include "utils/logging.h"
 
-/* NOTE: For *_x list types in pkgmgr-info, like privileges_x or privilege_x,
- * this macro moves the current node to the head of the list.
- * This LISTHEAD() macro is defined in pkgmgr_parser.h in pkgmgr-info package.
- */
-#define PKGMGR_LIST_MOVE_NODE_TO_HEAD(list, node) do {                        \
-    if (list) { LISTHEAD(list, node); }                                       \
-  } while (0)
-
 namespace bf = boost::filesystem;
 
 namespace {
index 7492ab9..a5508c6 100755 (executable)
 #include <cstring>
 #include <string>
 
+#include "utils/clist_helpers.h"
 #include "utils/file_util.h"
 
-#define PKGMGR_LIST_MOVE_NODE_TO_HEAD(list, node) do {                        \
-    if (list) { LISTHEAD(list, node); }                                       \
-  } while (0)
-
 namespace fs = boost::filesystem;
 
 namespace common_installer {
diff --git a/src/utils/clist_helpers.h b/src/utils/clist_helpers.h
new file mode 100644 (file)
index 0000000..ce7abc3
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef UTILS_CLIST_HELPERS_H_
+#define UTILS_CLIST_HELPERS_H_
+
+#include "pkgmgr/pkgmgr_parser.h"
+
+/* NOTE: For *_x list types in pkgmgr-info, like privileges_x or privilege_x,
+ * this macro moves the current node to the head of the list.
+ * This LISTHEAD() macro is defined in pkgmgr_parser.h in pkgmgr-info package.
+ */
+#define PKGMGR_LIST_MOVE_NODE_TO_HEAD(list, node)                              \
+  do {                                                                         \
+    if (list) {                                                                \
+      LISTHEAD(list, node);                                                    \
+    }                                                                          \
+  } while (0)                                                                  \
+
+#endif  // UTILS_CLIST_HELPERS_H_