From 0e09704e09d9feb33cd062e3d1b4e2f992d23094 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 26 Apr 2016 00:08:16 +0000 Subject: [PATCH] Move definition of struct xlat to a separate header file 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 | 1 + defs.h | 7 +------ xlat.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 xlat.h diff --git a/Makefile.am b/Makefile.am index 2f595cb4..f02a4211 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 0b5f9f9c..e345fd94 100644 --- 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 index 00000000..28f74027 --- /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 -- 2.40.0