diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-08-07 02:22:53 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-08-07 02:22:53 +0000 |
commit | 23beedb782b58779546c58a7e9ef18aeccf50485 (patch) | |
tree | 9a98707784d48a4fa055b81f11b8d2135cdcb435 /include | |
parent | 640f7a7eff809159d9ac4c3ffc3681a6a5c3bede (diff) | |
download | sg3_utils-23beedb782b58779546c58a7e9ef18aeccf50485.tar.gz |
sg_inq+sg_vpd: more JSON work (tpc)
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@964 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.in | 1 | ||||
-rw-r--r-- | include/sg_lib.h | 19 |
2 files changed, 13 insertions, 7 deletions
diff --git a/include/Makefile.in b/include/Makefile.in index 6f2fa877..6067757a 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -206,6 +206,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETOPT_O_FILES = @GETOPT_O_FILES@ GREP = @GREP@ INSTALL = @INSTALL@ diff --git a/include/sg_lib.h b/include/sg_lib.h index 0e2d842c..1fc46d14 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -661,14 +661,19 @@ void hex2stderr(const uint8_t * b_str, int len, int no_ascii); /* 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, hyphen 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. If the error code is - * SG_LIB_LBA_OUT_OF_RANGE then mp_arr would be exceeded and both mp_arr - * and mp_arr_len are written to. */ + * line or a comma, space, hyphen 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. If the error code is SG_LIB_LBA_OUT_OF_RANGE then mp_arr + * would be exceeded and both mp_arr and mp_arr_len are written to. + * The max_arr_len_and argument may carry extra information: when it is + * negative its absolute value is used for the maximum number of bytes to + * write to mp_arr _and_ the first hexadecimal value on each line is skipped. + * Many hexadecimal output programs place a running address (index) as the + * first field on each line. When as_binary and/or no_space are true, the + * absolute value of max_arr_len_and is used. */ 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); + uint8_t * mp_arr, int * mp_arr_len, int max_arr_len_and); /* Returns true when executed on big endian machine; else returns false. * Useful for displaying ATA identify words (which need swapping on a |