Annotation of researchv10dc/cmd/worm/scsi/sony/shelfside.c, revision 1.1.1.1

1.1       root        1: #include       <stdio.h>
                      2: #include       "../scsi.h"
                      3: #include       "../scsish.h"
                      4: #include       "../tcl.h"
                      5: #include       "fns.h"
                      6: 
                      7: int
                      8: shelfside(char *arg, char *err)
                      9: {
                     10:        char *oarg = arg;
                     11:        int shelf;
                     12: 
                     13:        if((*arg < '0') || (*arg > '9')){
                     14: usage:
                     15:                sprintf(err, "shelfside '%s' must be numa or numb", oarg);
                     16:                return(-1);
                     17:        }
                     18:        shelf = 0;
                     19:        while((*arg >= '0') && (*arg <= '9'))
                     20:                shelf = 10*shelf + *arg++ - '0';
                     21:        shelf <<= 1;
                     22:        if(*arg == 'a')
                     23:                ;
                     24:        else if(*arg == 'b')
                     25:                shelf |= 1;
                     26:        else
                     27:                goto usage;
                     28:        if(*++arg)
                     29:                goto usage;
                     30:        return(shelf);
                     31: }

unix.superglobalmegacorp.com

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