]>
Commit | Line | Data |
---|---|---|
28e9041c | 1 | /* Hex character manipulation support. |
a3493641 | 2 | Copyright (C) 1995, 2001 Free Software Foundation, Inc. |
28e9041c | 3 | |
4 | This file is part of the libiberty library. | |
5 | Libiberty is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Library General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2 of the License, or (at your option) any later version. | |
9 | ||
10 | Libiberty is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Library General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Library General Public | |
16 | License along with libiberty; see the file COPYING.LIB. If | |
17 | not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | Boston, MA 02111-1307, USA. */ | |
19 | ||
a3493641 | 20 | #include <stdio.h> /* for EOF */ |
28e9041c | 21 | #include "libiberty.h" |
22 | ||
a3493641 | 23 | /* Are we ASCII? */ |
24 | #if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ | |
25 | && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ | |
26 | && EOF == -1 | |
28e9041c | 27 | |
a3493641 | 28 | const char _hex_value[_hex_array_size] = |
28e9041c | 29 | { |
a3493641 | 30 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NUL SOH STX ETX */ |
31 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* EOT ENQ ACK BEL */ | |
32 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* BS HT LF VT */ | |
33 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FF CR SO SI */ | |
34 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DLE DC1 DC2 DC3 */ | |
35 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DC4 NAK SYN ETB */ | |
36 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* CAN EM SUB ESC */ | |
37 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FS GS RS US */ | |
38 | ||
39 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SP ! " # */ | |
40 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* $ % & ' */ | |
41 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* ( ) * + */ | |
42 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* , - . / */ | |
43 | 0, 1, 2, 3, /* 0 1 2 3 */ | |
44 | 4, 5, 6, 7, /* 4 5 6 7 */ | |
45 | 8, 9, _hex_bad, _hex_bad, /* 8 9 : ; */ | |
46 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* < = > ? */ | |
47 | ||
48 | _hex_bad, 10, 11, 12, /* @ A B C */ | |
49 | 13, 14, 15, _hex_bad, /* D E F G */ | |
50 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* H I J K */ | |
51 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* L M N O */ | |
52 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* P Q R S */ | |
53 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* T U V W */ | |
54 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* X Y Z [ */ | |
55 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* \ ] ^ _ */ | |
56 | ||
57 | _hex_bad, 10, 11, 12, /* ` a b c */ | |
58 | 13, 14, 15, _hex_bad, /* d e f g */ | |
59 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* h i j k */ | |
60 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* l m n o */ | |
61 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* p q r s */ | |
62 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* t u v w */ | |
63 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* x y z { */ | |
64 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* | } ~ DEL */ | |
65 | ||
66 | /* The high half of unsigned char, all values are _hex_bad. */ | |
67 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
68 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
69 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
70 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
71 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
72 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
73 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
74 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
75 | ||
76 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
77 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
78 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
79 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
80 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
81 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
82 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
83 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
84 | ||
85 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
86 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
87 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
88 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
89 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
90 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
91 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
92 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
93 | ||
94 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
95 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
96 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
97 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
98 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
99 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
100 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
101 | _hex_bad, _hex_bad, _hex_bad, _hex_bad, | |
102 | }; | |
103 | #else | |
104 | #error "Unsupported host character set" | |
105 | #endif /* not ASCII */ |