home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / dix / buildatoms < prev    next >
Encoding:
Text File  |  1988-09-03  |  1.2 KB  |  43 lines

  1. #!/bin/sh
  2. hfile=../../X11/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 change!  Changing this file implies a protocol change!\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 change!  Changing this file implies a protocol change!\n") > cfile;
  21.     printf(" */\n\n") > cfile;
  22.     printf("#include \"X.h\"\n") > cfile;
  23.     printf("#include \"Xatom.h\"\n") > cfile;
  24.     printf("extern Atom MakeAtom();\n") > cfile;
  25.     printf("MakePredeclaredAtoms()\n") > cfile;
  26.     printf("{\n") > cfile;
  27.  
  28.     }
  29.  
  30. NF == 2 && $2 == "@" {
  31.     printf(hformat, $1, ++atomno) > hfile ;
  32.     printf("    if (MakeAtom(\"%s\", %d, 1) != XA_%s) AtomError();\n", $1, length($1), $1) > cfile ;
  33.     }
  34.  
  35. END {
  36.     printf("\n") > hfile;
  37.     printf(hformat, "LAST_PREDEFINED", atomno) > hfile ;
  38.     printf("#endif /* XATOM_H */\n") > hfile;
  39.     printf("}\n") > cfile ;
  40.     }
  41. ' BuiltInAtoms
  42. exit 0
  43.