[1765] | 1 | /* vi: set sw=4 ts=4: */
|
---|
[821] | 2 | #define F_IGNORE 0x01 /* %_A */
|
---|
| 3 | #define F_SETREP 0x02 /* rep count set, not default */
|
---|
| 4 | #define F_ADDRESS 0x001 /* print offset */
|
---|
| 5 | #define F_BPAD 0x002 /* blank pad */
|
---|
| 6 | #define F_C 0x004 /* %_c */
|
---|
| 7 | #define F_CHAR 0x008 /* %c */
|
---|
| 8 | #define F_DBL 0x010 /* %[EefGf] */
|
---|
| 9 | #define F_INT 0x020 /* %[di] */
|
---|
| 10 | #define F_P 0x040 /* %_p */
|
---|
| 11 | #define F_STR 0x080 /* %s */
|
---|
| 12 | #define F_U 0x100 /* %_u */
|
---|
| 13 | #define F_UINT 0x200 /* %[ouXx] */
|
---|
| 14 | #define F_TEXT 0x400 /* no conversions */
|
---|
| 15 |
|
---|
| 16 | enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
|
---|
| 17 |
|
---|
| 18 | typedef struct _pr {
|
---|
| 19 | struct _pr *nextpr; /* next print unit */
|
---|
| 20 | unsigned int flags; /* flag values */
|
---|
| 21 | int bcnt; /* byte count */
|
---|
| 22 | char *cchar; /* conversion character */
|
---|
| 23 | char *fmt; /* printf format */
|
---|
| 24 | char *nospace; /* no whitespace version */
|
---|
| 25 | } PR;
|
---|
| 26 |
|
---|
| 27 | typedef struct _fu {
|
---|
| 28 | struct _fu *nextfu; /* next format unit */
|
---|
| 29 | struct _pr *nextpr; /* next print unit */
|
---|
| 30 | unsigned int flags; /* flag values */
|
---|
| 31 | int reps; /* repetition count */
|
---|
| 32 | int bcnt; /* byte count */
|
---|
| 33 | char *fmt; /* format string */
|
---|
| 34 | } FU;
|
---|
| 35 |
|
---|
| 36 | typedef struct _fs { /* format strings */
|
---|
| 37 | struct _fs *nextfs; /* linked list of format strings */
|
---|
| 38 | struct _fu *nextfu; /* linked list of format units */
|
---|
| 39 | int bcnt;
|
---|
| 40 | } FS;
|
---|
| 41 |
|
---|
| 42 | extern void bb_dump_add(const char *fmt);
|
---|
[1765] | 43 | extern int bb_dump_dump(char **argv);
|
---|
[821] | 44 | extern int bb_dump_size(FS * fs);
|
---|
| 45 |
|
---|
| 46 | extern FS *bb_dump_fshead; /* head of format strings */
|
---|
| 47 | extern int bb_dump_blocksize; /* data block size */
|
---|
| 48 | extern int bb_dump_length; /* max bytes to read */
|
---|
| 49 | extern enum _vflag bb_dump_vflag;
|
---|
| 50 | extern off_t bb_dump_skip; /* bytes to skip */
|
---|