aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2019-05-18 15:37:19 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2019-05-18 15:37:19 +0000
commit3e030c2951bee369b5593243bf317bb5a482a35b (patch)
tree0fc4dff2af1d3ff6f635877879b2c8ec8e6eb1f1 /include
parentc80acc95be9d1463830259db821ac248e7dc7e46 (diff)
downloadsg3_utils-3e030c2951bee369b5593243bf317bb5a482a35b.tar.gz
sg_lib: add sg_f2hex_arr()
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@824 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r--include/sg_lib.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sg_lib.h b/include/sg_lib.h
index 80c536c1..ff162a61 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -569,6 +569,15 @@ void hex2stderr(const uint8_t * b_str, int len, int no_ascii);
int hex2str(const uint8_t * b_str, int len, const char * leadin, int format,
int cb_len, char * cbp);
+/* Read ASCII hex bytes or binary from fname (a file named '-' taken as
+ * stdin). If reading ASCII hex then there should be either one entry per
+ * line or a comma, space or tab separated list of bytes. If no_space is
+ * set then a string of ACSII hex digits is expected, 2 per byte. Everything
+ * from and including a '#' on a line is ignored. Returns 0 if ok, or an
+ * error code. */
+int sg_f2hex_arr(const char * fname, bool as_binary, bool no_space,
+ uint8_t * mp_arr, int * mp_arr_len, int max_arr_len);
+
/* Returns true when executed on big endian machine; else returns false.
* Useful for displaying ATA identify words (which need swapping on a
* big endian machine). */