blob: e8a96ef874846a4adf17e47f602bd78a24e03ce6 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath55b2ded2001-11-02 11:40:44 +00002#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
16enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
17
18typedef 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
27typedef 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
36typedef 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
Manuel Novoa III cad53642003-03-19 09:13:01 +000042extern void bb_dump_add(const char *fmt);
43extern int bb_dump_dump (char **argv);
44extern int bb_dump_size(FS * fs);
45
46extern FS *bb_dump_fshead; /* head of format strings */
47extern int bb_dump_blocksize; /* data block size */
48extern int bb_dump_length; /* max bytes to read */
49extern enum _vflag bb_dump_vflag;
50extern off_t bb_dump_skip; /* bytes to skip */