dump.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. const char *eofstring;
  30. FS *fshead;
  31. } dumper_t;
  32. dumper_t* alloc_dumper(void) FAST_FUNC;
  33. extern void bb_dump_add(dumper_t *dumper, const char *fmt) FAST_FUNC;
  34. extern int bb_dump_dump(dumper_t *dumper, char **argv) FAST_FUNC;
  35. POP_SAVED_FUNCTION_VISIBILITY