diff options
author | leo <leo@brix.(none)> | 2008-02-20 10:46:51 +0000 |
---|---|---|
committer | leo <leo@brix.(none)> | 2008-02-20 10:46:51 +0000 |
commit | ea13c2400fe58824b6b8e1b9b9b5d487262bd492 (patch) | |
tree | ea07a0b0d6025374af525d23be9b64ab8f6fc306 /gsmdecode/src/common.h | |
parent | 92ac2847d24871bb30ffaa1ca3573c86fd42b5b5 (diff) |
initial
Diffstat (limited to 'gsmdecode/src/common.h')
-rw-r--r-- | gsmdecode/src/common.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gsmdecode/src/common.h b/gsmdecode/src/common.h new file mode 100644 index 0000000..8a3ae2e --- /dev/null +++ b/gsmdecode/src/common.h @@ -0,0 +1,47 @@ +#ifndef __GSMSP_COMMON_H__ +#define __GSMSP_COMMON_H__ 1 + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <unistd.h> + +#define MIN(a,b) ((a)<(b)?(a):(b)) +#define MAX(a,b) ((a)>(b)?(a):(b)) + +/* DISABLE me for release build. Otherwise with debug output. */ +//#define GSMSP_DEBUG 1 + +#ifdef GSMSP_DEBUG +# define DEBUGF(a...) do { \ + fprintf(stderr, "DEBUG %s:%d ", __func__, __LINE__); \ + fprintf(stderr, a); \ +} while (0) +#else +# define DEBUGF(a...) +#endif + +# define HEXDUMPF(data, len, a...) do { \ + printf("HEX %s:%d ", __func__, __LINE__); \ + printf(a); \ + hexdump(data, len); \ +} while (0) + +void hexdump(const unsigned char *data, size_t len); + +struct _opt +{ + char format; + char flags; +}; + +#define MSG_FORMAT_BBIS (1) +#define MSG_FORMAT_B (2) +#define MSG_FORMAT_XML (3) + +#define FL_MOTOROLA (0x01) + +#endif /* !__GSMSP_COMMON_H__ */ + + |