File:  [CSRG BSD Unix] / 41BSD / cmd / lisp / fixmask.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:53 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD41
BSD 4.1

static char *sccsid = "@(#)fixmask.c	34.1 10/3/80";

#include <stdio.h>
char mybuf[BUFSIZ];
extern unsigned short mask[];
main(){
	register savesize = 0; char *cp;
	while(fgets(mybuf,BUFSIZ,stdin)!=NULL) {
		if(*mybuf=='#') {
			if(strcmpn(mybuf,"#save	",6)==0){
				savesize = mybuf[6]-'0';
			} else if (strcmpn(mybuf,"#protect	",9)==0){
				savesize = '0'-1-mybuf[9];
			}
		}
		if(savesize && strcmpn(mybuf,"	.set	L",7)==0) {
			for(cp=mybuf;*cp++!=',';);
			sprintf(cp,"0x%X\n",mask[savesize + 10]);
			savesize = 0;
		}
		fputs(mybuf,stdout);
	}
}
unsigned short mask[] = {
	0,0,0,0xfc0,0xfc0,0xfc0,0xec0,0xcc0,0x8c0,0x0c0,0,
	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.