FreeBASIC  0.91.0
rtl-print.bas
Go to the documentation of this file.
1 '' intrinsic runtime lib printing functions (PRINT, WRITE, LPRINT, USING, ...)
2 ''
3 '' chng: oct/2004 written [v1ctor]
4 
5 #include once "fb.bi"
6 #include once "fbint.bi"
7 #include once "ast.bi"
8 #include once "lex.bi"
9 #include once "rtl.bi"
10 
11  dim shared as FB_RTL_PROCDEF funcdata( 0 to ... ) = _
12  { _
13 /' sub fb_PrintVoid( byval fnum as long = 0, byval mask as long ) '/ _
14  ( _
15  @FB_RTL_PRINTVOID, NULL, _
16  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
17  NULL, FB_RTL_OPT_NONE, _
18  2, _
19  { _
20  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
21  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
22  } _
23  ), _
24 /' sub fb_PrintByte( byval fnum as long = 0, byval x as byte, byval mask as long ) '/ _
25  ( _
26  @FB_RTL_PRINTBYTE, NULL, _
27  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
28  NULL, FB_RTL_OPT_NONE, _
29  3, _
30  { _
31  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
32  ( FB_DATATYPE_BYTE, FB_PARAMMODE_BYVAL, FALSE ), _
33  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
34  } _
35  ), _
36 /' sub fb_PrintUByte( byval fnum as long = 0, byval x as ubyte, byval mask as long ) '/ _
37  ( _
38  @FB_RTL_PRINTUBYTE, NULL, _
39  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
40  NULL, FB_RTL_OPT_NONE, _
41  3, _
42  { _
43  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
44  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
45  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
46  } _
47  ), _
48 /' sub fb_PrintShort( byval fnum as long = 0, byval x as short, byval mask as long ) '/ _
49  ( _
50  @FB_RTL_PRINTSHORT, NULL, _
51  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
52  NULL, FB_RTL_OPT_NONE, _
53  3, _
54  { _
55  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
56  ( FB_DATATYPE_SHORT, FB_PARAMMODE_BYVAL, FALSE ), _
57  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
58  } _
59  ), _
60 /' sub fb_PrintUShort( byval fnum as long = 0, byval x as ushort, byval mask as long ) '/ _
61  ( _
62  @FB_RTL_PRINTUSHORT, NULL, _
63  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
64  NULL, FB_RTL_OPT_NONE, _
65  3, _
66  { _
67  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
68  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
69  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
70  } _
71  ), _
72 /' sub fb_PrintInt( byval fnum as long = 0, byval x as long, byval mask as long ) '/ _
73  ( _
74  @FB_RTL_PRINTINT, NULL, _
75  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
76  NULL, FB_RTL_OPT_NONE, _
77  3, _
78  { _
79  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
80  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
81  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
82  } _
83  ), _
84 /' sub fb_PrintUInt( byval fnum as long = 0, byval x as ulong, byval mask as long ) '/ _
85  ( _
86  @FB_RTL_PRINTUINT, NULL, _
87  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
88  NULL, FB_RTL_OPT_NONE, _
89  3, _
90  { _
91  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
92  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
93  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
94  } _
95  ), _
96 /' sub fb_PrintLongint( byval fnum as integer = 0, byval x as longint, byval mask as long ) '/ _
97  ( _
98  @FB_RTL_PRINTLONGINT, NULL, _
99  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
100  NULL, FB_RTL_OPT_NONE, _
101  3, _
102  { _
103  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
104  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
105  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
106  } _
107  ), _
108 /' sub fb_PrintULongint( byval fnum as long = 0, byval x as ulongint, byval mask as long ) '/ _
109  ( _
110  @FB_RTL_PRINTULONGINT, NULL, _
111  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
112  NULL, FB_RTL_OPT_NONE, _
113  3, _
114  { _
115  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
116  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
117  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
118  } _
119  ), _
120 /' sub fb_PrintSingle( byval fnum as long = 0, byval x as single, byval mask as long ) '/ _
121  ( _
122  @FB_RTL_PRINTSINGLE, NULL, _
123  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
124  NULL, FB_RTL_OPT_NONE, _
125  3, _
126  { _
127  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
128  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ), _
129  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
130  } _
131  ), _
132 /' sub fb_PrintDouble( byval fnum as long = 0, byval x as double, byval mask as long ) '/ _
133  ( _
134  @FB_RTL_PRINTDOUBLE, NULL, _
135  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
136  NULL, FB_RTL_OPT_NONE, _
137  3, _
138  { _
139  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
140  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ), _
141  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
142  } _
143  ), _
144 /' sub fb_PrintString( byval fnum as long = 0, byref x as string, byval mask as long ) '/ _
145  ( _
146  @FB_RTL_PRINTSTR, NULL, _
147  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
148  NULL, FB_RTL_OPT_NONE, _
149  3, _
150  { _
151  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
152  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
153  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
154  } _
155  ), _
156 /' sub fb_PrintWstr( byval fnum as long = 0, byval x as wstring ptr, byval mask as long ) '/ _
157  ( _
158  @FB_RTL_PRINTWSTR, NULL, _
159  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
160  NULL, FB_RTL_OPT_NONE, _
161  3, _
162  { _
163  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
164  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
165  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
166  } _
167  ), _
168 /' sub fb_LPrintVoid( byval fnum as long = 0, byval mask as long ) '/ _
169  ( _
170  @FB_RTL_LPRINTVOID, NULL, _
171  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
172  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
173  2, _
174  { _
175  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
176  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
177  } _
178  ), _
179 /' sub fb_LPrintByte( byval fnum as long = 0, byval x as byte, byval mask as long ) '/ _
180  ( _
181  @FB_RTL_LPRINTBYTE, NULL, _
182  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
183  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
184  3, _
185  { _
186  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
187  ( FB_DATATYPE_BYTE, FB_PARAMMODE_BYVAL, FALSE ), _
188  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
189  } _
190  ), _
191 /' sub fb_LPrintUByte( byval fnum as long = 0, byval x as ubyte, byval mask as long ) '/ _
192  ( _
193  @FB_RTL_LPRINTUBYTE, NULL, _
194  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
195  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
196  3, _
197  { _
198  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
199  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
200  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
201  } _
202  ), _
203 /' sub fb_LPrintShort( byval fnum as long = 0, byval x as short, byval mask as long ) '/ _
204  ( _
205  @FB_RTL_LPRINTSHORT, NULL, _
206  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
207  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
208  3, _
209  { _
210  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
211  ( FB_DATATYPE_SHORT, FB_PARAMMODE_BYVAL, FALSE ), _
212  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
213  } _
214  ), _
215 /' sub fb_LPrintUShort( byval fnum as long = 0, byval x as ushort, byval mask as long ) '/ _
216  ( _
217  @FB_RTL_LPRINTUSHORT, NULL, _
218  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
219  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
220  3, _
221  { _
222  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
223  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
224  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
225  } _
226  ), _
227 /' sub fb_LPrintInt( byval fnum as long = 0, byval x as long, byval mask as long ) '/ _
228  ( _
229  @FB_RTL_LPRINTINT, NULL, _
230  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
231  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
232  3, _
233  { _
234  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
235  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
236  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
237  } _
238  ), _
239 /' sub fb_LPrintUInt( byval fnum as long = 0, byval x as ulong, byval mask as long ) '/ _
240  ( _
241  @FB_RTL_LPRINTUINT, NULL, _
242  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
243  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
244  3, _
245  { _
246  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
247  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
248  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
249  } _
250  ), _
251 /' sub fb_LPrintLongint( byval fnum as long = 0, byval x as longint, byval mask as long ) '/ _
252  ( _
253  @FB_RTL_LPRINTLONGINT, NULL, _
254  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
255  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
256  3, _
257  { _
258  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
259  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
260  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
261  } _
262  ), _
263 /' sub fb_LPrintULongint( byval fnum as long = 0, byval x as ulongint, byval mask as long ) '/ _
264  ( _
265  @FB_RTL_LPRINTULONGINT, NULL, _
266  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
267  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
268  3, _
269  { _
270  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
271  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
272  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
273  } _
274  ), _
275 /' sub fb_LPrintSingle( byval fnum as long = 0, byval x as single, byval mask as long ) '/ _
276  ( _
277  @FB_RTL_LPRINTSINGLE, NULL, _
278  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
279  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
280  3, _
281  { _
282  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
283  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ), _
284  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
285  } _
286  ), _
287 /' sub fb_LPrintDouble( byval fnum as long = 0, byval x as double, byval mask as long ) '/ _
288  ( _
289  @FB_RTL_LPRINTDOUBLE, NULL, _
290  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
291  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
292  3, _
293  { _
294  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
295  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ), _
296  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
297  } _
298  ), _
299 /' sub fb_LPrintString( byval fnum as long = 0, byref x as string, byval mask as long ) '/ _
300  ( _
301  @FB_RTL_LPRINTSTR, NULL, _
302  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
303  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
304  3, _
305  { _
306  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
307  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
308  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
309  } _
310  ), _
311 /' sub fb_LPrintWstr( byval fnum as long = 0, byval x as wstring ptr, byval mask as long ) '/ _
312  ( _
313  @FB_RTL_LPRINTWSTR, NULL, _
314  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
315  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
316  3, _
317  { _
318  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
319  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
320  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
321  } _
322  ), _
323 /' sub fb_PrintSPC( byval fnum as long = 0, byval n as integer ) '/ _
324  ( _
325  @FB_RTL_PRINTSPC, NULL, _
326  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
327  NULL, FB_RTL_OPT_NONE, _
328  2, _
329  { _
330  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
331  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
332  } _
333  ), _
334 /' sub fb_PrintTab( byval fnum as long = 0, byval newcol as long ) '/ _
335  ( _
336  @FB_RTL_PRINTTAB, NULL, _
337  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
338  NULL, FB_RTL_OPT_NONE, _
339  2, _
340  { _
341  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
342  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
343  } _
344  ), _
345 /' sub fb_WriteVoid( byval fnum as long = 0, byval mask as long ) '/ _
346  ( _
347  @FB_RTL_WRITEVOID, NULL, _
348  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
349  NULL, FB_RTL_OPT_NONE, _
350  2, _
351  { _
352  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
353  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
354  } _
355  ), _
356 /' sub fb_WriteByte( byval fnum as long = 0, byval x as byte, byval mask as long ) '/ _
357  ( _
358  @FB_RTL_WRITEBYTE, NULL, _
359  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
360  NULL, FB_RTL_OPT_NONE, _
361  3, _
362  { _
363  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
364  ( FB_DATATYPE_BYTE, FB_PARAMMODE_BYVAL, FALSE ), _
365  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
366  } _
367  ), _
368 /' sub fb_WriteUByte( byval fnum as long = 0, byval x as ubyte, byval mask as long ) '/ _
369  ( _
370  @FB_RTL_WRITEUBYTE, NULL, _
371  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
372  NULL, FB_RTL_OPT_NONE, _
373  3, _
374  { _
375  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
376  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
377  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
378  } _
379  ), _
380 /' sub fb_WriteShort( byval fnum as long = 0, byval x as short, byval mask as long ) '/ _
381  ( _
382  @FB_RTL_WRITESHORT, NULL, _
383  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
384  NULL, FB_RTL_OPT_NONE, _
385  3, _
386  { _
387  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
388  ( FB_DATATYPE_SHORT, FB_PARAMMODE_BYVAL, FALSE ), _
389  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
390  } _
391  ), _
392 /' sub fb_WriteUShort( byval fnum as long = 0, byval x as ushort, byval mask as long ) '/ _
393  ( _
394  @FB_RTL_WRITEUSHORT, NULL, _
395  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
396  NULL, FB_RTL_OPT_NONE, _
397  3, _
398  { _
399  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
400  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
401  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
402  } _
403  ), _
404 /' sub fb_WriteInt( byval fnum as long = 0, byval x as long, byval mask as long ) '/ _
405  ( _
406  @FB_RTL_WRITEINT, NULL, _
407  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
408  NULL, FB_RTL_OPT_NONE, _
409  3, _
410  { _
411  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
412  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
413  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
414  } _
415  ), _
416 /' sub fb_WriteUInt( byval fnum as long = 0, byval x as ulong, byval mask as long ) '/ _
417  ( _
418  @FB_RTL_WRITEUINT, NULL, _
419  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
420  NULL, FB_RTL_OPT_NONE, _
421  3, _
422  { _
423  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
424  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
425  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
426  } _
427  ), _
428 /' sub fb_WriteLongint( byval fnum as long = 0, byval x as longint, byval mask as long ) '/ _
429  ( _
430  @FB_RTL_WRITELONGINT, NULL, _
431  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
432  NULL, FB_RTL_OPT_NONE, _
433  3, _
434  { _
435  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
436  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
437  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
438  } _
439  ), _
440 /' sub fb_WriteULongint( byval fnum as long = 0, byval x as ulongint, byval mask as long ) '/ _
441  ( _
442  @FB_RTL_WRITEULONGINT, NULL, _
443  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
444  NULL, FB_RTL_OPT_NONE, _
445  3, _
446  { _
447  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
448  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
449  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
450  } _
451  ), _
452 /' sub fb_WriteSingle( byval fnum as long = 0, byval x as single, byval mask as long ) '/ _
453  ( _
454  @FB_RTL_WRITESINGLE, NULL, _
455  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
456  NULL, FB_RTL_OPT_NONE, _
457  3, _
458  { _
459  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
460  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ), _
461  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
462  } _
463  ), _
464 /' sub fb_WriteDouble( byval fnum as long = 0, byval x as double, byval mask as long ) '/ _
465  ( _
466  @FB_RTL_WRITEDOUBLE, NULL, _
467  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
468  NULL, FB_RTL_OPT_NONE, _
469  3, _
470  { _
471  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
472  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ), _
473  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
474  } _
475  ), _
476 /' sub fb_WriteString( byval fnum as long = 0, byref x as string, byval mask as long ) '/ _
477  ( _
478  @FB_RTL_WRITESTR, NULL, _
479  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
480  NULL, FB_RTL_OPT_NONE, _
481  3, _
482  { _
483  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
484  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
485  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
486  } _
487  ), _
488 /' sub fb_WriteWstr( byval fnum as long = 0, byval x as wstring ptr, byval mask as long ) '/ _
489  ( _
490  @FB_RTL_WRITEWSTR, NULL, _
491  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
492  NULL, FB_RTL_OPT_NONE, _
493  3, _
494  { _
495  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ), _
496  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
497  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
498  } _
499  ), _
500 /' function fb_PrintUsingInit( byref fmtstr as string ) as long '/ _
501  ( _
502  @FB_RTL_PRINTUSGINIT, NULL, _
503  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
504  NULL, FB_RTL_OPT_NONE, _
505  1, _
506  { _
507  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
508  } _
509  ), _
510 /' function fb_PrintUsingStr( byval fnum as long, byref s as string, byval mask as long ) as long '/ _
511  ( _
512  @FB_RTL_PRINTUSGSTR, NULL, _
513  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
514  NULL, FB_RTL_OPT_NONE, _
515  3, _
516  { _
517  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
518  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
519  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
520  } _
521  ), _
522 /' function fb_PrintUsingWstr( byval fnum as long, byval s as wstring ptr, byval mask as long ) as long '/ _
523  ( _
524  @FB_RTL_PRINTUSGWSTR, NULL, _
525  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
526  NULL, FB_RTL_OPT_NONE, _
527  3, _
528  { _
529  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
530  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
531  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
532  } _
533  ), _
534 /' function fb_PrintUsingSingle( byval fnum as long, byval v as single, byval mask as long ) as long '/ _
535  ( _
536  @FB_RTL_PRINTUSG_SNG, NULL, _
537  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
538  NULL, FB_RTL_OPT_NONE, _
539  3, _
540  { _
541  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
542  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ), _
543  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
544  } _
545  ), _
546 /' function fb_PrintUsingDouble( byval fnum as long, byval v as double, byval mask as long ) as long '/ _
547  ( _
548  @FB_RTL_PRINTUSG_DBL, NULL, _
549  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
550  NULL, FB_RTL_OPT_NONE, _
551  3, _
552  { _
553  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
554  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ), _
555  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
556  } _
557  ), _
558 /' function fb_PrintUsingLongint( byval fnum as long, byval v as longint, byval mask as long ) as long '/ _
559  ( _
560  @FB_RTL_PRINTUSG_LL, NULL, _
561  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
562  NULL, FB_RTL_OPT_NONE, _
563  3, _
564  { _
565  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
566  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
567  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
568  } _
569  ), _
570 /' function fb_PrintUsingULongint( byval fnum as long, byval v as ulongint, byval mask as long ) as long '/ _
571  ( _
572  @FB_RTL_PRINTUSG_ULL, NULL, _
573  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
574  NULL, FB_RTL_OPT_NONE, _
575  3, _
576  { _
577  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
578  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
579  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
580  } _
581  ), _
582 /' function fb_PrintUsingEnd( byval fnum as long ) as long '/ _
583  ( _
584  @FB_RTL_PRINTUSGEND, NULL, _
585  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
586  NULL, FB_RTL_OPT_NONE, _
587  1, _
588  { _
589  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
590  } _
591  ), _
592 /' function fb_LPrintUsingInit( byref fmtstr as string ) as long '/ _
593  ( _
594  @FB_RTL_LPRINTUSGINIT, NULL, _
595  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
596  @rtlPrinter_cb, FB_RTL_OPT_NONE, _
597  1, _
598  { _
599  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
600  } _
601  ), _
602 /' EOL '/ _
603  ( _
604  NULL _
605  ) _
606  }
607 
608 '':::::
610 
612 
613 end sub
614 
615 '':::::
617 
618  '' procs will be deleted when symbEnd is called
619 
620 end sub
621 
622 '':::::
623 function rtlPrint _
624  ( _
625  byval fileexpr as ASTNODE ptr, _
626  byval iscomma as integer, _
627  byval issemicolon as integer, _
628  byval expr as ASTNODE ptr, _
629  byval islprint as integer = FALSE _
630  ) as integer
631 
632  dim as ASTNODE ptr proc = any
633  dim as FBSYMBOL ptr f = any
634  dim as integer mask = any
635 
636  function = FALSE
637 
638  if( expr = NULL ) then
639  if( islprint ) then
640  f = PROCLOOKUP( LPRINTVOID )
641  else
642  f = PROCLOOKUP( PRINTVOID )
643  end if
644  else
645  '' UDT? try to convert to string with type casting op overloading
646  select case typeGet( astGetDataType( expr ) )
647  case FB_DATATYPE_STRUCT, FB_DATATYPE_ENUM
648  expr = astNewOvlCONV( FB_DATATYPE_STRING, NULL, expr )
649  if( expr = NULL ) then
650  exit function
651  end if
652  end select
653 
654  '' Convert pointer to uinteger
655  if( typeIsPtr( astGetFullType( expr ) ) ) then
656  expr = astNewCONV( FB_DATATYPE_UINT, NULL, expr )
657  end if
658 
659  select case as const typeGet( astGetDataType( expr ) )
660  case FB_DATATYPE_FIXSTR, FB_DATATYPE_STRING, FB_DATATYPE_CHAR
661  if( islprint ) then
662  f = PROCLOOKUP( LPRINTSTR )
663  else
664  f = PROCLOOKUP( PRINTSTR )
665  end if
666 
667  case FB_DATATYPE_WCHAR
668  if( islprint ) then
669  f = PROCLOOKUP( LPRINTWSTR )
670  else
671  f = PROCLOOKUP( PRINTWSTR )
672  end if
673 
674  case FB_DATATYPE_BYTE, FB_DATATYPE_UBYTE, _
675  FB_DATATYPE_SHORT, FB_DATATYPE_USHORT, _
676  FB_DATATYPE_INTEGER, FB_DATATYPE_ENUM, FB_DATATYPE_UINT, _
677  FB_DATATYPE_LONG, FB_DATATYPE_ULONG, _
678  FB_DATATYPE_LONGINT, FB_DATATYPE_ULONGINT
679 
680  select case as const( typeGetSizeType( astGetFullType( expr ) ) )
681  case FB_SIZETYPE_INT8
682  if( islprint ) then
683  f = PROCLOOKUP( LPRINTBYTE )
684  else
685  f = PROCLOOKUP( PRINTBYTE )
686  end if
687 
688  case FB_SIZETYPE_UINT8
689  if( islprint ) then
690  f = PROCLOOKUP( LPRINTUBYTE )
691  else
692  f = PROCLOOKUP( PRINTUBYTE )
693  end if
694 
695  case FB_SIZETYPE_INT16
696  if( islprint ) then
697  f = PROCLOOKUP( LPRINTSHORT )
698  else
699  f = PROCLOOKUP( PRINTSHORT )
700  end if
701 
702  case FB_SIZETYPE_UINT16
703  if( islprint ) then
704  f = PROCLOOKUP( LPRINTUSHORT )
705  else
706  f = PROCLOOKUP( PRINTUSHORT )
707  end if
708 
709  case FB_SIZETYPE_INT32
710  if( islprint ) then
711  f = PROCLOOKUP( LPRINTINT )
712  else
713  f = PROCLOOKUP( PRINTINT )
714  end if
715 
716  case FB_SIZETYPE_UINT32
717  if( islprint ) then
718  f = PROCLOOKUP( LPRINTUINT )
719  else
720  f = PROCLOOKUP( PRINTUINT )
721  end if
722 
723  case FB_SIZETYPE_INT64
724  if( islprint ) then
725  f = PROCLOOKUP( LPRINTLONGINT )
726  else
727  f = PROCLOOKUP( PRINTLONGINT )
728  end if
729 
730  case FB_SIZETYPE_UINT64
731  if( islprint ) then
732  f = PROCLOOKUP( LPRINTULONGINT )
733  else
734  f = PROCLOOKUP( PRINTULONGINT )
735  end if
736  end select
737 
738  case FB_DATATYPE_SINGLE
739  if( islprint ) then
740  f = PROCLOOKUP( LPRINTSINGLE )
741  else
742  f = PROCLOOKUP( PRINTSINGLE )
743  end if
744 
745  case FB_DATATYPE_DOUBLE
746  if( islprint ) then
747  f = PROCLOOKUP( LPRINTDOUBLE )
748  else
749  f = PROCLOOKUP( PRINTDOUBLE )
750  end if
751 
752  case else
753  exit function
754  end select
755  end if
756 
757  ''
758  proc = astNewCALL( f )
759 
760  '' byval filenum as integer
761  if( astNewARG( proc, fileexpr ) = NULL ) then
762  exit function
763  end if
764 
765  if( expr <> NULL ) then
766  '' byval? x as ???
767  if( astNewARG( proc, expr ) = NULL ) then
768  exit function
769  end if
770  end if
771 
772  '' byval mask as integer
773  mask = 0
774  if( fbLangIsSet( FB_LANG_QB ) ) then mask or= FB_PRINTMASK_APPEND_SPACE
775  if( iscomma ) then
776  mask or= FB_PRINTMASK_PAD
777  elseif( issemicolon = FALSE ) then
778  mask or= FB_PRINTMASK_NEWLINE
779  end if
780 
781  if( astNewARG( proc, astNewCONSTi( mask ) ) = NULL ) then
782  exit function
783  end if
784 
785  ''
786  astAdd( proc )
787 
788  function = TRUE
789 
790 end function
791 
792 '':::::
793 function rtlPrintSPC _
794  ( _
795  byval fileexpr as ASTNODE ptr, _
796  byval expr as ASTNODE ptr, _
797  byval islprint as integer = FALSE _
798  ) as integer
799 
800  dim as ASTNODE ptr proc = any
801 
802  function = FALSE
803 
804  if islprint then
805  rtlPrinter_cb( NULL )
806  end if
807 
808  ''
809  proc = astNewCALL( PROCLOOKUP( PRINTSPC ) )
810 
811  '' byval filenum as integer
812  if( astNewARG( proc, fileexpr ) = NULL ) then
813  exit function
814  end if
815 
816  '' byval n as integer
817  if( astNewARG( proc, expr ) = NULL ) then
818  exit function
819  end if
820 
821  astAdd( proc )
822 
823  function = TRUE
824 
825 end function
826 
827 '':::::
828 function rtlPrintTab _
829  ( _
830  byval fileexpr as ASTNODE ptr, _
831  byval expr as ASTNODE ptr, _
832  byval islprint as integer = FALSE _
833  ) as integer
834 
835  dim as ASTNODE ptr proc = any
836 
837  function = FALSE
838 
839  if islprint then
840  rtlPrinter_cb( NULL )
841  end if
842 
843  ''
844  proc = astNewCALL( PROCLOOKUP( PRINTTAB ) )
845 
846  '' byval filenum as integer
847  if( astNewARG( proc, fileexpr ) = NULL ) then
848  exit function
849  end if
850 
851  '' byval newcol as integer
852  if( astNewARG( proc, expr ) = NULL ) then
853  exit function
854  end if
855 
856  astAdd( proc )
857 
858  function = TRUE
859 
860 end function
861 
862 '':::::
863 function rtlWrite _
864  ( _
865  byval fileexpr as ASTNODE ptr, _
866  byval iscomma as integer, _
867  byval expr as ASTNODE ptr _
868  ) as integer
869 
870  dim as ASTNODE ptr proc = any
871  dim as FBSYMBOL ptr f = any
872  dim as integer mask = any
873 
874  function = FALSE
875 
876  if( expr = NULL ) then
877  f = PROCLOOKUP( WRITEVOID )
878  else
879  '' UDT? try to convert to string with type casting op overloading
880  select case astGetDataType( expr )
881  case FB_DATATYPE_STRUCT, FB_DATATYPE_ENUM
882  expr = astNewOvlCONV( FB_DATATYPE_STRING, NULL, expr )
883  if( expr = NULL ) then
884  exit function
885  end if
886  end select
887 
888  '' Convert pointer to uinteger
889  if( typeIsPtr( astGetFullType( expr ) ) ) then
890  expr = astNewCONV( FB_DATATYPE_UINT, NULL, expr )
891  end if
892 
893  select case as const typeGet( astGetDataType( expr ) )
894  case FB_DATATYPE_FIXSTR, FB_DATATYPE_STRING, FB_DATATYPE_CHAR
895  f = PROCLOOKUP( WRITESTR )
896 
897  case FB_DATATYPE_WCHAR
898  f = PROCLOOKUP( WRITEWSTR )
899 
900  case FB_DATATYPE_BYTE, FB_DATATYPE_UBYTE, _
901  FB_DATATYPE_SHORT, FB_DATATYPE_USHORT, _
902  FB_DATATYPE_INTEGER, FB_DATATYPE_ENUM, FB_DATATYPE_UINT, _
903  FB_DATATYPE_LONG, FB_DATATYPE_ULONG, _
904  FB_DATATYPE_LONGINT, FB_DATATYPE_ULONGINT
905 
906  select case as const( typeGetSizeType( astGetFullType( expr ) ) )
907  case FB_SIZETYPE_INT8 : f = PROCLOOKUP( WRITEBYTE )
908  case FB_SIZETYPE_UINT8 : f = PROCLOOKUP( WRITEUBYTE )
909  case FB_SIZETYPE_INT16 : f = PROCLOOKUP( WRITESHORT )
910  case FB_SIZETYPE_UINT16 : f = PROCLOOKUP( WRITEUSHORT )
911  case FB_SIZETYPE_INT32 : f = PROCLOOKUP( WRITEINT )
912  case FB_SIZETYPE_UINT32 : f = PROCLOOKUP( WRITEUINT )
913  case FB_SIZETYPE_INT64 : f = PROCLOOKUP( WRITELONGINT )
914  case FB_SIZETYPE_UINT64 : f = PROCLOOKUP( WRITEULONGINT )
915  end select
916 
917  case FB_DATATYPE_SINGLE
918  f = PROCLOOKUP( WRITESINGLE )
919 
920  case FB_DATATYPE_DOUBLE
921  f = PROCLOOKUP( WRITEDOUBLE )
922 
923  case else
924  exit function
925  end select
926  end if
927 
928  ''
929  proc = astNewCALL( f )
930 
931  '' byval filenum as integer
932  if( astNewARG( proc, fileexpr ) = NULL ) then
933  exit function
934  end if
935 
936  if( expr <> NULL ) then
937  '' byval? x as ???
938  if( astNewARG( proc, expr ) = NULL ) then
939  exit function
940  end if
941  end if
942 
943  '' byval mask as integer
944  mask = 0
945  if( iscomma ) then
946  mask or= FB_PRINTMASK_PAD
947  else
948  mask or= FB_PRINTMASK_NEWLINE
949  end if
950 
951  if( astNewARG( proc, astNewCONSTi( mask ) ) = NULL ) then
952  exit function
953  end if
954 
955  ''
956  astAdd( proc )
957 
958  function = TRUE
959 
960 end function
961 
962 '':::::
963 function rtlPrintUsingInit _
964  ( _
965  byval usingexpr as ASTNODE ptr, _
966  byval islprint as integer = FALSE _
967  ) as integer
968 
969  dim as ASTNODE ptr proc = any
970  dim as FBSYMBOL ptr f = any
971 
972  function = FALSE
973 
974  ''
975  if( islprint ) then
976  f = PROCLOOKUP( LPRINTUSGINIT )
977  else
978  f = PROCLOOKUP( PRINTUSGINIT )
979  end if
980  proc = astNewCALL( f )
981 
982  '' fmtstr as string
983  if( astNewARG( proc, usingexpr ) = NULL ) then
984  exit function
985  end if
986 
987  astAdd( proc )
988 
989  function = TRUE
990 
991 end function
992 
993 '':::::
994 function rtlPrintUsingEnd _
995  ( _
996  byval fileexpr as ASTNODE ptr, _
997  byval islprint as integer = FALSE _
998  ) as integer
999 
1000  dim as ASTNODE ptr proc = any
1001 
1002  function = FALSE
1003 
1004  if islprint then
1005  rtlPrinter_cb( NULL )
1006  end if
1007 
1008  ''
1009  proc = astNewCALL( PROCLOOKUP( PRINTUSGEND ) )
1010 
1011  '' byval filenum as integer
1012  if( astNewARG( proc, fileexpr ) = NULL ) then
1013  exit function
1014  end if
1015 
1016  astAdd( proc )
1017 
1018  function = TRUE
1019 
1020 end function
1021 
1022 '':::::
1023 function rtlPrintUsing _
1024  ( _
1025  byval fileexpr as ASTNODE ptr, _
1026  byval expr as ASTNODE ptr, _
1027  byval iscomma as integer, _
1028  byval issemicolon as integer, _
1029  byval islprint as integer = FALSE _
1030  ) as integer
1031 
1032  dim as ASTNODE ptr proc = any
1033  dim as FBSYMBOL ptr f = any
1034  dim as integer mask = any
1035 
1036  function = FALSE
1037 
1038  if( islprint ) then
1039  rtlPrinter_cb( NULL )
1040  end if
1041 
1042  if( expr = NULL ) then
1043  exit function
1044  end if
1045 
1046  '' UDT? try to convert to double with type casting op overloading
1047  select case astGetDataType( expr )
1048  case FB_DATATYPE_STRUCT, FB_DATATYPE_ENUM
1049  expr = astNewOvlCONV( FB_DATATYPE_DOUBLE, NULL, expr )
1050  if( expr = NULL ) then
1051  exit function
1052  end if
1053  end select
1054 
1055  select case astGetDataType( expr )
1056  case FB_DATATYPE_FIXSTR, FB_DATATYPE_STRING, FB_DATATYPE_CHAR
1057  f = PROCLOOKUP( PRINTUSGSTR )
1058 
1059  case FB_DATATYPE_WCHAR
1060  f = PROCLOOKUP( PRINTUSGWSTR )
1061 
1062  case FB_DATATYPE_SINGLE
1063  f = PROCLOOKUP( PRINTUSG_SNG )
1064 
1065  case FB_DATATYPE_LONGINT, _
1066  FB_DATATYPE_INTEGER, _
1067  FB_DATATYPE_LONG, _
1068  FB_DATATYPE_SHORT, _
1069  FB_DATATYPE_BYTE
1070 
1071  f = PROCLOOKUP( PRINTUSG_LL )
1072 
1073  case FB_DATATYPE_ULONGINT, _
1074  FB_DATATYPE_UINT, _
1075  FB_DATATYPE_ULONG, _
1076  FB_DATATYPE_USHORT, _
1077  FB_DATATYPE_UBYTE
1078 
1079  f = PROCLOOKUP( PRINTUSG_ULL )
1080 
1081  case else
1082  f = PROCLOOKUP( PRINTUSG_DBL )
1083  end select
1084 
1085  proc = astNewCALL( f )
1086 
1087  '' byval filenum as integer
1088  if( astNewARG( proc, fileexpr ) = NULL ) then
1089  exit function
1090  end if
1091 
1092  '' s as string or byval v as double
1093  if( astNewARG( proc, expr ) = NULL ) then
1094  exit function
1095  end if
1096 
1097  '' byval mask as integer
1098  if( iscomma or issemicolon ) then
1099  mask = 0
1100 
1101 #if 0
1102  '' this allows commas to print padding like in regular PRINTs
1103  '' (QB doesn't support this though - the IDE just converts them to semicolons)
1104  if( iscomma ) then
1105  mask or= FB_PRINTMASK_PAD
1106  end if
1107 #endif
1108 
1109  else
1110  mask = FB_PRINTMASK_NEWLINE or FB_PRINTMASK_ISLAST
1111  end if
1112 
1113  if( astNewARG( proc, astNewCONSTi( mask ) ) = NULL ) then
1114  exit function
1115  end if
1116 
1117  ''
1118  astAdd( proc )
1119 
1120  function = TRUE
1121 
1122 end function
1123 
1124 '':::::
1125 function rtlWidthDev _
1126  ( _
1127  byval device as ASTNODE ptr, _
1128  byval width_arg as ASTNODE ptr, _
1129  byval isfunc as integer _
1130  ) as ASTNODE ptr
1131 
1132  dim as ASTNODE ptr proc = any
1133 
1134  function = NULL
1135 
1136  '' printer libraries are always required for width on devices
1137  rtlPrinter_cb( NULL )
1138 
1139  ''
1140  proc = astNewCALL( PROCLOOKUP( WIDTHDEV ) )
1141 
1142  '' device as string
1143  if( astNewARG( proc, device ) = NULL ) then
1144  exit function
1145  end if
1146 
1147  '' byval width_arg as integer
1148  if( astNewARG( proc, width_arg ) = NULL ) then
1149  exit function
1150  end if
1151 
1152  if( isfunc = FALSE ) then
1153  astAdd( rtlErrorCheck( proc ) )
1154  end if
1155 
1156  function = proc
1157 end function
1158 
1159 '':::::
1160 function rtlPrinter_cb _
1161  ( _
1162  byval sym as FBSYMBOL ptr _
1163  ) as integer
1164 
1165  static as integer libsAdded = FALSE
1166 
1167  if( libsadded = FALSE ) then
1168 
1169  libsAdded = TRUE
1170 
1171  select case env.clopt.target
1172  case FB_COMPTARGET_WIN32, FB_COMPTARGET_CYGWIN
1173  fbAddLib("winspool")
1174  fbAddLib("gdi32")
1175  end select
1176 
1177  end if
1178 
1179  function = TRUE
1180 
1181 end function
1182