From 6b32eacd43ada71e267506e510db11e8988cc7dc Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Thu, 3 Feb 2022 02:38:23 +0000 Subject: sg_rep_zones: add --brief option and --find ZT option; sg_modes: improve handling of zbc disks with pdt=0x14 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@935 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- include/sg_lib.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/sg_lib.h b/include/sg_lib.h index 38aa0011..16e6fc15 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -71,7 +71,7 @@ extern "C" { * So squeeze two PDTs into one integer. Use sg_pdt_s_eq() to compare. * N.B. Must not use PDT_DISK as upper */ #define PDT_DISK_ZBC (PDT_DISK | (PDT_ZBC << 8)) -#define PDT_ALL (-1) /* for common to all PDTs */ +#define PDT_ALL (-1) /* for common to all PDTs */ #define PDT_LOWER_MASK 0xff #define PDT_UPPER_MASK (~PDT_LOWER_MASK) @@ -515,7 +515,7 @@ bool sg_exit2str(int exit_status, bool longer, int b_len, char * b); /* for 33 see SG_LIB_CAT_TIMEOUT below */ #define SG_LIB_WINDOWS_ERR 34 /* Windows error number don't fit in 7 bits so * map to a single value for exit statuses */ -#define SG_LIB_TRANSPORT_ERROR 35 /* driver or interconnect */ +#define SG_LIB_TRANSPORT_ERROR 35 /* driver or interconnect */ #define SG_LIB_OK_FALSE 36 /* no error, reporting false (cf. no error, * reporting true is SG_LIB_OK_TRUE(0) ) */ #define SG_LIB_CAT_PROTECTION 40 /* subset of aborted command (for PI, DIF) @@ -612,19 +612,22 @@ void dStrHexFp(const char* str, int len, int no_ascii, FILE * fp); * starts with 'leadin' (NULL for no leadin) and there are 16 bytes * per line with an extra space between the 8th and 9th bytes. 'format' * is 0 for repeat in printable ASCII ('.' for non printable chars) to - * right of each line; 1 don't (so just output ASCII hex). Returns - * number of bytes written to 'b' excluding the trailing '\0'. */ + * right of each line; 1 don't (so just output ASCII hex). Note that + * an address is not printed on each line preceding the hex data. Returns + * number of bytes written to 'b' excluding the trailing '\0'. + * The only difference between dStrHexStr() and hex2str() is the type of + * the first argument. */ int dStrHexStr(const char * str, int len, const char * leadin, int format, int cb_len, char * cbp); +int hex2str(const uint8_t * b_str, int len, const char * leadin, int format, + int cb_len, char * cbp); -/* The following 3 functions are equivalent to dStrHex(), dStrHexErr() and - * dStrHexStr() respectively. The difference is the type of the first of - * argument: uint8_t instead of char. The name of the argument is changed - * to b_str to stress it is a pointer to the start of a binary string. */ +/* The following 2 functions are equivalent to dStrHex() and dStrHexErr() + * respectively. The difference is only the type of the first of argument: + * uint8_t instead of char. The name of the argument is changed to b_str to + * stress it is a pointer to the start of a binary string. */ void hex2stdout(const uint8_t * b_str, int len, int no_ascii); 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 -- cgit v1.2.3