names.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Names.h - names and types used by ascmagic in file(1).
  3. * These tokens are here because they can appear anywhere in
  4. * the first HOWMANY bytes, while tokens in /etc/magic must
  5. * appear at fixed offsets into the file. Don't make HOWMANY
  6. * too high unless you have a very fast CPU.
  7. *
  8. * Copyright (c) Ian F. Darwin, 1987.
  9. * Written by Ian F. Darwin.
  10. *
  11. * See LEGAL.NOTICE
  12. *
  13. * $Id: names.h,v 1.12 1995/04/28 17:29:13 christos Exp $
  14. */
  15. /* these types are used to index the table 'types': keep em in sync! */
  16. #define L_C 0 /* first and foremost on UNIX */
  17. #define L_FORT 1 /* the oldest one */
  18. #define L_MAKE 2 /* Makefiles */
  19. #define L_PLI 3 /* PL/1 */
  20. #define L_MACH 4 /* some kinda assembler */
  21. #define L_ENG 5 /* English */
  22. #define L_PAS 6 /* Pascal */
  23. #define L_MAIL 7 /* Electronic mail */
  24. #define L_NEWS 8 /* Usenet Netnews */
  25. static char *types[] = {
  26. "C program text",
  27. "FORTRAN program text",
  28. "make commands text" ,
  29. "PL/1 program text",
  30. "assembler program text",
  31. "English text",
  32. "Pascal program text",
  33. "mail text",
  34. "news text",
  35. "can't happen error on names.h/types",
  36. 0};
  37. static struct names {
  38. char *name;
  39. short type;
  40. } names[] = {
  41. /* These must be sorted by eye for optimal hit rate */
  42. /* Add to this list only after substantial meditation */
  43. {"/*", L_C}, /* must precede "The", "the", etc. */
  44. {"#include", L_C},
  45. {"char", L_C},
  46. {"The", L_ENG},
  47. {"the", L_ENG},
  48. {"double", L_C},
  49. {"extern", L_C},
  50. {"float", L_C},
  51. {"real", L_C},
  52. {"struct", L_C},
  53. {"union", L_C},
  54. {"CFLAGS", L_MAKE},
  55. {"LDFLAGS", L_MAKE},
  56. {"all:", L_MAKE},
  57. {".PRECIOUS", L_MAKE},
  58. /* Too many files of text have these words in them. Find another way
  59. * to recognize Fortrash.
  60. */
  61. #ifdef NOTDEF
  62. {"subroutine", L_FORT},
  63. {"function", L_FORT},
  64. {"block", L_FORT},
  65. {"common", L_FORT},
  66. {"dimension", L_FORT},
  67. {"integer", L_FORT},
  68. {"data", L_FORT},
  69. #endif /*NOTDEF*/
  70. {".ascii", L_MACH},
  71. {".asciiz", L_MACH},
  72. {".byte", L_MACH},
  73. {".even", L_MACH},
  74. {".globl", L_MACH},
  75. {".text", L_MACH},
  76. {"clr", L_MACH},
  77. {"(input,", L_PAS},
  78. {"dcl", L_PLI},
  79. {"Received:", L_MAIL},
  80. {">From", L_MAIL},
  81. {"Return-Path:",L_MAIL},
  82. {"Cc:", L_MAIL},
  83. {"Newsgroups:", L_NEWS},
  84. {"Path:", L_NEWS},
  85. {"Organization:",L_NEWS},
  86. {NULL, 0}
  87. };
  88. #define NNAMES ((sizeof(names)/sizeof(struct names)) - 1)