print_binary.h 651 B

12345678910111213141516171819202122232425262728
  1. #ifndef PERF_PRINT_BINARY_H
  2. #define PERF_PRINT_BINARY_H
  3. #include <stddef.h>
  4. enum binary_printer_ops {
  5. BINARY_PRINT_DATA_BEGIN,
  6. BINARY_PRINT_LINE_BEGIN,
  7. BINARY_PRINT_ADDR,
  8. BINARY_PRINT_NUM_DATA,
  9. BINARY_PRINT_NUM_PAD,
  10. BINARY_PRINT_SEP,
  11. BINARY_PRINT_CHAR_DATA,
  12. BINARY_PRINT_CHAR_PAD,
  13. BINARY_PRINT_LINE_END,
  14. BINARY_PRINT_DATA_END,
  15. };
  16. typedef void (*print_binary_t)(enum binary_printer_ops op,
  17. unsigned int val, void *extra);
  18. void print_binary(unsigned char *data, size_t len,
  19. size_t bytes_per_line, print_binary_t printer,
  20. void *extra);
  21. int is_printable_array(char *p, unsigned int len);
  22. #endif /* PERF_PRINT_BINARY_H */