-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlibxa1dump.h
More file actions
52 lines (45 loc) · 1.72 KB
/
libxa1dump.h
File metadata and controls
52 lines (45 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* libxa1dump.h
* This file is part of mpegparse.
*
* Copyright (C) 2011 - SmartJog S.A.S.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _LIBXA1_DUMP_H_
#define _LIBXA1_DUMP_H_
#include <unistd.h>
#define xa1_dump(x) xa1_dump_size((char *) x, sizeof(x))
#define xa1_dumpa(a,x) \
do { \
printf ("%08x ", a); \
xa1_dump(x); \
} while (0)
#define xa1_printf(t, b) _xa1_printf_size (t, #t ": ", b, sizeof(b));
#define xa1_printf_size(t, b, s) _xa1_printf_size(t, #t ": ", b, s)
#define _xa1_printf_size(t, h, b, s) \
do { \
char __p[256]; \
xa1_##t##sprintf(b, __p, s); \
printf("%s%s\n", h, __p); \
} while (0)
#define xa1_HEXsprintf(...) xa1_hsprintf(__VA_ARGS__)
#define xa1_BINsprintf(...) xa1_bsprintf(__VA_ARGS__)
#define xa1_ASCsprintf(...) xa1_asprintf(__VA_ARGS__)
void xa1_dump_size (char *buf, size_t bufsiz);
char *xa1_bsprintf(char *p, char *op, size_t bufsiz);
char *xa1_hsprintf(char *p, char *op, size_t bufsiz);
char *xa1_asprintf(char *p, char *op, size_t bufsiz);
#endif /* _LIBXA1_DUMP_H_ */