From 2c2a1e7373ec66bf268ac787349d78c2af462851 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Fri, 29 May 2015 14:17:01 +0200 Subject: [PATCH] Extract macro PKGMGR_LIST_MOVE_NODE_TO_HEAD to separate header Change-Id: I630a4b554196fd3dee5a5ac59c69e64a3784a659 --- src/common/security_registration.cc | 9 +-------- src/common/step/step_generate_xml.cc | 5 +---- src/utils/clist_helpers.h | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 src/utils/clist_helpers.h diff --git a/src/common/security_registration.cc b/src/common/security_registration.cc index 1660829..6d0c718 100644 --- a/src/common/security_registration.cc +++ b/src/common/security_registration.cc @@ -6,16 +6,9 @@ #include +#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 { diff --git a/src/common/step/step_generate_xml.cc b/src/common/step/step_generate_xml.cc index 7492ab9..a5508c6 100755 --- a/src/common/step/step_generate_xml.cc +++ b/src/common/step/step_generate_xml.cc @@ -16,12 +16,9 @@ #include #include +#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 index 0000000..ce7abc3 --- /dev/null +++ b/src/utils/clist_helpers.h @@ -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_ -- 2.7.4