From: Hyotaek Shim Date: Wed, 13 Apr 2022 05:47:46 +0000 (+0900) Subject: Remove dependency to libsyscommon and add .gitignore X-Git-Tag: submit/tizen_6.5/20220426.081231^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a889a735b31c54997289e484603a8bb1e53da67b;p=platform%2Fcore%2Fapi%2Fsystem-info.git Remove dependency to libsyscommon and add .gitignore Change-Id: I7be05f4c6b225786fa9d66f9cbd5fa5c8b4a2bcf Signed-off-by: Hyotaek Shim Signed-off-by: Youngjae Cho (cherry picked from commit 680135fc0775f8111c853f6c25b1cbedd2c1a08c) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9306ae6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +cscope.files +cscope.out +tags diff --git a/packaging/capi-system-info.spec b/packaging/capi-system-info.spec index a87e88c..dcf60a3 100644 --- a/packaging/capi-system-info.spec +++ b/packaging/capi-system-info.spec @@ -14,7 +14,6 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(uuid) -BuildRequires: pkgconfig(libsyscommon) BuildRequires: glibc-devel-static Requires: security-config diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index 5f44875..ca950b4 100755 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(TOOL_REQUIRED REQUIRED libsyscommon) +PKG_CHECK_MODULES(TOOL_REQUIRED REQUIRED glib-2.0) SET(SYSTEM_INFO_TOOL "system-info-tool") FILE(GLOB SRCS "*.c") diff --git a/tool/system-info-tool.c b/tool/system-info-tool.c index 4f031ca..e1aaa91 100644 --- a/tool/system-info-tool.c +++ b/tool/system-info-tool.c @@ -1,8 +1,8 @@ #include #include #include -#include +#include #include "system-info-tool.h" #include "system-info-tool-get.h" #include "system-info-tool-set.h" @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) break; switch (opt) { case 'g': - SYS_G_LIST_APPEND(keys, strdup(optarg)); + SYSINFO_G_LIST_APPEND(keys, strdup(optarg)); break; case 'v': verbose = true; @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) } } - SYS_G_LIST_FOREACH(keys, elem, key) { + SYSINFO_G_LIST_FOREACH(keys, elem, key) { system_info_tool_get(key, verbose); free(key); } diff --git a/tool/system-info-tool.h b/tool/system-info-tool.h index ce8daa6..d8895b7 100644 --- a/tool/system-info-tool.h +++ b/tool/system-info-tool.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -78,4 +79,12 @@ system_info_type_e string_to_type(const char *type); void print_value(struct value value); int convert_raw_key(const char *key, char *buffer, int len); +#define SYSINFO_G_LIST_APPEND(a, b) \ + a = g_list_append(a, (gpointer)b) + +#define SYSINFO_G_LIST_FOREACH(head, elem, node) \ + for (elem = head, node = NULL; \ + elem && ((node = elem->data) != NULL); \ + elem = elem->next, node = NULL) + #endif