]> granicus.if.org Git - strace/commitdiff
Move definition of struct xlat to a separate header file
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Apr 2016 00:08:16 +0000 (00:08 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Apr 2016 00:08:16 +0000 (00:08 +0000)
Define struct xlat in a separate file so that it could be used later by
tests without inclusion of defs.h header file.

* defs.h (struct xlat, XLAT, XLAT_END): Move ...
* xlat.h: ... here.
* Makefile.am (strace_SOURCES): Add xlat.h.

Makefile.am
defs.h
xlat.h [new file with mode: 0644]

index 2f595cb4dd7f882fce398ef1c7105b1e03c6cdba..f02a42113a3b80ab5a7fcd5abf8e81d555849115 100644 (file)
@@ -214,6 +214,7 @@ strace_SOURCES =    \
        vsprintf.c      \
        wait.c          \
        xattr.c         \
+       xlat.h          \
        xmalloc.c       \
        # end of strace_SOURCES
 
diff --git a/defs.h b/defs.h
index 0b5f9f9c2d468d69d4da4c1497f97f8023906646..e345fd948a7126a5a01e70d653b7b458f9ab2be9 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -360,12 +360,7 @@ typedef uint8_t qualbits_t;
 #define abbrev(tcp)    ((tcp)->qual_flg & QUAL_ABBREV)
 #define filtered(tcp)  ((tcp)->flags & TCB_FILTERED)
 
-struct xlat {
-       unsigned int val;
-       const char *str;
-};
-#define XLAT(x) { x, #x }
-#define XLAT_END { 0, NULL }
+#include "xlat.h"
 
 extern const struct xlat addrfams[];
 extern const struct xlat at_flags[];
diff --git a/xlat.h b/xlat.h
new file mode 100644 (file)
index 0000000..28f7402
--- /dev/null
+++ b/xlat.h
@@ -0,0 +1,11 @@
+#ifndef STRACE_XLAT_H
+
+struct xlat {
+       unsigned int val;
+       const char *str;
+};
+
+# define XLAT(x) { x, #x }
+# define XLAT_END { 0, 0 }
+
+#endif