aboutsummaryrefslogtreecommitdiff
path: root/include/hexdump.h
diff options
context:
space:
mode:
authorSimon Glass2021-05-08 07:00:04 -0600
committerTom Rini2021-06-08 11:39:09 -0400
commit735dd6ef89ebd3e05c1dfaef06aca61046503c63 (patch)
tree5c9bca4a0860d6d4ebfe1a242ec749129584df09 /include/hexdump.h
parent5d6d2b88389a99c9e20618593e64a9dd74862c8a (diff)
hexdump: Allow ctrl-c to interrupt output
If a long hexdump is initated the user may wish to interrupt it. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/hexdump.h')
-rw-r--r--include/hexdump.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/hexdump.h b/include/hexdump.h
index b75e26025a4..f2ca4793d69 100644
--- a/include/hexdump.h
+++ b/include/hexdump.h
@@ -125,6 +125,8 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize,
* @buf: data blob to dump
* @len: number of bytes in the @buf
* @ascii: include ASCII after the hex output
+ * Returns: 0 if finished normally, -EINTR if Ctrl-C was pressed, -ENOSYS if not
+ * supported
*
* Given a buffer of u8 data, print_hex_dump() prints a hex + ASCII dump
* to the stdio, with an optional leading prefix.
@@ -143,8 +145,8 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize,
* Example output using %DUMP_PREFIX_ADDRESS and 4-byte mode:
* ffffffff88089af0: 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~.
*/
-void print_hex_dump(const char *prefix_str, int prefix_type, int rowsize,
- int groupsize, const void *buf, size_t len, bool ascii);
+int print_hex_dump(const char *prefix_str, int prefix_type, int rowsize,
+ int groupsize, const void *buf, size_t len, bool ascii);
/**
* print_hex_dump_bytes - shorthand form of print_hex_dump() with default params