|
|
1.1 root 1: #!/bin/sh
2: hfile=../../include/Xatom.h
3: cfile=initatoms.c
4: rm -f $hfile $cfile
5: umask 222
6: awk '
7: BEGIN {
8: hfile = "'$hfile'";
9: cfile = "'$cfile'";
10: hformat = "#define XA_%s ((Atom) %d)\n";
11: printf("#ifndef XATOM_H\n") > hfile;
12: printf("#define XATOM_H 1\n\n") > hfile;
13: printf("/* THIS IS A GENERATED FILE\n") > hfile;
14: printf(" *\n") > hfile;
15: printf(" * Do not edit it directly or put it under source control.\n") > hfile;
16: printf(" */\n\n") > hfile;
17:
18: printf("/* THIS IS A GENERATED FILE\n") > cfile;
19: printf(" *\n") > cfile;
20: printf(" * Do not edit it directly or put it under source control.\n") > cfile;
21: printf(" */\n\n") > cfile;
22: printf("#include \"X.h\"\n") > cfile;
23: printf("#include \"Xatom.h\"\n") > cfile;
24: printf("MakePredeclaredAtoms()\n") > cfile;
25: printf("{\n") > cfile;
26:
27: }
28:
29: NF == 2 && $2 == "@" {
30: printf(hformat, $1, ++atomno) > hfile ;
31: printf(" if (MakeAtom(\"%s\", %d, 1) != XA_%s) AtomError();\n", $1, length($1), $1) > cfile ;
32: }
33:
34: END {
35: printf("\n") > hfile;
36: printf(hformat, "LAST_PREDEFINED", atomno) > hfile ;
37: printf("#endif /* XATOM_H */\n") > hfile;
38: printf("}\n") > cfile ;
39: }
40: ' BuiltInAtoms
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.