GNU PROLOG with UTF8 support
c_supp.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------*
2  * GNU Prolog *
3  * *
4  * Part : Prolog buit-in predicates *
5  * File : c_supp.h *
6  * Descr.: C interface support - header file *
7  * Author: Daniel Diaz *
8  * *
9  * Copyright (C) 1999-2015 Daniel Diaz *
10  * *
11  * This file is part of GNU Prolog *
12  * *
13  * GNU Prolog is free software: you can redistribute it and/or *
14  * modify it under the terms of either: *
15  * *
16  * - the GNU Lesser General Public License as published by the Free *
17  * Software Foundation; either version 3 of the License, or (at your *
18  * option) any later version. *
19  * *
20  * or *
21  * *
22  * - the GNU General Public License as published by the Free *
23  * Software Foundation; either version 2 of the License, or (at your *
24  * option) any later version. *
25  * *
26  * or both in parallel, as here. *
27  * *
28  * GNU Prolog is distributed in the hope that it will be useful, *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
31  * General Public License for more details. *
32  * *
33  * You should have received copies of the GNU General Public License and *
34  * the GNU Lesser General Public License along with this program. If *
35  * not, see http://www.gnu.org/licenses/. *
36  *-------------------------------------------------------------------------*/
37 
38 #include "../EnginePl/pl_wchar.h"
39 
40 /*---------------------------------*
41  * Constants *
42  *---------------------------------*/
43 
44 /*---------------------------------*
45  * Type Definitions *
46  *---------------------------------*/
47 
48 /*---------------------------------*
49  * Global Variables *
50  *---------------------------------*/
51 
52 /*---------------------------------*
53  * Function Prototypes *
54  *---------------------------------*/
55 
57 
58 PlLong Pl_Rd_Integer(WamWord start_word);
59 
61 
62 PlLong Pl_Rd_Positive(WamWord start_word);
63 
64 double Pl_Rd_Float_Check(WamWord start_word);
65 
66 double Pl_Rd_Float(WamWord start_word);
67 
68 double Pl_Rd_Number_Check(WamWord start_word);
69 
70 double Pl_Rd_Number(WamWord start_word);
71 
72 int Pl_Rd_Atom_Check(WamWord start_word);
73 
74 int Pl_Rd_Atom(WamWord start_word);
75 
76 int Pl_Rd_Boolean_Check(WamWord start_word);
77 
78 int Pl_Rd_Boolean(WamWord start_word);
79 
81 
82 int Pl_Rd_Char(WamWord start_word);
83 
84 int Pl_Rd_In_Char_Check(WamWord start_word);
85 
86 CHAR32_T Pl_Rd_In_Char(WamWord start_word);
87 
89 
90 CHAR32_T Pl_Rd_Code(WamWord start_word);
91 
93 
94 CHAR32_T Pl_Rd_In_Code(WamWord start_word);
95 
96 int Pl_Rd_Byte_Check(WamWord start_word);
97 
98 int Pl_Rd_Byte(WamWord start_word);
99 
100 int Pl_Rd_In_Byte_Check(WamWord start_word);
101 
102 int Pl_Rd_In_Byte(WamWord start_word);
103 
104 char *Pl_Rd_String_Check(WamWord start_word);
105 
106 char *Pl_Rd_String(WamWord start_word);
107 
108 char *Pl_Rd_Chars_Check(WamWord start_word);
109 
110 char *Pl_Rd_Chars(WamWord start_word);
111 
112 char *Pl_Rd_Codes_Check(WamWord start_word);
113 
114 char *Pl_Rd_Codes(WamWord start_word);
115 
116 int Pl_Rd_Chars_Str_Check(WamWord start_word, char *str);
117 
118 int Pl_Rd_Chars_Str(WamWord start_word, char *str);
119 
120 int Pl_Rd_Codes_Str_Check(WamWord start_word, char *str);
121 
122 int Pl_Rd_Codes_Str(WamWord start_word, char *str);
123 
124 WamWord *Pl_Rd_List_Check(WamWord start_word);
125 
126 WamWord *Pl_Rd_List(WamWord start_word);
127 
128 int Pl_Rd_Proper_List_Check(WamWord start_word, WamWord *arg);
129 
130 int Pl_Rd_Proper_List_Check2(WamWord start_word, WamWord *arg,
131  WamWord (*elt_fct)(WamWord start_word));
132 
133 int Pl_Rd_Proper_List(WamWord start_word, WamWord *arg);
134 
135 WamWord *Pl_Rd_Compound_Check(WamWord start_word, int *func, int *arity);
136 
137 WamWord *Pl_Rd_Compound(WamWord start_word, int *func, int *arity);
138 
139 WamWord *Pl_Rd_Callable_Check(WamWord start_word, int *func, int *arity);
140 
141 WamWord *Pl_Rd_Callable(WamWord start_word, int *func, int *arity);
142 
143 
144 
145 void Pl_Check_For_Un_Integer(WamWord start_word);
146 
147 void Pl_Check_For_Un_Positive(WamWord start_word);
148 
149 void Pl_Check_For_Un_Float(WamWord start_word);
150 
151 void Pl_Check_For_Un_Number(WamWord start_word);
152 
153 void Pl_Check_For_Un_Atom(WamWord start_word);
154 
155 void Pl_Check_For_Un_Boolean(WamWord start_word);
156 
157 void Pl_Check_For_Un_Char(WamWord start_word);
158 
159 void Pl_Check_For_Un_In_Char(WamWord start_word);
160 
161 void Pl_Check_For_Un_Code(WamWord start_word);
162 
163 void Pl_Check_For_Un_In_Code(WamWord start_word);
164 
165 void Pl_Check_For_Un_Byte(WamWord start_word);
166 
167 void Pl_Check_For_Un_In_Byte(WamWord start_word);
168 
169 void Pl_Check_For_Un_String(WamWord start_word);
170 
171 void Pl_Check_For_Un_Chars(WamWord start_word);
172 
173 void Pl_Check_For_Un_Codes(WamWord start_word);
174 
175 void Pl_Check_For_Un_List(WamWord start_word);
176 
177 void Pl_Check_For_Un_List2(WamWord start_word,
178  void (*elt_fct)(WamWord start_word));
179 
180 void Pl_Check_For_Un_Compound(WamWord start_word);
181 
182 void Pl_Check_For_Un_Callable(WamWord start_word);
183 
184 void Pl_Check_For_Un_Variable(WamWord start_word);
185 
186 
187 
188 Bool Pl_Un_Integer_Check(PlLong value, WamWord start_word);
189 
190 Bool Pl_Un_Integer(PlLong value, WamWord start_word);
191 
192 Bool Pl_Un_Positive_Check(PlLong value, WamWord start_word);
193 
194 Bool Pl_Un_Positive(PlLong value, WamWord start_word);
195 
196 Bool Pl_Un_Float_Check(double value, WamWord start_word);
197 
198 Bool Pl_Un_Float(double value, WamWord start_word);
199 
200 Bool Pl_Un_Number_Check(double value, WamWord start_word);
201 
202 Bool Pl_Un_Number(double value, WamWord start_word);
203 
204 Bool Pl_Un_Atom_Check(int value, WamWord start_word);
205 
206 Bool Pl_Un_Atom(int value, WamWord start_word);
207 
208 Bool Pl_Un_Boolean_Check(int value, WamWord start_word);
209 
210 Bool Pl_Un_Boolean(int value, WamWord start_word);
211 
212 Bool Pl_Un_Char_Check(int value, WamWord start_word);
213 
214 Bool Pl_Un_Char(int value, WamWord start_word);
215 
216 Bool Pl_Un_In_Char_Check(int value, WamWord start_word);
217 
218 Bool Pl_Un_In_Char(int value, WamWord start_word);
219 
220 Bool Pl_Un_Code_Check(int value, WamWord start_word);
221 
222 Bool Pl_Un_Code(int value, WamWord start_word);
223 
224 Bool Pl_Un_In_Code_Check(int value, WamWord start_word);
225 
226 Bool Pl_Un_In_Code(int value, WamWord start_word);
227 
228 Bool Pl_Un_Byte_Check(int value, WamWord start_word);
229 
230 Bool Pl_Un_Byte(int value, WamWord start_word);
231 
232 Bool Pl_Un_In_Byte_Check(int value, WamWord start_word);
233 
234 Bool Pl_Un_In_Byte(int value, WamWord start_word);
235 
236 Bool Pl_Un_String_Check(char *value, WamWord start_word);
237 
238 Bool Pl_Un_String(char *value, WamWord start_word);
239 
240 Bool Pl_Un_Chars_Check(char *value, WamWord start_word);
241 
242 Bool Pl_Un_Chars(char *value, WamWord start_word);
243 
244 Bool Pl_Un_Codes_Check(char *value, WamWord start_word);
245 
246 Bool Pl_Un_Codes(char *value, WamWord start_word);
247 
248 Bool Pl_Un_List_Check(WamWord *arg, WamWord start_word);
249 
250 Bool Pl_Un_List(WamWord *arg, WamWord start_word);
251 
252 Bool Pl_Un_Proper_List_Check(int n, WamWord *arg, WamWord start_word);
253 
254 Bool Pl_Un_Proper_List(int n, WamWord *arg, WamWord start_word);
255 
256 Bool Pl_Un_Compound_Check(int func, int arity, WamWord *arg,
257  WamWord start_word);
258 
259 Bool Pl_Un_Compound(int func, int arity, WamWord *arg, WamWord start_word);
260 
261 Bool Pl_Un_Callable_Check(int func, int arity, WamWord *arg,
262  WamWord start_word);
263 
264 Bool Pl_Un_Callable(int func, int arity, WamWord *arg, WamWord start_word);
265 
266 Bool Pl_Un_Term(WamWord term_word, WamWord start_word);
267 
268 
269 
271 
273 
274 WamWord Pl_Mk_Float(double value);
275 
276 WamWord Pl_Mk_Number(double value);
277 
278 WamWord Pl_Mk_Atom(int value);
279 
280 WamWord Pl_Mk_Boolean(int value);
281 
282 WamWord Pl_Mk_Char(int value);
283 
284 WamWord Pl_Mk_In_Char(int value);
285 
286 WamWord Pl_Mk_Code(int value);
287 
288 WamWord Pl_Mk_In_Code(int value);
289 
290 WamWord Pl_Mk_Byte(int value);
291 
292 WamWord Pl_Mk_In_Byte(int value);
293 
294 WamWord Pl_Mk_String(char *value);
295 
296 WamWord Pl_Mk_Chars(char *value);
297 
298 WamWord Pl_Mk_Codes(char *value);
299 
301 
302 WamWord Pl_Mk_Proper_List(int n, WamWord *arg);
303 
304 WamWord Pl_Mk_Compound(int func, int arity, WamWord *arg);
305 
306 WamWord Pl_Mk_Callable(int func, int arity, WamWord *arg);
307 
308 WamWord Pl_Mk_Variable(void);
Bool Pl_Un_Code(int value, WamWord start_word)
Definition: c_supp.c:1848
Bool Pl_Un_Char(int value, WamWord start_word)
WamWord Pl_Mk_Atom(int value)
Definition: c_supp.c:2325
Bool Pl_Un_Positive_Check(PlLong value, WamWord start_word)
Definition: c_supp.c:1626
#define CHAR32_T
Definition: pl_wchar.h:9
char * Pl_Rd_Codes_Check(WamWord start_word)
Definition: c_supp.c:745
Bool Pl_Un_Atom_Check(int value, WamWord start_word)
Definition: c_supp.c:1719
WamWord Pl_Mk_Code(int value)
Definition: c_supp.c:2377
void Pl_Check_For_Un_Float(WamWord start_word)
Definition: c_supp.c:1280
Bool Pl_Un_Byte_Check(int value, WamWord start_word)
Definition: c_supp.c:1889
WamWord Pl_Mk_Chars(char *value)
Definition: c_supp.c:2442
Bool Pl_Un_Proper_List_Check(int n, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2110
Bool Pl_Un_Float_Check(double value, WamWord start_word)
Definition: c_supp.c:1654
PlLong Pl_Rd_Positive(WamWord start_word)
Definition: c_supp.c:273
Bool Pl_Un_In_Code(int value, WamWord start_word)
Definition: c_supp.c:1876
void Pl_Check_For_Un_Positive(WamWord start_word)
Definition: c_supp.c:1267
void Pl_Check_For_Un_Number(WamWord start_word)
Definition: c_supp.c:1293
Bool Pl_Un_In_Byte_Check(int value, WamWord start_word)
Definition: c_supp.c:1917
double Pl_Rd_Float(WamWord start_word)
Definition: c_supp.c:308
void Pl_Check_For_Un_In_Char(WamWord start_word)
Definition: c_supp.c:1345
Bool Pl_Un_Char_Check(int value, WamWord start_word)
WamWord * Pl_Rd_Compound_Check(WamWord start_word, int *func, int *arity)
Definition: c_supp.c:1095
int Pl_Rd_Proper_List_Check(WamWord start_word, WamWord *arg)
Definition: c_supp.c:979
Bool Pl_Un_Callable(int func, int arity, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2240
WamWord Pl_Mk_Codes(char *value)
Definition: c_supp.c:2474
Bool Pl_Un_In_Char(int value, WamWord start_word)
Definition: c_supp.c:1819
CHAR32_T Pl_Rd_Code(WamWord start_word)
Definition: c_supp.c:563
char * Pl_Rd_Chars_Check(WamWord start_word)
Definition: c_supp.c:717
CHAR32_T Pl_Rd_Char_Check(WamWord start_word)
Definition: c_supp.c:453
char * Pl_Rd_Chars(WamWord start_word)
Definition: c_supp.c:731
int Pl_Rd_Codes_Str_Check(WamWord start_word, char *str)
Definition: c_supp.c:852
void Pl_Check_For_Un_Byte(WamWord start_word)
Definition: c_supp.c:1384
int Pl_Rd_In_Byte_Check(WamWord start_word)
Definition: c_supp.c:645
CHAR32_T Pl_Rd_In_Char(WamWord start_word)
Definition: c_supp.c:521
WamWord Pl_Mk_Number(double value)
Definition: c_supp.c:2305
WamWord * Pl_Rd_List(WamWord start_word)
Definition: c_supp.c:957
int Pl_Rd_Codes_Str(WamWord start_word, char *str)
Definition: c_supp.c:896
double Pl_Rd_Number_Check(WamWord start_word)
Definition: c_supp.c:325
WamWord Pl_Mk_List(WamWord *arg)
Definition: c_supp.c:2504
int Pl_Rd_Byte(WamWord start_word)
Definition: c_supp.c:632
intptr_t PlLong
Definition: gprolog.h:88
Bool Pl_Un_List_Check(WamWord *arg, WamWord start_word)
Definition: c_supp.c:2063
void Pl_Check_For_Un_Integer(WamWord start_word)
Definition: c_supp.c:1254
Bool Pl_Un_Number(double value, WamWord start_word)
Definition: c_supp.c:1701
WamWord * Pl_Rd_List_Check(WamWord start_word)
Definition: c_supp.c:929
Bool Pl_Un_In_Code_Check(int value, WamWord start_word)
Definition: c_supp.c:1861
void Pl_Check_For_Un_String(WamWord start_word)
Definition: c_supp.c:1465
WamWord * Pl_Rd_Callable(WamWord start_word, int *func, int *arity)
Definition: c_supp.c:1213
WamWord * Pl_Rd_Compound(WamWord start_word, int *func, int *arity)
Definition: c_supp.c:1133
void Pl_Check_For_Un_In_Byte(WamWord start_word)
Definition: c_supp.c:1397
double Pl_Rd_Number(WamWord start_word)
Definition: c_supp.c:350
void Pl_Check_For_Un_Code(WamWord start_word)
Definition: c_supp.c:1358
Bool Pl_Un_Callable_Check(int func, int arity, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2209
ArgInf arg[MAX_ARGS]
Definition: ma_parser.c:114
Bool Pl_Un_String_Check(char *value, WamWord start_word)
Definition: c_supp.c:1945
WamWord Pl_Mk_Float(double value)
Definition: c_supp.c:2292
Bool Pl_Un_Boolean_Check(int value, WamWord start_word)
Definition: c_supp.c:1747
PlLong Pl_Rd_Integer(WamWord start_word)
Definition: c_supp.c:238
Bool Pl_Un_In_Char_Check(int value, WamWord start_word)
Definition: c_supp.c:1803
int Pl_Rd_Proper_List(WamWord start_word, WamWord *arg)
Definition: c_supp.c:1063
CHAR32_T Pl_Rd_In_Code_Check(WamWord start_word)
Definition: c_supp.c:576
Bool Pl_Un_Term(WamWord term_word, WamWord start_word)
Definition: c_supp.c:2253
WamWord Pl_Mk_Proper_List(int n, WamWord *arg)
Definition: c_supp.c:2535
Bool Pl_Un_Compound_Check(int func, int arity, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2149
void Pl_Check_For_Un_Compound(WamWord start_word)
Definition: c_supp.c:1559
void Pl_Check_For_Un_Chars(WamWord start_word)
Definition: c_supp.c:1431
void Pl_Check_For_Un_Variable(WamWord start_word)
Definition: c_supp.c:1585
void Pl_Check_For_Un_Codes(WamWord start_word)
Definition: c_supp.c:1478
Bool Pl_Un_Integer_Check(PlLong value, WamWord start_word)
Definition: c_supp.c:1598
Bool Pl_Un_Chars_Check(char *value, WamWord start_word)
Definition: c_supp.c:1973
Bool Pl_Un_Atom(int value, WamWord start_word)
Definition: c_supp.c:1734
Bool Pl_Un_Integer(PlLong value, WamWord start_word)
Definition: c_supp.c:1613
Bool Pl_Un_Codes(char *value, WamWord start_word)
Definition: c_supp.c:2038
Bool Pl_Un_Boolean(int value, WamWord start_word)
Definition: c_supp.c:1762
int Pl_Rd_Proper_List_Check2(WamWord start_word, WamWord *arg, WamWord(*elt_fct)(WamWord start_word))
Definition: c_supp.c:1020
void Pl_Check_For_Un_List2(WamWord start_word, void(*elt_fct)(WamWord start_word))
Definition: c_supp.c:1527
int Pl_Rd_Atom_Check(WamWord start_word)
Definition: c_supp.c:370
Bool Pl_Un_Proper_List(int n, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2125
char * Pl_Rd_String_Check(WamWord start_word)
Definition: c_supp.c:682
int Pl_Rd_Chars_Str(WamWord start_word, char *str)
Definition: c_supp.c:817
PlLong Pl_Rd_Positive_Check(WamWord start_word)
Definition: c_supp.c:255
int Pl_Rd_In_Byte(WamWord start_word)
Definition: c_supp.c:669
void Pl_Check_For_Un_Atom(WamWord start_word)
Definition: c_supp.c:1306
Bool Pl_Un_In_Byte(int value, WamWord start_word)
Definition: c_supp.c:1932
Bool Pl_Un_String(char *value, WamWord start_word)
Definition: c_supp.c:1960
void Pl_Check_For_Un_List(WamWord start_word)
Definition: c_supp.c:1512
Bool Pl_Un_Byte(int value, WamWord start_word)
Definition: c_supp.c:1904
WamWord Pl_Mk_In_Byte(int value)
Definition: c_supp.c:2416
CHAR32_T Pl_Rd_Code_Check(WamWord start_word)
Definition: c_supp.c:544
int Pl_Rd_Char(WamWord start_word)
Definition: c_supp.c:477
WamWord Pl_Mk_Integer(PlLong value)
Definition: c_supp.c:2266
Bool Pl_Un_List(WamWord *arg, WamWord start_word)
Definition: c_supp.c:2094
Bool Pl_Un_Float(double value, WamWord start_word)
Definition: c_supp.c:1669
Bool Pl_Un_Number_Check(double value, WamWord start_word)
Definition: c_supp.c:1682
WamWord * Pl_Rd_Callable_Check(WamWord start_word, int *func, int *arity)
Definition: c_supp.c:1167
int Pl_Rd_In_Char_Check(WamWord start_word)
Definition: c_supp.c:496
void Pl_Check_For_Un_In_Code(WamWord start_word)
Definition: c_supp.c:1371
int Pl_Rd_Atom(WamWord start_word)
Definition: c_supp.c:392
char * Pl_Rd_String(WamWord start_word)
Definition: c_supp.c:704
int Pl_Rd_Chars_Str_Check(WamWord start_word, char *str)
Definition: c_supp.c:773
Bool Pl_Un_Compound(int func, int arity, WamWord *arg, WamWord start_word)
Definition: c_supp.c:2181
WamWord Pl_Mk_In_Char(int value)
Definition: c_supp.c:2364
long WamWord
Definition: LINUX_SIGSEGV.c:4
void Pl_Check_For_Un_Callable(WamWord start_word)
Definition: c_supp.c:1572
WamWord Pl_Mk_Positive(PlLong value)
Definition: c_supp.c:2279
WamWord Pl_Mk_Byte(int value)
Definition: c_supp.c:2403
char * Pl_Rd_Codes(WamWord start_word)
Definition: c_supp.c:759
Bool Pl_Un_Positive(PlLong value, WamWord start_word)
Definition: c_supp.c:1641
Bool Pl_Un_Code_Check(int value, WamWord start_word)
Definition: c_supp.c:1833
WamWord Pl_Mk_Compound(int func, int arity, WamWord *arg)
Definition: c_supp.c:2568
CHAR32_T Pl_Rd_In_Code(WamWord start_word)
Definition: c_supp.c:595
WamWord Pl_Mk_Char(int value)
Definition: c_supp.c:2351
WamWord Pl_Mk_String(char *value)
Definition: c_supp.c:2429
PlLong Pl_Rd_Integer_Check(WamWord start_word)
Definition: c_supp.c:216
WamWord Pl_Mk_In_Code(int value)
Definition: c_supp.c:2390
void Pl_Check_For_Un_Boolean(WamWord start_word)
Definition: c_supp.c:1319
int Pl_Rd_Byte_Check(WamWord start_word)
Definition: c_supp.c:608
Bool Pl_Un_Chars(char *value, WamWord start_word)
Definition: c_supp.c:1992
void Pl_Check_For_Un_Char(WamWord start_word)
Definition: c_supp.c:1332
double Pl_Rd_Float_Check(WamWord start_word)
Definition: c_supp.c:286
int Bool
Definition: bool.h:65
WamWord Pl_Mk_Callable(int func, int arity, WamWord *arg)
Definition: c_supp.c:2594
WamWord Pl_Mk_Boolean(int value)
Definition: c_supp.c:2338
int Pl_Rd_Boolean(WamWord start_word)
Definition: c_supp.c:433
WamWord Pl_Mk_Variable(void)
Definition: c_supp.c:2607
int Pl_Rd_Boolean_Check(WamWord start_word)
Definition: c_supp.c:409
Bool Pl_Un_Codes_Check(char *value, WamWord start_word)
Definition: c_supp.c:2019