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

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