Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/lib/libc/regex/cname.h
39476 views
1
/*-
2
* SPDX-License-Identifier: BSD-3-Clause
3
*
4
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
5
* Copyright (c) 1992, 1993, 1994
6
* The Regents of the University of California. All rights reserved.
7
*
8
* This code is derived from software contributed to Berkeley by
9
* Henry Spencer.
10
*
11
* Redistribution and use in source and binary forms, with or without
12
* modification, are permitted provided that the following conditions
13
* are met:
14
* 1. Redistributions of source code must retain the above copyright
15
* notice, this list of conditions and the following disclaimer.
16
* 2. Redistributions in binary form must reproduce the above copyright
17
* notice, this list of conditions and the following disclaimer in the
18
* documentation and/or other materials provided with the distribution.
19
* 3. Neither the name of the University nor the names of its contributors
20
* may be used to endorse or promote products derived from this software
21
* without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33
* SUCH DAMAGE.
34
*/
35
36
/* character-name table */
37
static struct cname {
38
const char *name;
39
char code;
40
} cnames[] = {
41
{"NUL", '\0'},
42
{"SOH", '\001'},
43
{"STX", '\002'},
44
{"ETX", '\003'},
45
{"EOT", '\004'},
46
{"ENQ", '\005'},
47
{"ACK", '\006'},
48
{"BEL", '\007'},
49
{"alert", '\007'},
50
{"BS", '\010'},
51
{"backspace", '\b'},
52
{"HT", '\011'},
53
{"tab", '\t'},
54
{"LF", '\012'},
55
{"newline", '\n'},
56
{"VT", '\013'},
57
{"vertical-tab", '\v'},
58
{"FF", '\014'},
59
{"form-feed", '\f'},
60
{"CR", '\015'},
61
{"carriage-return", '\r'},
62
{"SO", '\016'},
63
{"SI", '\017'},
64
{"DLE", '\020'},
65
{"DC1", '\021'},
66
{"DC2", '\022'},
67
{"DC3", '\023'},
68
{"DC4", '\024'},
69
{"NAK", '\025'},
70
{"SYN", '\026'},
71
{"ETB", '\027'},
72
{"CAN", '\030'},
73
{"EM", '\031'},
74
{"SUB", '\032'},
75
{"ESC", '\033'},
76
{"IS4", '\034'},
77
{"FS", '\034'},
78
{"IS3", '\035'},
79
{"GS", '\035'},
80
{"IS2", '\036'},
81
{"RS", '\036'},
82
{"IS1", '\037'},
83
{"US", '\037'},
84
{"space", ' '},
85
{"exclamation-mark", '!'},
86
{"quotation-mark", '"'},
87
{"number-sign", '#'},
88
{"dollar-sign", '$'},
89
{"percent-sign", '%'},
90
{"ampersand", '&'},
91
{"apostrophe", '\''},
92
{"left-parenthesis", '('},
93
{"right-parenthesis", ')'},
94
{"asterisk", '*'},
95
{"plus-sign", '+'},
96
{"comma", ','},
97
{"hyphen", '-'},
98
{"hyphen-minus", '-'},
99
{"period", '.'},
100
{"full-stop", '.'},
101
{"slash", '/'},
102
{"solidus", '/'},
103
{"zero", '0'},
104
{"one", '1'},
105
{"two", '2'},
106
{"three", '3'},
107
{"four", '4'},
108
{"five", '5'},
109
{"six", '6'},
110
{"seven", '7'},
111
{"eight", '8'},
112
{"nine", '9'},
113
{"colon", ':'},
114
{"semicolon", ';'},
115
{"less-than-sign", '<'},
116
{"equals-sign", '='},
117
{"greater-than-sign", '>'},
118
{"question-mark", '?'},
119
{"commercial-at", '@'},
120
{"left-square-bracket", '['},
121
{"backslash", '\\'},
122
{"reverse-solidus", '\\'},
123
{"right-square-bracket",']'},
124
{"circumflex", '^'},
125
{"circumflex-accent", '^'},
126
{"underscore", '_'},
127
{"low-line", '_'},
128
{"grave-accent", '`'},
129
{"left-brace", '{'},
130
{"left-curly-bracket", '{'},
131
{"vertical-line", '|'},
132
{"right-brace", '}'},
133
{"right-curly-bracket", '}'},
134
{"tilde", '~'},
135
{"DEL", '\177'},
136
{NULL, 0}
137
};
138
139