dump.h 1.6 KB

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