/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctype.h>
#include <libdiskstatus.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "ds_impl.h"
/*PRINTFLIKE1*/
void
{
if (!ds_debug)
return;
}
void
{
int byte_count;
int i;
char *linep;
if (!ds_debug)
return;
/*
* Inner loop processes 16 bytes at a time, or less
* if we have less than 16 bytes to go
*/
(unsigned char) start[byte_count + i]);
if (bufleft >= 2) {
if (i == 7)
*linep = '-';
else
*linep = ' ';
--bufleft;
++linep;
}
}
/*
* If i is less than 16, then we had less than 16 bytes
* written to the output. We need to fixup the alignment
* to allow the "text" output to be aligned
*/
if (i < 16) {
while (numspaces-- > 0) {
if (bufleft >= 2) {
*linep = ' ';
--bufleft;
linep++;
}
}
}
if (bufleft >= 2) {
*linep = ' ';
--bufleft;
++linep;
}
if (bufleft >= 2) {
--bufleft;
++linep;
}
}
}
}
const char *
{
switch (error) {
case EDS_NOMEM:
return ("memory allocation failure");
case EDS_CANT_OPEN:
return ("failed to open device");
case EDS_NO_TRANSPORT:
return ("no supported communication protocol");
case EDS_NOT_SUPPORTED:
return ("disk status information not supported");
case EDS_NOT_SIMULATOR:
return ("not a valid simulator file");
case EDS_IO:
return ("I/O error from device");
default:
return ("unknown error");
}
}
int
{
return (-1);
}