Glenn L McGrath | 55b2ded | 2001-11-02 11:40:44 +0000 | [diff] [blame] | 1 | #define F_IGNORE 0x01 /* %_A */ |
| 2 | #define F_SETREP 0x02 /* rep count set, not default */ |
| 3 | #define F_ADDRESS 0x001 /* print offset */ |
| 4 | #define F_BPAD 0x002 /* blank pad */ |
| 5 | #define F_C 0x004 /* %_c */ |
| 6 | #define F_CHAR 0x008 /* %c */ |
| 7 | #define F_DBL 0x010 /* %[EefGf] */ |
| 8 | #define F_INT 0x020 /* %[di] */ |
| 9 | #define F_P 0x040 /* %_p */ |
| 10 | #define F_STR 0x080 /* %s */ |
| 11 | #define F_U 0x100 /* %_u */ |
| 12 | #define F_UINT 0x200 /* %[ouXx] */ |
| 13 | #define F_TEXT 0x400 /* no conversions */ |
| 14 | |
| 15 | enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */ |
| 16 | |
| 17 | typedef struct _pr { |
| 18 | struct _pr *nextpr; /* next print unit */ |
| 19 | unsigned int flags; /* flag values */ |
| 20 | int bcnt; /* byte count */ |
| 21 | char *cchar; /* conversion character */ |
| 22 | char *fmt; /* printf format */ |
| 23 | char *nospace; /* no whitespace version */ |
| 24 | } PR; |
| 25 | |
| 26 | typedef struct _fu { |
| 27 | struct _fu *nextfu; /* next format unit */ |
| 28 | struct _pr *nextpr; /* next print unit */ |
| 29 | unsigned int flags; /* flag values */ |
| 30 | int reps; /* repetition count */ |
| 31 | int bcnt; /* byte count */ |
| 32 | char *fmt; /* format string */ |
| 33 | } FU; |
| 34 | |
| 35 | typedef struct _fs { /* format strings */ |
| 36 | struct _fs *nextfs; /* linked list of format strings */ |
| 37 | struct _fu *nextfu; /* linked list of format units */ |
| 38 | int bcnt; |
| 39 | } FS; |
| 40 | |
| 41 | void add(char *fmt); |
| 42 | int dump (char **argv); |