vm: merge i386 and arm pagetable code
[minix.git] / external / bsd / file / dist / src / names.h
blob24166bb1a0a3e0b2ca34a27868b0b9777d266470
1 /* $NetBSD: names.h,v 1.1.1.2 2011/05/12 20:46:54 christos Exp $ */
3 /*
4 * Copyright (c) Ian F. Darwin 1986-1995.
5 * Software written by Ian F. Darwin and others;
6 * maintained 1995-present by Christos Zoulas and others.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice immediately at the beginning of the file, without modification,
13 * this list of conditions, and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
31 * Names.h - names and types used by ascmagic in file(1).
32 * These tokens are here because they can appear anywhere in
33 * the first HOWMANY bytes, while tokens in MAGIC must
34 * appear at fixed offsets into the file. Don't make HOWMANY
35 * too high unless you have a very fast CPU.
37 * $File: names.h,v 1.33 2010/10/08 21:58:44 christos Exp $
41 modified by Chris Lowth - 9 April 2000
42 to add mime type strings to the types table.
45 /* these types are used to index the table 'types': keep em in sync! */
46 #define L_C 0 /* first and foremost on UNIX */
47 #define L_CC 1 /* Bjarne's postincrement */
48 #define L_MAKE 2 /* Makefiles */
49 #define L_PLI 3 /* PL/1 */
50 #define L_MACH 4 /* some kinda assembler */
51 #define L_ENG 5 /* English */
52 #define L_PAS 6 /* Pascal */
53 #define L_MAIL 7 /* Electronic mail */
54 #define L_NEWS 8 /* Usenet Netnews */
55 #define L_JAVA 9 /* Java code */
56 #define L_HTML 10 /* HTML */
57 #define L_BCPL 11 /* BCPL */
58 #define L_M4 12 /* M4 */
59 #define L_PO 13 /* PO */
61 static const struct {
62 char human[48];
63 char mime[16];
64 } types[] = {
65 { "C program", "text/x-c", },
66 { "C++ program", "text/x-c++" },
67 { "make commands", "text/x-makefile" },
68 { "PL/1 program", "text/x-pl1" },
69 { "assembler program", "text/x-asm" },
70 { "English", "text/plain" },
71 { "Pascal program", "text/x-pascal" },
72 { "mail", "text/x-mail" },
73 { "news", "text/x-news" },
74 { "Java program", "text/x-java" },
75 { "HTML document", "text/html", },
76 { "BCPL program", "text/x-bcpl" },
77 { "M4 macro language pre-processor", "text/x-m4" },
78 { "PO (gettext message catalogue)", "text/x-po" },
79 { "cannot happen error on names.h/types", "error/x-error" }
83 * XXX - how should we distinguish Java from C++?
84 * The trick used in a Debian snapshot, of having "extends" or "implements"
85 * as tags for Java, doesn't work very well, given that those keywords
86 * are often preceded by "class", which flags it as C++.
88 * Perhaps we need to be able to say
90 * If "class" then
92 * if "extends" or "implements" then
93 * Java
94 * else
95 * C++
96 * endif
98 * Or should we use other keywords, such as "package" or "import"?
99 * Unfortunately, Ada95 uses "package", and Modula-3 uses "import",
100 * although I infer from the language spec at
102 * http://www.research.digital.com/SRC/m3defn/html/m3.html
104 * that Modula-3 uses "IMPORT" rather than "import", i.e. it must be
105 * in all caps.
107 * So, for now, we go with "import". We must put it before the C++
108 * stuff, so that we don't misidentify Java as C++. Not using "package"
109 * means we won't identify stuff that defines a package but imports
110 * nothing; hopefully, very little Java code imports nothing (one of the
111 * reasons for doing OO programming is to import as much as possible
112 * and write only what you need to, right?).
114 * Unfortunately, "import" may cause us to misidentify English text
115 * as Java, as it comes after "the" and "The". Perhaps we need a fancier
116 * heuristic to identify Java?
118 static const struct names {
119 char name[14];
120 unsigned char type;
121 unsigned char score;
123 } names[] = {
124 /* These must be sorted by eye for optimal hit rate */
125 /* Add to this list only after substantial meditation */
126 {"msgid", L_PO, 1 },
127 {"dnl", L_M4, 2 },
128 {"import", L_JAVA, 2 },
129 {"\"libhdr\"", L_BCPL, 2 },
130 {"\"LIBHDR\"", L_BCPL, 2 },
131 {"//", L_CC, 2 },
132 {"template", L_CC, 1 },
133 {"virtual", L_CC, 1 },
134 {"class", L_CC, 2 },
135 {"public:", L_CC, 2 },
136 {"private:", L_CC, 2 },
137 {"/*", L_C, 2 }, /* must precede "The", "the", etc. */
138 {"#include", L_C, 2 },
139 {"char", L_C, 2 },
140 {"The", L_ENG, 2 },
141 {"the", L_ENG, 2 },
142 {"double", L_C, 1 },
143 {"extern", L_C, 2 },
144 {"float", L_C, 1 },
145 {"struct", L_C, 1 },
146 {"union", L_C, 1 },
147 {"main(", L_C, 2 },
148 {"CFLAGS", L_MAKE, 2 },
149 {"LDFLAGS", L_MAKE, 2 },
150 {"all:", L_MAKE, 2 },
151 {".PRECIOUS", L_MAKE, 2 },
152 {".ascii", L_MACH, 2 },
153 {".asciiz", L_MACH, 2 },
154 {".byte", L_MACH, 2 },
155 {".even", L_MACH, 2 },
156 {".globl", L_MACH, 2 },
157 {".text", L_MACH, 2 },
158 {"clr", L_MACH, 2 },
159 {"(input,", L_PAS, 2 },
160 {"program", L_PAS, 1 },
161 {"record", L_PAS, 1 },
162 {"dcl", L_PLI, 2 },
163 {"Received:", L_MAIL, 2 },
164 {">From", L_MAIL, 2 },
165 {"Return-Path:",L_MAIL, 2 },
166 {"Cc:", L_MAIL, 2 },
167 {"Newsgroups:", L_NEWS, 2 },
168 {"Path:", L_NEWS, 2 },
169 {"Organization:",L_NEWS, 2 },
170 {"href=", L_HTML, 2 },
171 {"HREF=", L_HTML, 2 },
172 {"<body", L_HTML, 2 },
173 {"<BODY", L_HTML, 2 },
174 {"<html", L_HTML, 2 },
175 {"<HTML", L_HTML, 2 },
176 {"<!--", L_HTML, 2 },
178 #define NNAMES (sizeof(names)/sizeof(struct names))