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.
This commit is contained in:
Дмитрий Левин 2016-04-26 00:08:16 +00:00
parent a6acc310d7
commit 0e09704e09
3 changed files with 13 additions and 6 deletions

View File

@ -214,6 +214,7 @@ strace_SOURCES = \
vsprintf.c \
wait.c \
xattr.c \
xlat.h \
xmalloc.c \
# end of strace_SOURCES

7
defs.h
View File

@ -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[];

11
xlat.h Normal file
View File

@ -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