From: Tomasz Iwanek Date: Fri, 29 May 2015 12:17:01 +0000 (+0200) Subject: Extract macro PKGMGR_LIST_MOVE_NODE_TO_HEAD to separate header X-Git-Tag: accepted/tizen/mobile/20150618.040522~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F14%2F41414%2F1;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Extract macro PKGMGR_LIST_MOVE_NODE_TO_HEAD to separate header Change-Id: I630a4b554196fd3dee5a5ac59c69e64a3784a659 --- 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_