--- /dev/null
+cscope.files
+cscope.out
+tags
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(uuid)
-BuildRequires: pkgconfig(libsyscommon)
BuildRequires: glibc-devel-static
Requires: security-config
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")
#include <stdio.h>
#include <stdbool.h>
#include <getopt.h>
-#include <libsyscommon/list.h>
+#include <glib.h>
#include "system-info-tool.h"
#include "system-info-tool-get.h"
#include "system-info-tool-set.h"
break;
switch (opt) {
case 'g':
- SYS_G_LIST_APPEND(keys, strdup(optarg));
+ SYSINFO_G_LIST_APPEND(keys, strdup(optarg));
break;
case 'v':
verbose = true;
}
}
- SYS_G_LIST_FOREACH(keys, elem, key) {
+ SYSINFO_G_LIST_FOREACH(keys, elem, key) {
system_info_tool_get(key, verbose);
free(key);
}
#include <unistd.h>
#include <stdlib.h>
+#include <glib.h>
#include <system_info.h>
#include <system_info_type.h>
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