dump.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* vi: set sw=4 ts=4: */
  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. enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
  16. typedef struct _pr {
  17. struct _pr *nextpr; /* next print unit */
  18. unsigned int flags; /* flag values */
  19. int bcnt; /* byte count */
  20. char *cchar; /* conversion character */
  21. char *fmt; /* printf format */
  22. char *nospace; /* no whitespace version */
  23. } PR;
  24. typedef struct _fu {
  25. struct _fu *nextfu; /* next format unit */
  26. struct _pr *nextpr; /* next print unit */
  27. unsigned int flags; /* flag values */
  28. int reps; /* repetition count */
  29. int bcnt; /* byte count */
  30. char *fmt; /* format string */
  31. } FU;
  32. typedef struct _fs { /* format strings */
  33. struct _fs *nextfs; /* linked list of format strings */
  34. struct _fu *nextfu; /* linked list of format units */
  35. int bcnt;
  36. } FS;
  37. extern void bb_dump_add(const char *fmt);
  38. extern int bb_dump_dump(char **argv);
  39. extern int bb_dump_size(FS * fs);
  40. extern FS *bb_dump_fshead; /* head of format strings */
  41. extern int bb_dump_blocksize; /* data block size */
  42. extern int bb_dump_length; /* max bytes to read */
  43. extern enum _vflag bb_dump_vflag;
  44. extern off_t bb_dump_skip; /* bytes to skip */