Improve GambitREPL iOS example.
[gambit-c.git] / lib / c_intf.h
blob66af446074c31445c16bbaf3634925ee20ae5095
1 /* File: "c_intf.h", Time-stamp: <2009-08-06 19:07:29 feeley> */
3 /* Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved. */
5 #ifndef ___C_INTF_H
6 #define ___C_INTF_H
9 /*---------------------------------------------------------------------------*/
11 /* Utilities for UTF-8 encoding of characters. */
14 extern int ___UTF_8_bytes
15 ___P((___UCS_4 c),
16 ());
18 extern void ___UTF_8_put
19 ___P((___UTF_8STRING *ptr,
20 ___UCS_4 c),
21 ());
23 extern ___UCS_4 ___UTF_8_get
24 ___P((___UTF_8STRING *ptr),
25 ());
28 /*---------------------------------------------------------------------------*/
31 * Decoding/encoding of a buffer of characters (of type ___C) to a
32 * buffer of bytes (of type ___U8) in a certain encoding.
36 #define ___CONVERSION_DONE 0
37 #define ___INCOMPLETE_CHAR 1
38 #define ___ILLEGAL_CHAR 2
40 #define char_EOL ___UNICODE_LINEFEED
43 extern int chars_from_bytes
44 ___P((___C *char_buf,
45 int *char_buf_avail,
46 ___U8 *byte_buf,
47 int *byte_buf_avail,
48 int *decoding_state),
49 ());
51 extern int chars_to_bytes
52 ___P((___C *char_buf,
53 int *char_buf_avail,
54 ___U8 *byte_buf,
55 int *byte_buf_avail,
56 int *encoding_state),
57 ());
59 extern ___SCMOBJ err_code_from_char_encoding
60 ___P((int char_encoding,
61 ___BOOL ctos,
62 int type,
63 int arg_num),
64 ());
67 /*---------------------------------------------------------------------------*/
69 /* Unicode characters. */
72 #define ___UNICODE_NUL 0
73 #define ___UNICODE_BELL 7
74 #define ___UNICODE_BACKSPACE 8
75 #define ___UNICODE_TAB 9
76 #define ___UNICODE_LINEFEED 10
77 #define ___UNICODE_RETURN 13
78 #define ___UNICODE_ESCAPE 27
79 #define ___UNICODE_SPACE 32
80 #define ___UNICODE_DOUBLEQUOTE 34
81 #define ___UNICODE_SHARP 35
82 #define ___UNICODE_QUOTE 39
83 #define ___UNICODE_PLUS 43
84 #define ___UNICODE_COMMA 44
85 #define ___UNICODE_MINUS 45
86 #define ___UNICODE_0 48
87 #define ___UNICODE_1 49
88 #define ___UNICODE_2 50
89 #define ___UNICODE_3 51
90 #define ___UNICODE_4 52
91 #define ___UNICODE_5 53
92 #define ___UNICODE_6 54
93 #define ___UNICODE_7 55
94 #define ___UNICODE_8 56
95 #define ___UNICODE_9 57
96 #define ___UNICODE_SEMICOLON 59
97 #define ___UNICODE_QUESTION 63
98 #define ___UNICODE_AT 64
99 #define ___UNICODE_UPPER_A 65
100 #define ___UNICODE_LOWER_A 97
101 #define ___UNICODE_UPPER_B 66
102 #define ___UNICODE_LOWER_B 98
103 #define ___UNICODE_UPPER_C 67
104 #define ___UNICODE_LOWER_C 99
105 #define ___UNICODE_UPPER_D 68
106 #define ___UNICODE_LOWER_D 100
107 #define ___UNICODE_UPPER_E 69
108 #define ___UNICODE_LOWER_E 101
109 #define ___UNICODE_UPPER_F 70
110 #define ___UNICODE_LOWER_F 102
111 #define ___UNICODE_UPPER_G 71
112 #define ___UNICODE_LOWER_G 103
113 #define ___UNICODE_UPPER_H 72
114 #define ___UNICODE_LOWER_H 104
115 #define ___UNICODE_UPPER_I 73
116 #define ___UNICODE_LOWER_I 105
117 #define ___UNICODE_UPPER_J 74
118 #define ___UNICODE_LOWER_J 106
119 #define ___UNICODE_UPPER_K 75
120 #define ___UNICODE_LOWER_K 107
121 #define ___UNICODE_UPPER_L 76
122 #define ___UNICODE_LOWER_L 108
123 #define ___UNICODE_UPPER_M 77
124 #define ___UNICODE_LOWER_M 109
125 #define ___UNICODE_UPPER_N 78
126 #define ___UNICODE_LOWER_N 110
127 #define ___UNICODE_UPPER_O 79
128 #define ___UNICODE_LOWER_O 111
129 #define ___UNICODE_UPPER_P 80
130 #define ___UNICODE_LOWER_P 112
131 #define ___UNICODE_UPPER_Q 81
132 #define ___UNICODE_LOWER_Q 113
133 #define ___UNICODE_UPPER_R 82
134 #define ___UNICODE_LOWER_R 114
135 #define ___UNICODE_UPPER_S 83
136 #define ___UNICODE_LOWER_S 115
137 #define ___UNICODE_UPPER_T 84
138 #define ___UNICODE_LOWER_T 116
139 #define ___UNICODE_UPPER_U 85
140 #define ___UNICODE_LOWER_U 117
141 #define ___UNICODE_UPPER_V 86
142 #define ___UNICODE_LOWER_V 118
143 #define ___UNICODE_UPPER_W 87
144 #define ___UNICODE_LOWER_W 119
145 #define ___UNICODE_UPPER_X 88
146 #define ___UNICODE_LOWER_X 120
147 #define ___UNICODE_UPPER_Y 89
148 #define ___UNICODE_LOWER_Y 121
149 #define ___UNICODE_UPPER_Z 90
150 #define ___UNICODE_LOWER_Z 122
151 #define ___UNICODE_LPAREN 40
152 #define ___UNICODE_RPAREN 41
153 #define ___UNICODE_LBRACKET 91
154 #define ___UNICODE_BACKSLASH 92
155 #define ___UNICODE_RBRACKET 93
156 #define ___UNICODE_LBRACE 123
157 #define ___UNICODE_VBAR 124
158 #define ___UNICODE_RBRACE 125
159 #define ___UNICODE_RUBOUT 127
160 #define ___UNICODE_REPLACEMENT 0xfffd
161 #define ___UNICODE_BOM 0xfeff
164 /*---------------------------------------------------------------------------*/
167 #endif