Annotation of 41BSD/cmd/lisp/fixmask.c, revision 1.1.1.1

1.1       root        1: static char *sccsid = "@(#)fixmask.c   34.1 10/3/80";
                      2: 
                      3: #include <stdio.h>
                      4: char mybuf[BUFSIZ];
                      5: extern unsigned short mask[];
                      6: main(){
                      7:        register savesize = 0; char *cp;
                      8:        while(fgets(mybuf,BUFSIZ,stdin)!=NULL) {
                      9:                if(*mybuf=='#') {
                     10:                        if(strcmpn(mybuf,"#save ",6)==0){
                     11:                                savesize = mybuf[6]-'0';
                     12:                        } else if (strcmpn(mybuf,"#protect      ",9)==0){
                     13:                                savesize = '0'-1-mybuf[9];
                     14:                        }
                     15:                }
                     16:                if(savesize && strcmpn(mybuf,"  .set    L",7)==0) {
                     17:                        for(cp=mybuf;*cp++!=',';);
                     18:                        sprintf(cp,"0x%X\n",mask[savesize + 10]);
                     19:                        savesize = 0;
                     20:                }
                     21:                fputs(mybuf,stdout);
                     22:        }
                     23: }
                     24: unsigned short mask[] = {
                     25:        0,0,0,0xfc0,0xfc0,0xfc0,0xec0,0xcc0,0x8c0,0x0c0,0,
                     26:        0x800,0xc00,0xe00,0xf00,0xf80,0xfc0,0,0,0,0};

unix.superglobalmegacorp.com

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