diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2019-12-27 18:18:48 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2019-12-27 18:18:48 +0000 |
commit | 660ac667940dc7bb188b4e2d0ec9c7f2dd444fc0 (patch) | |
tree | d8a0e36993244d7797f3ab593b0b1945980b8d23 /include | |
parent | 4b4f37348b25f04b6f2f898aeebc6f5246e56831 (diff) | |
download | sg3_utils-660ac667940dc7bb188b4e2d0ec9c7f2dd444fc0.tar.gz |
sg_lib: add sg_get_command_str() and sg_print_command_len(); sg_verify+sg_write_same: fix and --ff option; sg_dd+sgh_dd: add --verify support
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@837 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r-- | include/sg_lib.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sg_lib.h b/include/sg_lib.h index 169b0ea5..0b722069 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -378,9 +378,21 @@ extern FILE * sg_warnings_strm; void sg_set_warnings_strm(FILE * warnings_strm); +/* Given a SCSI command pointed to by cmdp of sz bytes this function forms a + * SCSI command in ASCII hex surrounded by square brackets in 'b'. 'b' is at + * least blen bytes long. If cmd_name is true then the command is prefixed + * by its SCSI command name (e.g. "VERIFY(10) [2f ...]". The command is + * shown as spaced separated pairs of hexadecimal digits (i.e. 0-9, a-f). + * Each pair repesents byte. The leftmost pair of digits is cmdp[0] . If + * sz <= 0 then this function tries to guess the length of the command. */ +char * +sg_get_command_str(const uint8_t * cmdp, int sz, bool cmd_name, int blen, + char * b); + /* The following "print" functions send ASCII to 'sg_warnings_strm' file * descriptor (default value is stderr). 'leadin' is string prepended to * each line printed out, NULL treated as "". */ +void sg_print_command_len(const uint8_t * command, int len); void sg_print_command(const uint8_t * command); void sg_print_scsi_status(int scsi_status); |