File:  [Research Unix] / researchv9 / X11 / src / X.V11R1 / server / dix / buildatoms
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#!/bin/sh
hfile=../../include/Xatom.h
cfile=initatoms.c
rm -f $hfile $cfile
umask 222
awk '
BEGIN {
	hfile = "'$hfile'";
	cfile = "'$cfile'";
	hformat = "#define XA_%s ((Atom) %d)\n";
	printf("#ifndef XATOM_H\n") > hfile;
	printf("#define XATOM_H 1\n\n") > hfile;
	printf("/* THIS IS A GENERATED FILE\n") > hfile;
	printf(" *\n") > hfile;
	printf(" * Do not edit it directly or put it under source control.\n") > hfile;
	printf(" */\n\n") > hfile;

	printf("/* THIS IS A GENERATED FILE\n") > cfile;
	printf(" *\n") > cfile;
	printf(" * Do not edit it directly or put it under source control.\n") > cfile;
	printf(" */\n\n") > cfile;
	printf("#include \"X.h\"\n") > cfile;
	printf("#include \"Xatom.h\"\n") > cfile;
	printf("MakePredeclaredAtoms()\n") > cfile;
	printf("{\n") > cfile;

	}

NF == 2 && $2 == "@" {
	printf(hformat, $1, ++atomno) > hfile ;
	printf("    if (MakeAtom(\"%s\", %d, 1) != XA_%s) AtomError();\n", $1, length($1), $1) > cfile ;
	}

END {
	printf("\n") > hfile;
	printf(hformat, "LAST_PREDEFINED", atomno) > hfile ;
	printf("#endif /* XATOM_H */\n") > hfile;
	printf("}\n") > cfile ;
	}
' BuiltInAtoms

unix.superglobalmegacorp.com

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