asciitype.c 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2003 Gunnar Ritter
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute
  10. * it freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. *
  17. * 2. Altered source versions must be plainly marked as such, and must not be
  18. * misrepresented as being the original software.
  19. *
  20. * 3. This notice may not be removed or altered from any source distribution.
  21. */
  22. /* Sccsid @(#)asciitype.c 1.4 (gritter) 4/17/03 */
  23. #include "asciitype.h"
  24. const unsigned char class_char[] = {
  25. /* 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq 006 ack 007 bel */
  26. C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,
  27. /* 010 bs 011 ht 012 nl 013 vt 014 np 015 cr 016 so 017 si */
  28. C_CNTRL,C_BLANK,C_WHITE,C_SPACE,C_SPACE,C_SPACE,C_CNTRL,C_CNTRL,
  29. /* 020 dle 021 dc1 022 dc2 023 dc3 024 dc4 025 nak 026 syn 027 etb */
  30. C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,
  31. /* 030 can 031 em 032 sub 033 esc 034 fs 035 gs 036 rs 037 us */
  32. C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,C_CNTRL,
  33. /* 040 sp 041 ! 042 " 043 # 044 $ 045 % 046 & 047 ' */
  34. C_BLANK,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,
  35. /* 050 ( 051 ) 052 * 053 + 054 , 055 - 056 . 057 / */
  36. C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,
  37. /* 060 0 061 1 062 2 063 3 064 4 065 5 066 6 067 7 */
  38. C_OCTAL,C_OCTAL,C_OCTAL,C_OCTAL,C_OCTAL,C_OCTAL,C_OCTAL,C_OCTAL,
  39. /* 070 8 071 9 072 : 073 ; 074 < 075 = 076 > 077 ? */
  40. C_DIGIT,C_DIGIT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,
  41. /* 100 @ 101 A 102 B 103 C 104 D 105 E 106 F 107 G */
  42. C_PUNCT,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,
  43. /* 110 H 111 I 112 J 113 K 114 L 115 M 116 N 117 O */
  44. C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,
  45. /* 120 P 121 Q 122 R 123 S 124 T 125 U 126 V 127 W */
  46. C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,C_UPPER,
  47. /* 130 X 131 Y 132 Z 133 [ 134 \ 135 ] 136 ^ 137 _ */
  48. C_UPPER,C_UPPER,C_UPPER,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,
  49. /* 140 ` 141 a 142 b 143 c 144 d 145 e 146 f 147 g */
  50. C_PUNCT,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,
  51. /* 150 h 151 i 152 j 153 k 154 l 155 m 156 n 157 o */
  52. C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,
  53. /* 160 p 161 q 162 r 163 s 164 t 165 u 166 v 167 w */
  54. C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,C_LOWER,
  55. /* 170 x 171 y 172 z 173 { 174 | 175 } 176 ~ 177 del */
  56. C_LOWER,C_LOWER,C_LOWER,C_PUNCT,C_PUNCT,C_PUNCT,C_PUNCT,C_CNTRL
  57. };