[REFACTOR] rename features_data.h
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 24 Jun 2013 12:32:47 +0000 (16:32 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 24 Jun 2013 12:32:47 +0000 (16:32 +0400)
features_data.h --> features_data.c

ks_features/features_data.c [moved from ks_features/features_data.h with 89% similarity]
ks_features/ks_features.c

similarity index 89%
rename from ks_features/features_data.h
rename to ks_features/features_data.c
index 5fe0e14..d2ab7f6 100644 (file)
@@ -1,8 +1,10 @@
-#ifndef _FEATURES_DATA_H
-#define _FEATURES_DATA_H
-
 #include "syscall_list.h"
 
+struct feature {
+       size_t cnt;
+       enum syscall_id *feature_list;
+};
+
 #define X(x) id_##x
 enum syscall_id {
        SYSCALL_LIST
@@ -223,4 +225,21 @@ static enum syscall_id id_desc[] = {
        id_sys_setns
 };
 
-#endif /* _FEATURES_DATA_H */
+#define CREATE_FEATURE(x)                                      \
+{                                                              \
+       .cnt = sizeof(x) / sizeof(enum syscall_id),             \
+       .feature_list = x                                       \
+}
+
+static struct feature features[] = {
+       CREATE_FEATURE(id_file),
+       CREATE_FEATURE(id_irq),
+       CREATE_FEATURE(id_net),
+       CREATE_FEATURE(id_process),
+       CREATE_FEATURE(id_signal),
+       CREATE_FEATURE(id_desc)
+};
+
+enum {
+       feature_cnt = sizeof(features) / sizeof(struct feature)
+};
index 4b5e832..379821a 100644 (file)
@@ -3,22 +3,16 @@
 #include <ksyms.h>
 #include <dbi_kprobes.h>
 #include "ks_features.h"
-#include "features_data.h"
 #include "syscall_list.h"
+#include "features_data.c"
 
 
-struct feature {
-       size_t cnt;
-       enum syscall_id *feature_list;
-};
-
 struct ks_probe {
        struct jprobe jp;
        struct kretprobe rp;
        int counter;
 };
 
-
 #define CREATE_JP(name)                                                \
 {                                                              \
        .entry = NULL,                                          \
@@ -31,13 +25,6 @@ struct ks_probe {
        .handler = NULL                                         \
 }
 
-#define CREATE_FEATURE(x)                                      \
-{                                                              \
-       .cnt = sizeof(x) / sizeof(enum syscall_id),             \
-       .feature_list = x                                       \
-}
-
-
 #define X(x) #x
 static const char *const syscall_name[] = {
        SYSCALL_LIST
@@ -62,20 +49,6 @@ static struct ks_probe ksp[] = {
 #undef X
 
 
-static struct feature features[] = {
-       CREATE_FEATURE(id_file),
-       CREATE_FEATURE(id_irq),
-       CREATE_FEATURE(id_net),
-       CREATE_FEATURE(id_process),
-       CREATE_FEATURE(id_signal),
-       CREATE_FEATURE(id_desc)
-};
-
-enum {
-       feature_cnt = sizeof(features) / sizeof(struct feature)
-};
-
-
 static char *get_sys_name(size_t id)
 {
        return syscall_name[id];