This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.bin / file / names.h
CommitLineData
15637ed4
RG
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 *
286a6f32 11 * See LEGAL.NOTICE
15637ed4 12 *
286a6f32 13 * names.h,v 1.2 1993/06/10 00:38:14 jtc Exp
15637ed4
RG
14 */
15
16/* these types are used to index the table 'types': keep em in sync! */
17#define L_C 0 /* first and foremost on UNIX */
18#define L_FORT 1 /* the oldest one */
19#define L_MAKE 2 /* Makefiles */
20#define L_PLI 3 /* PL/1 */
21#define L_MACH 4 /* some kinda assembler */
22#define L_ENG 5 /* English */
23#define L_PAS 6 /* Pascal */
24#define L_MAIL 7 /* Electronic mail */
25#define L_NEWS 8 /* Usenet Netnews */
26
286a6f32 27static char *types[] = {
15637ed4
RG
28 "c program text",
29 "fortran program text",
30 "make commands text" ,
31 "pl/1 program text",
32 "assembler program text",
33 "English text",
34 "pascal program text",
35 "mail text",
36 "news text",
37 "can't happen error on names.h/types",
38 0};
39
286a6f32 40static struct names {
15637ed4
RG
41 char *name;
42 short type;
43} names[] = {
44 /* These must be sorted by eye for optimal hit rate */
45 /* Add to this list only after substantial meditation */
46 {"/*", L_C}, /* must preced "The", "the", etc. */
47 {"#include", L_C},
48 {"char", L_C},
49 {"The", L_ENG},
50 {"the", L_ENG},
51 {"double", L_C},
52 {"extern", L_C},
53 {"float", L_C},
54 {"real", L_C},
55 {"struct", L_C},
56 {"union", L_C},
57 {"CFLAGS", L_MAKE},
58 {"LDFLAGS", L_MAKE},
59 {"all:", L_MAKE},
60 {".PRECIOUS", L_MAKE},
61/* Too many files of text have these words in them. Find another way
62 * to recognize Fortrash.
63 */
64#ifdef NOTDEF
65 {"subroutine", L_FORT},
66 {"function", L_FORT},
67 {"block", L_FORT},
68 {"common", L_FORT},
69 {"dimension", L_FORT},
70 {"integer", L_FORT},
71 {"data", L_FORT},
72#endif /*NOTDEF*/
73 {".ascii", L_MACH},
74 {".asciiz", L_MACH},
75 {".byte", L_MACH},
76 {".even", L_MACH},
77 {".globl", L_MACH},
78 {"clr", L_MACH},
79 {"(input,", L_PAS},
80 {"dcl", L_PLI},
81 {"Received:", L_MAIL},
82 {">From", L_MAIL},
83 {"Return-Path:",L_MAIL},
84 {"Cc:", L_MAIL},
85 {"Newsgroups:", L_NEWS},
86 {"Path:", L_NEWS},
87 {"Organization:",L_NEWS},
286a6f32
C
88 {0}
89 };
15637ed4 90#define NNAMES ((sizeof(names)/sizeof(struct names)) - 1)