File:  [Research Unix] / researchv10no / cmd / worm / oscsi / sony / shelfside.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include	<stdio.h>
#include	"../scsi.h"
#include	"../scsish.h"
#include	"fns.h"

int
shelfside(char *arg, char *err)
{
	char *oarg = arg;
	int shelf;

	if((*arg < '0') || (*arg > '9')){
usage:
		sprintf(err, "shelfside '%s' must be numa or numb", oarg);
		return(-1);
	}
	shelf = 0;
	while((*arg >= '0') && (*arg <= '9'))
		shelf = 10*shelf + *arg++ - '0';
	shelf <<= 1;
	if(*arg == 'a')
		;
	else if(*arg == 'b')
		shelf |= 1;
	else
		goto usage;
	if(*++arg)
		goto usage;
	return(shelf);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.