Introduced burn_drive_enumerator_t to allow more complete sg-freebsd implementation

This commit is contained in:
2006-10-14 12:24:03 +00:00
parent 6ad8e2e251
commit 0710bbb4fb
5 changed files with 68 additions and 17 deletions

View File

@ -121,18 +121,25 @@ int sg_handle_busy_device(char *fname, int os_errno)
/* ts A60922 ticket 33 */
/** Returns the next index number and the next enumerated drive address.
@param idx An opaque number handle. Make no own theories about it.
@param idx An opaque handle. Make no own theories about it.
@param adr Takes the reply
@param adr_size Gives maximum size of reply including final 0
@param initialize 1 = start new, 0 = continue, use no other values for now
@param initialize 1 = start new,
0 = continue, use no other values for now
-1 = finish
@return 1 = reply is a valid address , 0 = no further address available
-1 = severe error (e.g. adr_size too small)
*/
int sg_give_next_adr(int *idx, char adr[], int adr_size, int initialize)
int sg_give_next_adr(burn_drive_enumerator_t *idx,
char adr[], int adr_size, int initialize)
{
/* sg.h : typedef int burn_drive_enumerator_t; */
static int sg_limit = 32, ata_limit = 26;
int baseno = 0;
if (initialize == -1)
return 0;
if (initialize == 1)
*idx = -1;
(*idx)++;