"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Denis Vlasenko | 98636eb | 2008-05-09 17:59:34 +0000 | [diff] [blame] | 2 | |
| 3 | #if __GNUC_PREREQ(4,1) |
| 4 | # pragma GCC visibility push(hidden) |
| 5 | #endif |
| 6 | |
Glenn L McGrath | 55b2ded | 2001-11-02 11:40:44 +0000 | [diff] [blame] | 7 | #define F_IGNORE 0x01 /* %_A */ |
| 8 | #define F_SETREP 0x02 /* rep count set, not default */ |
| 9 | #define F_ADDRESS 0x001 /* print offset */ |
| 10 | #define F_BPAD 0x002 /* blank pad */ |
| 11 | #define F_C 0x004 /* %_c */ |
| 12 | #define F_CHAR 0x008 /* %c */ |
| 13 | #define F_DBL 0x010 /* %[EefGf] */ |
| 14 | #define F_INT 0x020 /* %[di] */ |
| 15 | #define F_P 0x040 /* %_p */ |
| 16 | #define F_STR 0x080 /* %s */ |
| 17 | #define F_U 0x100 /* %_u */ |
| 18 | #define F_UINT 0x200 /* %[ouXx] */ |
| 19 | #define F_TEXT 0x400 /* no conversions */ |
| 20 | |
| 21 | enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */ |
| 22 | |
| 23 | typedef struct _pr { |
| 24 | struct _pr *nextpr; /* next print unit */ |
| 25 | unsigned int flags; /* flag values */ |
| 26 | int bcnt; /* byte count */ |
| 27 | char *cchar; /* conversion character */ |
| 28 | char *fmt; /* printf format */ |
| 29 | char *nospace; /* no whitespace version */ |
| 30 | } PR; |
| 31 | |
| 32 | typedef struct _fu { |
| 33 | struct _fu *nextfu; /* next format unit */ |
| 34 | struct _pr *nextpr; /* next print unit */ |
| 35 | unsigned int flags; /* flag values */ |
| 36 | int reps; /* repetition count */ |
| 37 | int bcnt; /* byte count */ |
| 38 | char *fmt; /* format string */ |
| 39 | } FU; |
| 40 | |
| 41 | typedef struct _fs { /* format strings */ |
| 42 | struct _fs *nextfs; /* linked list of format strings */ |
| 43 | struct _fu *nextfu; /* linked list of format units */ |
| 44 | int bcnt; |
| 45 | } FS; |
| 46 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 47 | extern void bb_dump_add(const char *fmt); |
Denis Vlasenko | b97c984 | 2006-10-01 21:05:12 +0000 | [diff] [blame] | 48 | extern int bb_dump_dump(char **argv); |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 49 | extern int bb_dump_size(FS * fs); |
| 50 | |
| 51 | extern FS *bb_dump_fshead; /* head of format strings */ |
| 52 | extern int bb_dump_blocksize; /* data block size */ |
| 53 | extern int bb_dump_length; /* max bytes to read */ |
| 54 | extern enum _vflag bb_dump_vflag; |
| 55 | extern off_t bb_dump_skip; /* bytes to skip */ |
Denis Vlasenko | 98636eb | 2008-05-09 17:59:34 +0000 | [diff] [blame] | 56 | |
| 57 | #if __GNUC_PREREQ(4,1) |
| 58 | # pragma GCC visibility pop |
| 59 | #endif |