dump.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* vi: set sw=4 ts=4: */
  2. PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
  3. enum dump_vflag_t { ALL, DUP, FIRST, WAIT }; /* -v values */
  4. typedef struct PR {
  5. struct PR *nextpr; /* next print unit */
  6. unsigned flags; /* flag values */
  7. int bcnt; /* byte count */
  8. char *cchar; /* conversion character */
  9. char *fmt; /* printf format */
  10. char *nospace; /* no whitespace version */
  11. } PR;
  12. typedef struct FU {
  13. struct FU *nextfu; /* next format unit */
  14. struct PR *nextpr; /* next print unit */
  15. unsigned flags; /* flag values */
  16. int reps; /* repetition count */
  17. int bcnt; /* byte count */
  18. char *fmt; /* format string */
  19. } FU;
  20. typedef struct FS { /* format strings */
  21. struct FS *nextfs; /* linked list of format strings */
  22. struct FU *nextfu; /* linked list of format units */
  23. int bcnt;
  24. } FS;
  25. typedef struct dumper_t {
  26. off_t dump_skip; /* bytes to skip */
  27. int dump_length; /* max bytes to read */
  28. smallint dump_vflag; /*enum dump_vflag_t*/
  29. FS *fshead;
  30. const char *xxd_eofstring;
  31. off_t address; /* address/offset in stream */
  32. long long xxd_displayoff;
  33. } dumper_t;
  34. dumper_t* alloc_dumper(void) FAST_FUNC;
  35. extern void bb_dump_add(dumper_t *dumper, const char *fmt) FAST_FUNC;
  36. extern int bb_dump_dump(dumper_t *dumper, char **argv) FAST_FUNC;
  37. POP_SAVED_FUNCTION_VISIBILITY