FreeBASIC  0.91.0
rtl-string.bas
Go to the documentation of this file.
1 '' intrinsic runtime lib string functions (MID, LEFT, STR, VAL, HEX, ...)
2 ''
3 '' chng: oct/2004 written [v1ctor]
4 
5 
6 #include once "fb.bi"
7 #include once "fbint.bi"
8 #include once "ast.bi"
9 #include once "rtl.bi"
10 
11  dim shared as FB_RTL_PROCDEF funcdata( 0 to ... ) = _
12  { _
13 /' function fb_StrInit( byref dst as any, byval dst_len as integer, _
14  byref src as any, byval src_len as integer, _
15  byval fillrem as long = 1 ) as string '/ _
16  ( _
17  @FB_RTL_STRINIT, NULL, _
18  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
19  NULL, FB_RTL_OPT_NONE, _
20  5, _
21  { _
22  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
23  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
24  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
25  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
26  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 1 ) _
27  } _
28  ), _
29 /' function fb_WstrAssignToA_Init( byref dst as any, byval dst_len as integer, _
30  byval src as wstring ptr, byval fillrem as integer ) as string '/ _
31  ( _
32  @FB_RTL_WSTRASSIGNAW_INIT, NULL, _
33  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
34  NULL, FB_RTL_OPT_NONE, _
35  4, _
36  { _
37  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
38  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
39  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
40  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
41  } _
42  ), _
43 /' function fb_StrAssign( byref dst as any, byval dst_len as integer, _
44  byref src as any, byval src_len as integer, _
45  byval fillrem as long = 1 ) as string '/ _
46  ( _
47  @FB_RTL_STRASSIGN, NULL, _
48  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
49  NULL, FB_RTL_OPT_NONE, _
50  5, _
51  { _
52  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
53  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
54  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
55  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
56  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 1 ) _
57  } _
58  ), _
59 /' function fb_WstrAssign( byval dst as wstring ptr, byval dst_len as integer, _
60  byval src as wstring ptr) as wstring ptr '/ _
61  ( _
62  @FB_RTL_WSTRASSIGN, NULL, _
63  typeAddrOf( FB_DATATYPE_WCHAR ), FB_FUNCMODE_FBCALL, _
64  NULL, FB_RTL_OPT_NONE, _
65  3, _
66  { _
67  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
68  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
69  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
70  } _
71  ), _
72 /' function fb_WstrAssignFromA( byval dst as wstring ptr, byval dst_len as integer, _
73  byref src as any, byval src_len as integer ) as wstring ptr '/ _
74  ( _
75  @FB_RTL_WSTRASSIGNWA, NULL, _
76  typeAddrOf( FB_DATATYPE_WCHAR ), FB_FUNCMODE_FBCALL, _
77  NULL, FB_RTL_OPT_NONE, _
78  4, _
79  { _
80  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
81  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
82  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
83  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
84  } _
85  ), _
86 /' function fb_WstrAssignToA( byref dst as any, byval dst_len as integer, _
87  byval src as wstring ptr, byval fillrem as long ) as string '/ _
88  ( _
89  @FB_RTL_WSTRASSIGNAW, NULL, _
90  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
91  NULL, FB_RTL_OPT_NONE, _
92  4, _
93  { _
94  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
95  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
96  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
97  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
98  } _
99  ), _
100 /' sub fb_StrDelete( byref str as string ) '/ _
101  ( _
102  @FB_RTL_STRDELETE, NULL, _
103  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
104  NULL, FB_RTL_OPT_NONE, _
105  1, _
106  { _
107  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
108  } _
109  ), _
110 /' sub fb_WstrDelete( byval str as wstring ptr ) '/ _
111  ( _
112  @FB_RTL_WSTRDELETE, NULL, _
113  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
114  NULL, FB_RTL_OPT_NONE, _
115  1, _
116  { _
117  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
118  } _
119  ), _
120 /' function fb_StrConcat( byref dst as string, _
121  byref str1 as any, byval str1_size as integer, _
122  byref str2 as any, byval str2_size as integer ) as string '/ _
123  ( _
124  @FB_RTL_STRCONCAT, NULL, _
125  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
126  NULL, FB_RTL_OPT_NONE, _
127  5, _
128  { _
129  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
130  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
131  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
132  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
133  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
134  } _
135  ), _
136 /' function fb_WstrConcat( byval str1 as wstring ptr, byval str2 as wstring ptr ) as wstring '/ _
137  ( _
138  @FB_RTL_WSTRCONCAT, NULL, _
139  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
140  NULL, FB_RTL_OPT_NONE, _
141  2, _
142  { _
143  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
144  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
145  } _
146  ), _
147 /' function fb_WstrConcatWA( byval str1 as wstring ptr, _
148  byref str2 as any, byval str2_size as integer ) as wstring '/ _
149  ( _
150  @FB_RTL_WSTRCONCATWA, NULL, _
151  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
152  NULL, FB_RTL_OPT_NONE, _
153  3, _
154  { _
155  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
156  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
157  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
158  } _
159  ), _
160 /' function fb_WstrConcatAW( byref str1 as any, byval str1_size as integer, _
161  byval str2 as wstring ptr ) as wstring '/ _
162  ( _
163  @FB_RTL_WSTRCONCATAW, NULL, _
164  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
165  NULL, FB_RTL_OPT_NONE, _
166  3, _
167  { _
168  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
169  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
170  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
171  } _
172  ), _
173 /' function fb_StrCompare( byref str1 as any, byval str1_size as integer, _
174  byref str2 as any, byval str2_size as integer ) as long '/ _
175  ( _
176  @FB_RTL_STRCOMPARE, NULL, _
177  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
178  NULL, FB_RTL_OPT_NONE, _
179  4, _
180  { _
181  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
182  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
183  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
184  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
185  } _
186  ), _
187 /' function fb_WstrCompare( byval str1 as wstring ptr, byval str2 as wstring ptr ) as long '/ _
188  ( _
189  @FB_RTL_WSTRCOMPARE, NULL, _
190  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
191  NULL, FB_RTL_OPT_NONE, _
192  2, _
193  { _
194  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
195  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
196  } _
197  ), _
198 /' function fb_StrConcatAssign( byref dst as any, byval dst_size as integer, _
199  byref src as any, byval src_len as integer, _
200  byval fillrem as long = 1 ) as string '/ _
201  ( _
202  @FB_RTL_STRCONCATASSIGN, NULL, _
203  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
204  NULL, FB_RTL_OPT_NONE, _
205  5, _
206  { _
207  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
208  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
209  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
210  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
211  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 1 ) _
212  } _
213  ), _
214 /' function fb_WstrConcatAssign( byval dst as wstring ptr, byval dst_chars as integer, _
215  byval src as wstring ptr ) as wstring ptr '/ _
216  ( _
217  @FB_RTL_WSTRCONCATASSIGN, NULL, _
218  typeAddrOf( FB_DATATYPE_WCHAR ), FB_FUNCMODE_FBCALL, _
219  NULL, FB_RTL_OPT_NONE, _
220  3, _
221  { _
222  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
223  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
224  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
225  } _
226  ), _
227 /' function fb_StrAllocTempResult( byref str as string ) as string '/ _
228  ( _
229  @FB_RTL_STRALLOCTMPRES, NULL, _
230  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
231  NULL, FB_RTL_OPT_NONE, _
232  1, _
233  { _
234  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
235  } _
236  ), _
237 /' function fb_StrAllocTempDescV( byref str as string ) as string '/ _
238  ( _
239  @FB_RTL_STRALLOCTMPDESCV, NULL, _
240  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
241  NULL, FB_RTL_OPT_NONE, _
242  1, _
243  { _
244  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
245  } _
246  ), _
247 /' function fb_StrAllocTempDescF( byref str as any, byval str_size as integer ) as string '/ _
248  ( _
249  @FB_RTL_STRALLOCTMPDESCF, NULL, _
250  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
251  NULL, FB_RTL_OPT_NONE, _
252  2, _
253  { _
254  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
255  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
256  } _
257  ), _
258 /' function fb_StrAllocTempDescZ( byval str as zstring ptr ) as string '/ _
259  ( _
260  @FB_RTL_STRALLOCTMPDESCZ, NULL, _
261  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
262  NULL, FB_RTL_OPT_NONE, _
263  1, _
264  { _
265  ( typeAddrOf( FB_DATATYPE_CHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
266  } _
267  ), _
268 /' function fb_StrAllocTempDescZEx( byval str as zstring ptr, byval len as integer ) as string '/ _
269  ( _
270  @FB_RTL_STRALLOCTMPDESCZEX, NULL, _
271  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
272  NULL, FB_RTL_OPT_NONE, _
273  2, _
274  { _
275  ( typeAddrOf( FB_DATATYPE_CHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
276  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
277  } _
278  ), _
279 /' function fb_WstrAlloc( byval chars as integer ) as wstring ptr '/ _
280  ( _
281  @FB_RTL_WSTRALLOC, NULL, _
282  typeAddrOf( FB_DATATYPE_WCHAR ), FB_FUNCMODE_FBCALL, _
283  NULL, FB_RTL_OPT_NONE, _
284  1, _
285  { _
286  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
287  } _
288  ), _
289 /' function fb_IntToStr( byval num as long ) as string '/ _
290  ( _
291  @FB_RTL_INT2STR, NULL, _
292  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
293  NULL, FB_RTL_OPT_NONE, _
294  1, _
295  { _
296  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
297  } _
298  ), _
299 /' function fb_IntToStrQB( byval num as long ) as string '/ _
300  ( _
301  @FB_RTL_INT2STR_QB, NULL, _
302  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
303  NULL, FB_RTL_OPT_QBONLY, _
304  1, _
305  { _
306  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
307  } _
308  ), _
309 /' function fb_IntToWstr( byval num as long ) as wstring '/ _
310  ( _
311  @FB_RTL_INT2WSTR, NULL, _
312  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
313  NULL, FB_RTL_OPT_NONE, _
314  1, _
315  { _
316  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
317  } _
318  ), _
319 /' function fb_UIntToStr( byval num as ulong ) as string '/ _
320  ( _
321  @FB_RTL_UINT2STR, NULL, _
322  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
323  NULL, FB_RTL_OPT_NONE, _
324  1, _
325  { _
326  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
327  } _
328  ), _
329 /' function fb_UIntToStrQB( byval num as ulong ) as string '/ _
330  ( _
331  @FB_RTL_UINT2STR_QB, NULL, _
332  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
333  NULL, FB_RTL_OPT_QBONLY, _
334  1, _
335  { _
336  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
337  } _
338  ), _
339 /' function fb_UIntToWstr( byval num as ulong ) as wstring '/ _
340  ( _
341  @FB_RTL_UINT2WSTR, NULL, _
342  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
343  NULL, FB_RTL_OPT_NONE, _
344  1, _
345  { _
346  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
347  } _
348  ), _
349 /' function fb_LongintToStr( byval num as longint ) as string '/ _
350  ( _
351  @FB_RTL_LONGINT2STR, NULL, _
352  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
353  NULL, FB_RTL_OPT_NONE, _
354  1, _
355  { _
356  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
357  } _
358  ), _
359 /' function fb_LongintToStrQB( byval num as longint ) as string '/ _
360  ( _
361  @FB_RTL_LONGINT2STR_QB, NULL, _
362  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
363  NULL, FB_RTL_OPT_QBONLY, _
364  1, _
365  { _
366  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
367  } _
368  ), _
369 /' function fb_LongintToWstr( byval num as longint ) as wstring '/ _
370  ( _
371  @FB_RTL_LONGINT2WSTR, NULL, _
372  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
373  NULL, FB_RTL_OPT_NONE, _
374  1, _
375  { _
376  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
377  } _
378  ), _
379 /' function fb_ULongintToStr( byval num as ulongint ) as string '/ _
380  ( _
381  @FB_RTL_ULONGINT2STR, NULL, _
382  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
383  NULL, FB_RTL_OPT_NONE, _
384  1, _
385  { _
386  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
387  } _
388  ), _
389 /' function fb_ULongintToStrQB( byval num as ulongint ) as string '/ _
390  ( _
391  @FB_RTL_ULONGINT2STR_QB, NULL, _
392  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
393  NULL, FB_RTL_OPT_QBONLY, _
394  1, _
395  { _
396  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
397  } _
398  ), _
399 /' function fb_ULongintToWstr( byval num as ulongint ) as wstring '/ _
400  ( _
401  @FB_RTL_ULONGINT2WSTR, NULL, _
402  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
403  NULL, FB_RTL_OPT_NONE, _
404  1, _
405  { _
406  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
407  } _
408  ), _
409 /' function fb_FloatToStr( byval num as single ) as string '/ _
410  ( _
411  @FB_RTL_FLT2STR, NULL, _
412  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
413  NULL, FB_RTL_OPT_NONE, _
414  1, _
415  { _
416  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ) _
417  } _
418  ), _
419 /' function fb_FloatToStrQB( byval num as single ) as string '/ _
420  ( _
421  @FB_RTL_FLT2STR_QB, NULL, _
422  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
423  NULL, FB_RTL_OPT_QBONLY, _
424  1, _
425  { _
426  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ) _
427  } _
428  ), _
429 /' function fb_FloatToWstr( byval num as single ) as wstring '/ _
430  ( _
431  @FB_RTL_FLT2WSTR, NULL, _
432  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
433  NULL, FB_RTL_OPT_NONE, _
434  1, _
435  { _
436  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ) _
437  } _
438  ), _
439 /' function fb_DoubleToStr( byval num as double ) as string '/ _
440  ( _
441  @FB_RTL_DBL2STR, NULL, _
442  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
443  NULL, FB_RTL_OPT_NONE, _
444  1, _
445  { _
446  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ) _
447  } _
448  ), _
449 /' function fb_DoubleToStrQB( byval num as double ) as string '/ _
450  ( _
451  @FB_RTL_DBL2STR_QB, NULL, _
452  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
453  NULL, FB_RTL_OPT_QBONLY, _
454  1, _
455  { _
456  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ) _
457  } _
458  ), _
459 /' function fb_DoubleToWstr( byval num as double ) as wstring '/ _
460  ( _
461  @FB_RTL_DBL2WSTR, NULL, _
462  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
463  NULL, FB_RTL_OPT_NONE, _
464  1, _
465  { _
466  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ) _
467  } _
468  ), _
469 /' function fb_WstrToStr( byval str as wstring ptr ) as string '/ _
470  ( _
471  @FB_RTL_WSTR2STR, NULL, _
472  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
473  NULL, FB_RTL_OPT_NONE, _
474  1, _
475  { _
476  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
477  } _
478  ), _
479 /' function fb_StrToWstr( byval str as zstring ptr ) as wstring '/ _
480  ( _
481  @FB_RTL_STR2WSTR, NULL, _
482  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
483  NULL, FB_RTL_OPT_NONE, _
484  1, _
485  { _
486  ( typeAddrOf( FB_DATATYPE_CHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
487  } _
488  ), _
489 /' function fb_StrMid( byref str as string, byval start as integer, _
490  byval len as integer ) as string '/ _
491  ( _
492  @FB_RTL_STRMID, NULL, _
493  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
494  NULL, FB_RTL_OPT_NONE, _
495  3, _
496  { _
497  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
498  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
499  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
500  } _
501  ), _
502 /' function fb_WstrMid( byval dst as wstring ptr, byval start as integer, _
503  byval len as integer ) as wstring '/ _
504  ( _
505  @FB_RTL_WSTRMID, NULL, _
506  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
507  NULL, FB_RTL_OPT_NONE, _
508  3, _
509  { _
510  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
511  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
512  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
513  } _
514  ), _
515 /' sub fb_StrAssignMid( byref dst as string, byval start as integer, _
516  byval len as integer, byref src as string ) '/ _
517  ( _
518  @FB_RTL_STRASSIGNMID, NULL, _
519  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
520  NULL, FB_RTL_OPT_NONE, _
521  4, _
522  { _
523  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
524  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
525  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
526  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
527  } _
528  ), _
529 /' sub fb_WstrAssignMid ( byval dst as wstring ptr, byval dst_len as integer, _
530  byval start as integer, byval len as integer, _
531  byval src as wstring ptr ) '/ _
532  ( _
533  @FB_RTL_WSTRASSIGNMID, NULL, _
534  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
535  NULL, FB_RTL_OPT_NONE, _
536  5, _
537  { _
538  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
539  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
540  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
541  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
542  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
543  } _
544  ), _
545 /' function fb_StrFill1( byval cnt as integer, byval char as long ) as string '/ _
546  ( _
547  @FB_RTL_STRFILL1, NULL, _
548  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
549  NULL, FB_RTL_OPT_NONE, _
550  2, _
551  { _
552  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
553  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
554  } _
555  ), _
556 /' function fb_WstrFill1( byval chars as integer, byval c as long ) as wstring '/ _
557  ( _
558  @FB_RTL_WSTRFILL1, NULL, _
559  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
560  NULL, FB_RTL_OPT_NONE, _
561  2, _
562  { _
563  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
564  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
565  } _
566  ), _
567 /' fb_StrFill2( byval cnt as integer, byref src as string ) as string '/ _
568  ( _
569  @FB_RTL_STRFILL2, NULL, _
570  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
571  NULL, FB_RTL_OPT_NONE, _
572  2, _
573  { _
574  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
575  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
576  } _
577  ), _
578 /' function fb_WstrFill2( byval cnt as integer, byval src as wstring ptr ) as wstring '/ _
579  ( _
580  @FB_RTL_WSTRFILL2, NULL, _
581  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
582  NULL, FB_RTL_OPT_NONE, _
583  2, _
584  { _
585  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
586  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
587  } _
588  ), _
589 /' function fb_StrLen( byref str as any, byval str_size as integer ) as integer '/ _
590  ( _
591  @FB_RTL_STRLEN, NULL, _
592  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
593  NULL, FB_RTL_OPT_NONE, _
594  2, _
595  { _
596  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
597  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
598  } _
599  ), _
600 /' function fb_WstrLen( byval str as wstring ptr ) as integer '/ _
601  ( _
602  @FB_RTL_WSTRLEN, NULL, _
603  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
604  NULL, FB_RTL_OPT_NONE, _
605  1, _
606  { _
607  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
608  } _
609  ), _
610 /' sub fb_StrLset( byref dst as string, byref src as string ) '/ _
611  ( _
612  @FB_RTL_STRLSET, NULL, _
613  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
614  NULL, FB_RTL_OPT_NONE, _
615  2, _
616  { _
617  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
618  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
619  } _
620  ), _
621 /' sub fb_WstrLset( byval dst as wstring ptr, byval src as wstring ptr ) '/ _
622  ( _
623  @FB_RTL_WSTRLSET, NULL, _
624  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
625  NULL, FB_RTL_OPT_NONE, _
626  2, _
627  { _
628  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
629  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
630  } _
631  ), _
632 /' sub fb_StrRset overload( byref dst as string, byref src as string ) '/ _
633  ( _
634  @FB_RTL_STRRSET, NULL, _
635  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
636  NULL, FB_RTL_OPT_OVER, _
637  2, _
638  { _
639  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
640  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
641  } _
642  ), _
643 /' sub fb_WstrRset( byval dst as wstring ptr, byval src as wstring ptr ) '/ _
644  ( _
645  @FB_RTL_WSTRRSET, NULL, _
646  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
647  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
648  2, _
649  { _
650  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
651  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
652  } _
653  ), _
654 /' function fb_ASC( byref str as string, byval pos as integer = 0 ) as ulong '/ _
655  ( _
656  @FB_RTL_STRASC, NULL, _
657  FB_DATATYPE_ULONG, FB_FUNCMODE_FBCALL, _
658  NULL, FB_RTL_OPT_NONE, _
659  2, _
660  { _
661  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
662  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
663  } _
664  ), _
665 /' function fb_WstrAsc( byval str as wstring ptr, byval pos as integer = 0 ) as ulong '/ _
666  ( _
667  @FB_RTL_WSTRASC, NULL, _
668  FB_DATATYPE_ULONG, FB_FUNCMODE_FBCALL, _
669  NULL, FB_RTL_OPT_NONE, _
670  2, _
671  { _
672  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
673  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
674  } _
675  ), _
676 /' function fb_CHR cdecl( byval args as long, ... ) as string '/ _
677  ( _
678  @FB_RTL_STRCHR, NULL, _
679  FB_DATATYPE_STRING, FB_FUNCMODE_CDECL, _
680  NULL, FB_RTL_OPT_NONE, _
681  2, _
682  { _
683  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
684  ( FB_DATATYPE_INVALID, FB_PARAMMODE_VARARG, FALSE ) _
685  } _
686  ), _
687 /' function fb_WstrChr cdecl( byval args as long, ... ) as wstring '/ _
688  ( _
689  @FB_RTL_WSTRCHR, NULL, _
690  FB_DATATYPE_WCHAR, FB_FUNCMODE_CDECL, _
691  NULL, FB_RTL_OPT_NONE, _
692  2, _
693  { _
694  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
695  ( FB_DATATYPE_INVALID, FB_PARAMMODE_VARARG, FALSE ) _
696  } _
697  ), _
698 /' function fb_StrInstr( byval start as integer, byref src as string, _
699  byref patt as string ) as integer '/ _
700  ( _
701  @FB_RTL_STRINSTR, NULL, _
702  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
703  NULL, FB_RTL_OPT_NONE, _
704  3, _
705  { _
706  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
707  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
708  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
709  } _
710  ), _
711 /' function fb_WstrInstr( byval start as integer, byval src as wstring ptr, _
712  byval patt as wstring ptr ) as integer '/ _
713  ( _
714  @FB_RTL_WSTRINSTR, NULL, _
715  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
716  NULL, FB_RTL_OPT_NONE, _
717  3, _
718  { _
719  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
720  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
721  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
722  } _
723  ), _
724 /' function fb_StrInstrAny( byval start as integer, byref src as string, _
725  byref pattern as string ) as integer '/ _
726  ( _
727  @FB_RTL_STRINSTRANY, NULL, _
728  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
729  NULL, FB_RTL_OPT_NONE, _
730  3, _
731  { _
732  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
733  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
734  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
735  } _
736  ), _
737 /' function fb_WstrInstrAny( byval start as integer, byval src as wstring ptr, _
738  byval pattern as wstring ptr ) as integer '/ _
739  ( _
740  @FB_RTL_WSTRINSTRANY, NULL, _
741  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
742  NULL, FB_RTL_OPT_NONE, _
743  3, _
744  { _
745  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
746  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
747  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
748  } _
749  ), _
750 /' function fb_StrInstrRev( byref src as string, byref patt as string, _
751  byval start as integer ) as integer '/ _
752  ( _
753  @FB_RTL_STRINSTRREV, NULL, _
754  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
755  NULL, FB_RTL_OPT_NONE, _
756  3, _
757  { _
758  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
759  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
760  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
761  } _
762  ), _
763 /' function fb_WstrInstrRev( byval src as wstring ptr, byval patt as wstring ptr, _
764  byval start as integer ) as integer '/ _
765  ( _
766  @FB_RTL_WSTRINSTRREV, NULL, _
767  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
768  NULL, FB_RTL_OPT_NONE, _
769  3, _
770  { _
771  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
772  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
773  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
774  } _
775  ), _
776 /' function fb_StrInstrRevAny( byref src as string, byref patt as string, _
777  byval start as integer ) as integer '/ _
778  ( _
779  @FB_RTL_STRINSTRREVANY, NULL, _
780  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
781  NULL, FB_RTL_OPT_NONE, _
782  3, _
783  { _
784  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
785  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
786  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
787  } _
788  ), _
789 /' function fb_WstrInstrRevAny( byval src as wstring ptr, byval patt as wstring ptr, _
790  byval start as integer ) as integer '/ _
791  ( _
792  @FB_RTL_WSTRINSTRREVANY, NULL, _
793  FB_DATATYPE_INTEGER, FB_FUNCMODE_FBCALL, _
794  NULL, FB_RTL_OPT_NONE, _
795  3, _
796  { _
797  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
798  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
799  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
800  } _
801  ), _
802 /' function fb_TRIM( byref str as string ) as string '/ _
803  ( _
804  @FB_RTL_STRTRIM, NULL, _
805  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
806  NULL, FB_RTL_OPT_NONE, _
807  1, _
808  { _
809  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
810  } _
811  ), _
812 /' function fb_WstrTrim( byval str as wstring ptr ) as wstring '/ _
813  ( _
814  @FB_RTL_WSTRTRIM, NULL, _
815  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
816  NULL, FB_RTL_OPT_NONE, _
817  1, _
818  { _
819  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
820  } _
821  ), _
822 /' function fb_TrimAny( byref str as string, byref pattern as string ) as string '/ _
823  ( _
824  @FB_RTL_STRTRIMANY, NULL, _
825  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
826  NULL, FB_RTL_OPT_NONE, _
827  2, _
828  { _
829  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
830  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
831  } _
832  ), _
833 /' function fb_WstrTrimAny( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
834  ( _
835  @FB_RTL_WSTRTRIMANY, NULL, _
836  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
837  NULL, FB_RTL_OPT_NONE, _
838  2, _
839  { _
840  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
841  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
842  } _
843  ), _
844 /' function fb_TrimEx( byref str as string, byref pattern as string ) as string '/ _
845  ( _
846  @FB_RTL_STRTRIMEX, NULL, _
847  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
848  NULL, FB_RTL_OPT_NONE, _
849  2, _
850  { _
851  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
852  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
853  } _
854  ), _
855 /' function fb_WstrTrimEx( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
856  ( _
857  @FB_RTL_WSTRTRIMEX, NULL, _
858  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
859  NULL, FB_RTL_OPT_NONE, _
860  2, _
861  { _
862  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
863  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
864  } _
865  ), _
866 /' function fb_RTRIM( byref str as string ) as string '/ _
867  ( _
868  @FB_RTL_STRRTRIM, NULL, _
869  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
870  NULL, FB_RTL_OPT_NONE, _
871  1, _
872  { _
873  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
874  } _
875  ), _
876 /' function fb_WstrRTrim( byval str as wstring ptr ) as wstring '/ _
877  ( _
878  @FB_RTL_WSTRRTRIM, NULL, _
879  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
880  NULL, FB_RTL_OPT_NONE, _
881  1, _
882  { _
883  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
884  } _
885  ), _
886 /' function fb_RTrimAny( byref str as string, byref pattern as string ) as string '/ _
887  ( _
888  @FB_RTL_STRRTRIMANY, NULL, _
889  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
890  NULL, FB_RTL_OPT_NONE, _
891  2, _
892  { _
893  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
894  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
895  } _
896  ), _
897 /' function fb_WstrRTrimAny( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
898  ( _
899  @FB_RTL_WSTRRTRIMANY, NULL, _
900  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
901  NULL, FB_RTL_OPT_NONE, _
902  2, _
903  { _
904  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
905  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
906  } _
907  ), _
908 /' function fb_RTrimEx( byref str as string, byref pattern as string ) as string '/ _
909  ( _
910  @FB_RTL_STRRTRIMEX, NULL, _
911  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
912  NULL, FB_RTL_OPT_NONE, _
913  2, _
914  { _
915  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
916  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
917  } _
918  ), _
919 /' function fb_WstrRTrimEx( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
920  ( _
921  @FB_RTL_WSTRRTRIMEX, NULL, _
922  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
923  NULL, FB_RTL_OPT_NONE, _
924  2, _
925  { _
926  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
927  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
928  } _
929  ), _
930 /' function fb_LTRIM( byref str as string ) as string '/ _
931  ( _
932  @FB_RTL_STRLTRIM, NULL, _
933  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
934  NULL, FB_RTL_OPT_NONE, _
935  1, _
936  { _
937  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
938  } _
939  ), _
940 /' function fb_WstrLTrim( byval str as wstring ptr ) as wstring '/ _
941  ( _
942  @FB_RTL_WSTRLTRIM, NULL, _
943  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
944  NULL, FB_RTL_OPT_NONE, _
945  1, _
946  { _
947  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
948  } _
949  ), _
950 /' function fb_LTrimAny( byref str as string, byref pattern as string ) as string '/ _
951  ( _
952  @FB_RTL_STRLTRIMANY, NULL, _
953  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
954  NULL, FB_RTL_OPT_NONE, _
955  2, _
956  { _
957  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
958  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
959  } _
960  ), _
961 /' function fb_WstrLTrimAny( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
962  ( _
963  @FB_RTL_WSTRLTRIMANY, NULL, _
964  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
965  NULL, FB_RTL_OPT_NONE, _
966  2, _
967  { _
968  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
969  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
970  } _
971  ), _
972 /' function fb_LTrimEx( byref str as string, byref pattern as string ) as string '/ _
973  ( _
974  @FB_RTL_STRLTRIMEX, NULL, _
975  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
976  NULL, FB_RTL_OPT_NONE, _
977  2, _
978  { _
979  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
980  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
981  } _
982  ), _
983 /' function fb_WstrLTrimEx( byval str as wstring ptr, byval pattern as wstring ptr ) as wstring '/ _
984  ( _
985  @FB_RTL_WSTRLTRIMEX, NULL, _
986  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
987  NULL, FB_RTL_OPT_NONE, _
988  2, _
989  { _
990  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
991  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
992  } _
993  ), _
994 /' sub fb_StrSwap( byref str1 as any, byval size1 as integer, byval fillrem1 as long, _
995  byref str2 as any, byval size2 as integer, byval fillrem2 as long ) '/ _
996  ( _
997  @FB_RTL_STRSWAP, NULL, _
998  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
999  NULL, FB_RTL_OPT_NONE, _
1000  6, _
1001  { _
1002  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
1003  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
1004  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ), _
1005  ( FB_DATATYPE_VOID, FB_PARAMMODE_BYREF, FALSE ), _
1006  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
1007  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1008  } _
1009  ), _
1010 /' sub fb_WstrSwap( byval str1 as wstring ptr, byval size1 as integer, _
1011  byval str2 as wstring ptr, byval size2 as integer ) '/ _
1012  ( _
1013  @FB_RTL_WSTRSWAP, NULL, _
1014  FB_DATATYPE_VOID, FB_FUNCMODE_FBCALL, _
1015  NULL, FB_RTL_OPT_NONE, _
1016  4, _
1017  { _
1018  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1019  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ), _
1020  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1021  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1022  } _
1023  ), _
1024 /' function val overload( byref str as string ) as double '/ _
1025  ( _
1026  @FB_RTL_STR2DBL, @"fb_VAL", _
1027  FB_DATATYPE_DOUBLE, FB_FUNCMODE_FBCALL, _
1028  NULL, FB_RTL_OPT_OVER, _
1029  1, _
1030  { _
1031  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1032  } _
1033  ), _
1034 /' function val overload( byval str as wstring ptr ) as double '/ _
1035  ( _
1036  @FB_RTL_STR2DBL, @"fb_WstrVal", _
1037  FB_DATATYPE_DOUBLE, FB_FUNCMODE_FBCALL, _
1038  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1039  1, _
1040  { _
1041  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
1042  } _
1043  ), _
1044 /' function valint overload( byref str as string ) as long '/ _
1045  ( _
1046  @FB_RTL_STR2INT, @"fb_VALINT", _
1047  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
1048  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1049  1, _
1050  { _
1051  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1052  } _
1053  ), _
1054 /' function valint overload( byval str as wstring ptr ) as long '/ _
1055  ( _
1056  @FB_RTL_STR2INT, @"fb_WstrValInt", _
1057  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
1058  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1059  1, _
1060  { _
1061  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
1062  } _
1063  ), _
1064 /' function valuint overload( byref str as string ) as ulong '/ _
1065  ( _
1066  @FB_RTL_STR2UINT, @"fb_VALUINT", _
1067  FB_DATATYPE_ULONG, FB_FUNCMODE_FBCALL, _
1068  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1069  1, _
1070  { _
1071  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1072  } _
1073  ), _
1074 /' function valuint overload( byval str as wstring ptr ) as ulong '/ _
1075  ( _
1076  @FB_RTL_STR2UINT, @"fb_WstrValUInt", _
1077  FB_DATATYPE_ULONG, FB_FUNCMODE_FBCALL, _
1078  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1079  1, _
1080  { _
1081  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
1082  } _
1083  ), _
1084 /' function vallng overload( byref str as string ) as longint '/ _
1085  ( _
1086  @FB_RTL_STR2LNG, @"fb_VALLNG", _
1087  FB_DATATYPE_LONGINT, FB_FUNCMODE_FBCALL, _
1088  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1089  1, _
1090  { _
1091  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1092  } _
1093  ), _
1094 /' function vallng overload( byval str as wstring ptr ) as longint '/ _
1095  ( _
1096  @FB_RTL_STR2LNG, @"fb_WstrValLng", _
1097  FB_DATATYPE_LONGINT, FB_FUNCMODE_FBCALL, _
1098  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1099  1, _
1100  { _
1101  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
1102  } _
1103  ), _
1104 /' function valulng overload( byref str as string ) as ulongint '/ _
1105  ( _
1106  @FB_RTL_STR2ULNG, @"fb_VALULNG", _
1107  FB_DATATYPE_ULONGINT, FB_FUNCMODE_FBCALL, _
1108  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1109  1, _
1110  { _
1111  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1112  } _
1113  ), _
1114 /' function valulng overload( byval str as wstring ptr ) as ulongint '/ _
1115  ( _
1116  @FB_RTL_STR2ULNG, @"fb_WstrValULng", _
1117  FB_DATATYPE_ULONGINT, FB_FUNCMODE_FBCALL, _
1118  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1119  1, _
1120  { _
1121  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ) _
1122  } _
1123  ), _
1124 /' function hex overload( byval number as ubyte ) as string '/ _
1125  ( _
1126  @"hex", @"fb_HEX_b", _
1127  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1128  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1129  1, _
1130  { _
1131  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1132  } _
1133  ), _
1134 /' function hex overload( byval number as ushort ) as string '/ _
1135  ( _
1136  @"hex", @"fb_HEX_s", _
1137  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1138  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1139  1, _
1140  { _
1141  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1142  } _
1143  ), _
1144 /' function hex overload( byval number as ulong ) as string '/ _
1145  ( _
1146  @"hex", @"fb_HEX_i", _
1147  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1148  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1149  1, _
1150  { _
1151  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1152  } _
1153  ), _
1154 /' function hex overload( byval number as ulongint ) as string '/ _
1155  ( _
1156  @"hex", @"fb_HEX_l", _
1157  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1158  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1159  1, _
1160  { _
1161  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1162  } _
1163  ), _
1164 /' function hex overload( byval number as any ptr ) as string '/ _
1165  ( _
1166  @"hex", @"fb_HEX_p", _
1167  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1168  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1169  1, _
1170  { _
1171  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1172  } _
1173  ), _
1174 /' function hex overload( byval number as ubyte, byval digits as long ) as string '/ _
1175  ( _
1176  @"hex", @"fb_HEXEx_b", _
1177  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1178  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1179  2, _
1180  { _
1181  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1182  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1183  } _
1184  ), _
1185 /' function hex overload( byval number as ushort, byval digits as long ) as string '/ _
1186  ( _
1187  @"hex", @"fb_HEXEx_s", _
1188  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1189  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1190  2, _
1191  { _
1192  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1193  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1194  } _
1195  ), _
1196 /' function hex overload( byval number as ulong, byval digits as long ) as string '/ _
1197  ( _
1198  @"hex", @"fb_HEXEx_i", _
1199  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1200  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1201  2, _
1202  { _
1203  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1204  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1205  } _
1206  ), _
1207 /' function hex overload( byval number as ulongint, byval digits as long ) as string '/ _
1208  ( _
1209  @"hex", @"fb_HEXEx_l", _
1210  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1211  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1212  2, _
1213  { _
1214  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1215  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1216  } _
1217  ), _
1218 /' function hex overload( byval number as any ptr, byval digits as long ) as string '/ _
1219  ( _
1220  @"hex", @"fb_HEXEx_p", _
1221  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1222  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1223  2, _
1224  { _
1225  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1226  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1227  } _
1228  ), _
1229 /' function whex overload( byval number as ubyte ) as wstring '/ _
1230  ( _
1231  @"whex", @"fb_WstrHex_b", _
1232  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1233  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1234  1, _
1235  { _
1236  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1237  } _
1238  ), _
1239 /' function whex overload( byval number as ushort ) as wstring '/ _
1240  ( _
1241  @"whex", @"fb_WstrHex_s", _
1242  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1243  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1244  1, _
1245  { _
1246  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1247  } _
1248  ), _
1249 /' function whex overload( byval number as ulong ) as wstring '/ _
1250  ( _
1251  @"whex", @"fb_WstrHex_i", _
1252  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1253  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1254  1, _
1255  { _
1256  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1257  } _
1258  ), _
1259 /' function whex overload( byval number as ulongint ) as wstring '/ _
1260  ( _
1261  @"whex", @"fb_WstrHex_l", _
1262  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1263  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1264  1, _
1265  { _
1266  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1267  } _
1268  ), _
1269 /' function whex overload( byval number as any ptr ) as wstring '/ _
1270  ( _
1271  @"whex", @"fb_WstrHex_p", _
1272  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1273  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1274  1, _
1275  { _
1276  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1277  } _
1278  ), _
1279 /' function whex overload( byval number as ubyte, byval digits as long ) as wstring '/ _
1280  ( _
1281  @"whex", @"fb_WstrHexEx_b", _
1282  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1283  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1284  2, _
1285  { _
1286  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1287  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1288  } _
1289  ), _
1290 /' function whex overload( byval number as ushort, byval digits as long ) as wstring '/ _
1291  ( _
1292  @"whex", @"fb_WstrHexEx_s", _
1293  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1294  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1295  2, _
1296  { _
1297  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1298  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1299  } _
1300  ), _
1301 /' function whex overload( byval number as ulong, byval digits as long ) as wstring '/ _
1302  ( _
1303  @"whex", @"fb_WstrHexEx_i", _
1304  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1305  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1306  2, _
1307  { _
1308  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1309  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1310  } _
1311  ), _
1312 /' function whex overload( byval number as ulongint, byval digits as long ) as wstring '/ _
1313  ( _
1314  @"whex", @"fb_WstrHexEx_l", _
1315  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1316  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1317  2, _
1318  { _
1319  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1320  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1321  } _
1322  ), _
1323 /' function whex overload( byval number as any ptr, byval digits as long ) as wstring '/ _
1324  ( _
1325  @"whex", @"fb_WstrHexEx_p", _
1326  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1327  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1328  2, _
1329  { _
1330  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1331  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1332  } _
1333  ), _
1334 /' function oct overload( byval number as ubyte ) as string '/ _
1335  ( _
1336  @"oct", @"fb_OCT_b", _
1337  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1338  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1339  1, _
1340  { _
1341  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1342  } _
1343  ), _
1344 /' function oct overload( byval number as ushort ) as string '/ _
1345  ( _
1346  @"oct", @"fb_OCT_s", _
1347  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1348  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1349  1, _
1350  { _
1351  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1352  } _
1353  ), _
1354 /' function oct overload( byval number as ulong ) as string '/ _
1355  ( _
1356  @"oct", @"fb_OCT_i", _
1357  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1358  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1359  1, _
1360  { _
1361  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1362  } _
1363  ), _
1364 /' function oct overload( byval number as ulongint ) as string '/ _
1365  ( _
1366  @"oct", @"fb_OCT_l", _
1367  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1368  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1369  1, _
1370  { _
1371  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1372  } _
1373  ), _
1374 /' function oct overload( byval number as any ptr ) as string '/ _
1375  ( _
1376  @"oct", @"fb_OCT_p", _
1377  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1378  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1379  1, _
1380  { _
1381  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1382  } _
1383  ), _
1384 /' function oct overload( byval number as ubyte, byval digits as long ) as string '/ _
1385  ( _
1386  @"oct", @"fb_OCTEx_b", _
1387  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1388  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1389  2, _
1390  { _
1391  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1392  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1393  } _
1394  ), _
1395 /' function oct overload( byval number as ushort, byval digits as long ) as string '/ _
1396  ( _
1397  @"oct", @"fb_OCTEx_s", _
1398  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1399  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1400  2, _
1401  { _
1402  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1403  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1404  } _
1405  ), _
1406 /' function oct overload( byval number as ulong, byval digits as long ) as string '/ _
1407  ( _
1408  @"oct", @"fb_OCTEx_i", _
1409  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1410  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1411  2, _
1412  { _
1413  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1414  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1415  } _
1416  ), _
1417 /' function oct overload( byval number as ulongint, byval digits as long ) as string '/ _
1418  ( _
1419  @"oct", @"fb_OCTEx_l", _
1420  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1421  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1422  2, _
1423  { _
1424  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1425  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1426  } _
1427  ), _
1428 /' function oct overload( byval number as any ptr, byval digits as long ) as string '/ _
1429  ( _
1430  @"oct", @"fb_OCTEx_p", _
1431  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1432  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1433  2, _
1434  { _
1435  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1436  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1437  } _
1438  ), _
1439 /' function woct overload( byval number as ubyte ) as wstring '/ _
1440  ( _
1441  @"woct", @"fb_WstrOct_b", _
1442  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1443  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1444  1, _
1445  { _
1446  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1447  } _
1448  ), _
1449 /' function woct overload( byval number as ushort ) as wstring '/ _
1450  ( _
1451  @"woct", @"fb_WstrOct_s", _
1452  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1453  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1454  1, _
1455  { _
1456  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1457  } _
1458  ), _
1459 /' function woct overload( byval number as ulong ) as wstring '/ _
1460  ( _
1461  @"woct", @"fb_WstrOct_i", _
1462  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1463  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1464  1, _
1465  { _
1466  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1467  } _
1468  ), _
1469 /' function woct overload( byval number as ulongint ) as wstring '/ _
1470  ( _
1471  @"woct", @"fb_WstrOct_l", _
1472  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1473  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1474  1, _
1475  { _
1476  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1477  } _
1478  ), _
1479 /' function woct overload( byval number as any ptr ) as wstring '/ _
1480  ( _
1481  @"woct", @"fb_WstrOct_p", _
1482  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1483  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1484  1, _
1485  { _
1486  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1487  } _
1488  ), _
1489 /' function woct overload( byval number as ubyte, byval digits as long ) as wstring '/ _
1490  ( _
1491  @"woct", @"fb_WstrOctEx_b", _
1492  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1493  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1494  2, _
1495  { _
1496  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1497  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1498  } _
1499  ), _
1500 /' function woct overload( byval number as ushort, byval digits as long ) as wstring '/ _
1501  ( _
1502  @"woct", @"fb_WstrOctEx_s", _
1503  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1504  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1505  2, _
1506  { _
1507  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1508  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1509  } _
1510  ), _
1511 /' function woct overload( byval number as ulong, byval digits as long ) as wstring '/ _
1512  ( _
1513  @"woct", @"fb_WstrOctEx_i", _
1514  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1515  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1516  2, _
1517  { _
1518  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1519  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1520  } _
1521  ), _
1522 /' function woct overload( byval number as ulongint, byval digits as long ) as wstring '/ _
1523  ( _
1524  @"woct", @"fb_WstrOctEx_l", _
1525  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1526  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1527  2, _
1528  { _
1529  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1530  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1531  } _
1532  ), _
1533 /' function woct overload( byval number as any ptr, byval digits as long ) as wstring '/ _
1534  ( _
1535  @"woct", @"fb_WstrOctEx_p", _
1536  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1537  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1538  2, _
1539  { _
1540  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1541  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1542  } _
1543  ), _
1544 /' function bin overload( byval number as ubyte ) as string '/ _
1545  ( _
1546  @"bin", @"fb_BIN_b", _
1547  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1548  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1549  1, _
1550  { _
1551  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1552  } _
1553  ), _
1554 /' function bin overload( byval number as ushort ) as string '/ _
1555  ( _
1556  @"bin", @"fb_BIN_s", _
1557  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1558  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1559  1, _
1560  { _
1561  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1562  } _
1563  ), _
1564 /' function bin overload( byval number as ulong ) as string '/ _
1565  ( _
1566  @"bin", @"fb_BIN_i", _
1567  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1568  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1569  1, _
1570  { _
1571  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1572  } _
1573  ), _
1574 /' function bin overload( byval number as ulongint ) as string '/ _
1575  ( _
1576  @"bin", @"fb_BIN_l", _
1577  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1578  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1579  1, _
1580  { _
1581  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1582  } _
1583  ), _
1584 /' function bin overload( byval number as any ptr ) as string '/ _
1585  ( _
1586  @"bin", @"fb_BIN_p", _
1587  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1588  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1589  1, _
1590  { _
1591  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1592  } _
1593  ), _
1594 /' function bin overload( byval number as ubyte, byval digits as long ) as string '/ _
1595  ( _
1596  @"bin", @"fb_BINEx_b", _
1597  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1598  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1599  2, _
1600  { _
1601  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1602  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1603  } _
1604  ), _
1605 /' function bin overload( byval number as ushort, byval digits as long ) as string '/ _
1606  ( _
1607  @"bin", @"fb_BINEx_s", _
1608  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1609  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1610  2, _
1611  { _
1612  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1613  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1614  } _
1615  ), _
1616 /' function bin overload( byval number as ulong, byval digits as long ) as string '/ _
1617  ( _
1618  @"bin", @"fb_BINEx_i", _
1619  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1620  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1621  2, _
1622  { _
1623  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1624  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1625  } _
1626  ), _
1627 /' function bin overload( byval number as ulongint, byval digits as long ) as string '/ _
1628  ( _
1629  @"bin", @"fb_BINEx_l", _
1630  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1631  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1632  2, _
1633  { _
1634  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1635  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1636  } _
1637  ), _
1638 /' function bin overload( byval number as any ptr, byval digits as long ) as string '/ _
1639  ( _
1640  @"bin", @"fb_BINEx_p", _
1641  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1642  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1643  2, _
1644  { _
1645  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1646  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1647  } _
1648  ), _
1649 /' function wbin overload( byval number as ubyte ) as wstring '/ _
1650  ( _
1651  @"wbin", @"fb_WstrBin_b", _
1652  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1653  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1654  1, _
1655  { _
1656  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ) _
1657  } _
1658  ), _
1659 /' function wbin overload( byval number as ushort ) as wstring '/ _
1660  ( _
1661  @"wbin", @"fb_WstrBin_s", _
1662  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1663  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1664  1, _
1665  { _
1666  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1667  } _
1668  ), _
1669 /' function wbin overload( byval number as ulong ) as wstring '/ _
1670  ( _
1671  @"wbin", @"fb_WstrBin_i", _
1672  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1673  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1674  1, _
1675  { _
1676  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ) _
1677  } _
1678  ), _
1679 /' function wbin overload( byval number as ulongint ) as wstring '/ _
1680  ( _
1681  @"wbin", @"fb_WstrBin_l", _
1682  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1683  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1684  1, _
1685  { _
1686  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1687  } _
1688  ), _
1689 /' function wbin overload( byval number as any ptr ) as wstring '/ _
1690  ( _
1691  @"wbin", @"fb_WstrBin_p", _
1692  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1693  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1694  1, _
1695  { _
1696  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ) _
1697  } _
1698  ), _
1699 /' function wbin overload( byval number as ubyte, byval digits as long ) as wstring '/ _
1700  ( _
1701  @"wbin", @"fb_WstrBinEx_b", _
1702  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1703  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1704  2, _
1705  { _
1706  ( FB_DATATYPE_UBYTE, FB_PARAMMODE_BYVAL, FALSE ), _
1707  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1708  } _
1709  ), _
1710 /' function wbin overload( byval number as ushort, byval digits as long ) as wstring '/ _
1711  ( _
1712  @"wbin", @"fb_WstrBinEx_s", _
1713  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1714  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1715  2, _
1716  { _
1717  ( FB_DATATYPE_USHORT, FB_PARAMMODE_BYVAL, FALSE ), _
1718  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1719  } _
1720  ), _
1721 /' function wbin overload( byval number as ulong, byval digits as long ) as wstring '/ _
1722  ( _
1723  @"wbin", @"fb_WstrBinEx_i", _
1724  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1725  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1726  2, _
1727  { _
1728  ( FB_DATATYPE_ULONG, FB_PARAMMODE_BYVAL, FALSE ), _
1729  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1730  } _
1731  ), _
1732 /' function wbin overload( byval number as ulongint, byval digits as long ) as wstring '/ _
1733  ( _
1734  @"wbin", @"fb_WstrBinEx_l", _
1735  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1736  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1737  2, _
1738  { _
1739  ( FB_DATATYPE_ULONGINT, FB_PARAMMODE_BYVAL, FALSE ), _
1740  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1741  } _
1742  ), _
1743 /' function wbin overload( byval number as any ptr, byval digits as long ) as wstring '/ _
1744  ( _
1745  @"wbin", @"fb_WstrBinEx_p", _
1746  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1747  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1748  2, _
1749  { _
1750  ( typeAddrOf( FB_DATATYPE_VOID ), FB_PARAMMODE_BYVAL, FALSE ), _
1751  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1752  } _
1753  ), _
1754 /' function fb_MKD( byval number as double ) as string '/ _
1755  ( _
1756  @FB_RTL_MKD, NULL, _
1757  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1758  NULL, FB_RTL_OPT_NONE, _
1759  1, _
1760  { _
1761  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ) _
1762  } _
1763  ), _
1764 /' function fb_MKS( byval number as single ) as string '/ _
1765  ( _
1766  @FB_RTL_MKS, NULL, _
1767  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1768  NULL, FB_RTL_OPT_NONE, _
1769  1, _
1770  { _
1771  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ) _
1772  } _
1773  ), _
1774 /' function fb_MKSHORT( byval number as short ) as string '/ _
1775  ( _
1776  @FB_RTL_MKSHORT, NULL, _
1777  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1778  NULL, FB_RTL_OPT_NOQB, _
1779  1, _
1780  { _
1781  ( FB_DATATYPE_SHORT, FB_PARAMMODE_BYVAL, FALSE ) _
1782  } _
1783  ), _
1784 /' function fb_MKI( byval number as integer ) as string '/ _
1785  ( _
1786  @FB_RTL_MKI, NULL, _
1787  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1788  NULL, FB_RTL_OPT_NONE, _
1789  1, _
1790  { _
1791  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1792  } _
1793  ), _
1794 /' function fb_MKL( byval number as long ) as string '/ _
1795  ( _
1796  @FB_RTL_MKL, NULL, _
1797  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1798  NULL, FB_RTL_OPT_NONE, _
1799  1, _
1800  { _
1801  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1802  } _
1803  ), _
1804 /' function fb_MKLONGINT( byval number as longint ) as string '/ _
1805  ( _
1806  @FB_RTL_MKLONGINT, NULL, _
1807  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1808  NULL, FB_RTL_OPT_NOQB, _
1809  1, _
1810  { _
1811  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1812  } _
1813  ), _
1814 /' function left overload( byref str as string, byval chars as integer ) as string '/ _
1815  ( _
1816  @"left", @"fb_LEFT", _
1817  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1818  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1819  2, _
1820  { _
1821  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
1822  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1823  } _
1824  ), _
1825 /' function left overload( byval str as wstring ptr, byval chars as integer ) as wstring '/ _
1826  ( _
1827  @"left", @"fb_WstrLeft", _
1828  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1829  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1830  2, _
1831  { _
1832  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1833  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1834  } _
1835  ), _
1836 /' function right overload( byref str as string, byval chars as integer ) as string '/ _
1837  ( _
1838  @"right", @"fb_RIGHT", _
1839  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1840  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_STRSUFFIX, _
1841  2, _
1842  { _
1843  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
1844  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1845  } _
1846  ), _
1847 /' function right overload( byval str as wstring ptr, byval chars as integer ) as wstring '/ _
1848  ( _
1849  @"right", @"fb_WstrRight", _
1850  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1851  NULL, FB_RTL_OPT_OVER or FB_RTL_OPT_NOQB, _
1852  2, _
1853  { _
1854  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1855  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1856  } _
1857  ), _
1858 /' function space( byval chars as integer ) as string '/ _
1859  ( _
1860  @"space", @"fb_SPACE", _
1861  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1862  NULL, FB_RTL_OPT_STRSUFFIX, _
1863  1, _
1864  { _
1865  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1866  } _
1867  ), _
1868 /' function wspace( byval chars as integer ) as wstring '/ _
1869  ( _
1870  @"wspace", @"fb_WstrSpace", _
1871  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1872  NULL, FB_RTL_OPT_NOQB, _
1873  1, _
1874  { _
1875  ( FB_DATATYPE_INTEGER, FB_PARAMMODE_BYVAL, FALSE ) _
1876  } _
1877  ), _
1878 /' function fb_StrLcase2( byref src as string, byval mode as long = 0 ) as string '/ _
1879  ( _
1880  @FB_RTL_STRLCASE2, NULL, _
1881  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1882  NULL, FB_RTL_OPT_NONE, _
1883  2, _
1884  { _
1885  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
1886  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
1887  } _
1888  ), _
1889 /' function fb_WstrLcase2( byval src as wstring ptr, byval mode as long = 0 ) as wstring '/ _
1890  ( _
1891  @FB_RTL_WSTRLCASE2, NULL, _
1892  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1893  NULL, FB_RTL_OPT_NONE, _
1894  2, _
1895  { _
1896  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1897  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
1898  } _
1899  ), _
1900 /' function fb_StrUcase2( byref src as string, byval mode as long = 0 ) as string '/ _
1901  ( _
1902  @FB_RTL_STRUCASE2, NULL, _
1903  FB_DATATYPE_STRING, FB_FUNCMODE_FBCALL, _
1904  NULL, FB_RTL_OPT_NONE, _
1905  2, _
1906  { _
1907  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ), _
1908  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
1909  } _
1910  ), _
1911 /' function fb_WstrUcase2( byval src as wstring ptr, byval mode as long = 0 ) as wstring '/ _
1912  ( _
1913  @FB_RTL_WSTRUCASE2, NULL, _
1914  FB_DATATYPE_WCHAR, FB_FUNCMODE_FBCALL, _
1915  NULL, FB_RTL_OPT_NONE, _
1916  2, _
1917  { _
1918  ( typeAddrOf( FB_DATATYPE_WCHAR ), FB_PARAMMODE_BYVAL, FALSE ), _
1919  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, TRUE, 0 ) _
1920  } _
1921  ), _
1922 /' function fb_CVD( byref str as string ) as double '/ _
1923  ( _
1924  @FB_RTL_CVD, @"fb_CVD", _
1925  FB_DATATYPE_DOUBLE, FB_FUNCMODE_FBCALL, _
1926  NULL, FB_RTL_OPT_NONE, _
1927  1, _
1928  { _
1929  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1930  } _
1931  ), _
1932 /' function fb_CVS( byref str as string ) as single '/ _
1933  ( _
1934  @FB_RTL_CVS, @"fb_CVS", _
1935  FB_DATATYPE_SINGLE, FB_FUNCMODE_FBCALL, _
1936  NULL, FB_RTL_OPT_NONE, _
1937  1, _
1938  { _
1939  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1940  } _
1941  ), _
1942 /' function fb_CVSHORT( byref str as string ) as short '/ _
1943  ( _
1944  @FB_RTL_CVSHORT, @"fb_CVSHORT", _
1945  FB_DATATYPE_SHORT, FB_FUNCMODE_FBCALL, _
1946  NULL, FB_RTL_OPT_NOQB, _
1947  1, _
1948  { _
1949  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1950  } _
1951  ), _
1952 /' function fb_CVL( byref str as string ) as long '/ _
1953  ( _
1954  @FB_RTL_CVL, NULL, _
1955  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
1956  NULL, FB_RTL_OPT_NONE, _
1957  1, _
1958  { _
1959  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1960  } _
1961  ), _
1962 /' function fb_CVLONGINT( byref str as string ) as longint '/ _
1963  ( _
1964  @FB_RTL_CVLONGINT, @"fb_CVLONGINT", _
1965  FB_DATATYPE_LONGINT, FB_FUNCMODE_FBCALL, _
1966  NULL, FB_RTL_OPT_NOQB, _
1967  1, _
1968  { _
1969  ( FB_DATATYPE_STRING, FB_PARAMMODE_BYREF, FALSE ) _
1970  } _
1971  ), _
1972 /' function fb_CVDFROMLONGINT( byval num as longint ) as double '/ _
1973  ( _
1974  @FB_RTL_CVDFROMLONGINT, @"fb_CVDFROMLONGINT", _
1975  FB_DATATYPE_DOUBLE, FB_FUNCMODE_FBCALL, _
1976  NULL, FB_RTL_OPT_NOQB, _
1977  1, _
1978  { _
1979  ( FB_DATATYPE_LONGINT, FB_PARAMMODE_BYVAL, FALSE ) _
1980  } _
1981  ), _
1982 /' function fb_CVSFROML( byref num as long ) as single '/ _
1983  ( _
1984  @FB_RTL_CVSFROML, @"fb_CVSFROML", _
1985  FB_DATATYPE_SINGLE, FB_FUNCMODE_FBCALL, _
1986  NULL, FB_RTL_OPT_NOQB, _
1987  1, _
1988  { _
1989  ( FB_DATATYPE_LONG, FB_PARAMMODE_BYVAL, FALSE ) _
1990  } _
1991  ), _
1992 /' function fb_CVLFROMS( byval num as single ) as long '/ _
1993  ( _
1994  @FB_RTL_CVLFROMS, @"fb_CVLFROMS", _
1995  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
1996  NULL, FB_RTL_OPT_NOQB, _
1997  1, _
1998  { _
1999  ( FB_DATATYPE_SINGLE, FB_PARAMMODE_BYVAL, FALSE ) _
2000  } _
2001  ), _
2002 /' function fb_CVLONGINTFROMD( byval num as double ) as longint '/ _
2003  ( _
2004  @FB_RTL_CVLONGINTFROMD, @"fb_CVLONGINTFROMD", _
2005  FB_DATATYPE_LONGINT, FB_FUNCMODE_FBCALL, _
2006  NULL, FB_RTL_OPT_NOQB, _
2007  1, _
2008  { _
2009  ( FB_DATATYPE_DOUBLE, FB_PARAMMODE_BYVAL, FALSE ) _
2010  } _
2011  ), _
2012 /' EOL '/ _
2013  ( _
2014  NULL _
2015  ) _
2016  }
2017 
2018 '':::::
2020 
2022 
2023 end sub
2024 
2025 '':::::
2027 
2028  '' procs will be deleted when symbEnd is called
2029 
2030 end sub
2031 
2032 '':::::
2033 function rtlStrCompare _
2034  ( _
2035  byval str1 as ASTNODE ptr, _
2036  byval sdtype1 as integer, _
2037  byval str2 as ASTNODE ptr, _
2038  byval sdtype2 as integer _
2039  ) as ASTNODE ptr
2040 
2041  dim as ASTNODE ptr proc = any
2042  dim as longint str1len = any, str2len = any
2043 
2044  function = NULL
2045 
2046  ''
2047  proc = astNewCALL( PROCLOOKUP( STRCOMPARE ) )
2048 
2049  '' always calc len before pushing the param
2050  str1len = rtlCalcStrLen( str1, sdtype1 )
2051  str2len = rtlCalcStrLen( str2, sdtype2 )
2052 
2053  '' byref str1 as any
2054  if( astNewARG( proc, str1, sdtype1 ) = NULL ) then
2055  exit function
2056  end if
2057 
2058  '' byval str1_len as integer
2059  if( astNewARG( proc, astNewCONSTi( str1len ) ) = NULL ) then
2060  exit function
2061  end if
2062 
2063  '' byref str2 as any
2064  if( astNewARG( proc, str2, sdtype2 ) = NULL ) then
2065  exit function
2066  end if
2067 
2068  '' byval str2_len as integer
2069  if( astNewARG( proc, astNewCONSTi( str2len ) ) = NULL ) then
2070  exit function
2071  end if
2072 
2073  function = proc
2074 
2075 end function
2076 
2077 '':::::
2078 function rtlWstrCompare _
2079  ( _
2080  byval str1 as ASTNODE ptr, _
2081  byval str2 as ASTNODE ptr _
2082  ) as ASTNODE ptr
2083 
2084  dim as ASTNODE ptr proc = any
2085 
2086  function = NULL
2087 
2088  ''
2089  proc = astNewCALL( PROCLOOKUP( WSTRCOMPARE ) )
2090 
2091  '' byval str1 as wstring ptr
2092  if( astNewARG( proc, str1 ) = NULL ) then
2093  exit function
2094  end if
2095 
2096  '' byval str2 as wstring ptr
2097  if( astNewARG( proc, str2 ) = NULL ) then
2098  exit function
2099  end if
2100 
2101  function = proc
2102 
2103 end function
2104 
2105 '':::::
2106 function rtlStrConcat _
2107  ( _
2108  byval str1 as ASTNODE ptr, _
2109  byval sdtype1 as integer, _
2110  byval str2 as ASTNODE ptr, _
2111  byval sdtype2 as integer _
2112  ) as ASTNODE ptr
2113 
2114  dim as ASTNODE ptr proc = any
2115  dim as longint str1len = any, str2len = any
2116  dim as FBSYMBOL ptr tmp = any
2117 
2118  function = NULL
2119 
2120  proc = astNewCALL( PROCLOOKUP( STRCONCAT ) )
2121 
2122  '' byref dst as string (must be cleaned up due the rtlib assumptions about destine)
2123  tmp = symbAddTempVar( FB_DATATYPE_STRING )
2124 
2125  if( astNewARG( proc, _
2126  astNewLINK( astBuildTempVarClear( tmp ), _
2127  astNewVAR( tmp ), _
2128  FALSE ) ) = NULL ) then
2129  exit function
2130  end if
2131 
2132  '' always calc len before pushing the param
2133  str1len = rtlCalcStrLen( str1, sdtype1 )
2134  str2len = rtlCalcStrLen( str2, sdtype2 )
2135 
2136  '' byref str1 as any
2137  if( astNewARG( proc, str1, sdtype1 ) = NULL ) then
2138  exit function
2139  end if
2140 
2141  '' byval str1_len as integer
2142  if( astNewARG( proc, astNewCONSTi( str1len ) ) = NULL ) then
2143  exit function
2144  end if
2145 
2146  '' byref str2 as any
2147  if( astNewARG( proc, str2, sdtype2 ) = NULL ) then
2148  exit function
2149  end if
2150 
2151  '' byval str2_len as integer
2152  if( astNewARG( proc, astNewCONSTi( str2len ) ) = NULL ) then
2153  exit function
2154  end if
2155 
2156  function = proc
2157 end function
2158 
2159 '':::::
2160 function rtlWstrConcatWA _
2161  ( _
2162  byval str1 as ASTNODE ptr, _
2163  byval str2 as ASTNODE ptr, _
2164  byval sdtype2 as integer _
2165  ) as ASTNODE ptr
2166 
2167  dim as ASTNODE ptr proc = any
2168  dim as longint str2len = any
2169 
2170  function = NULL
2171 
2172  proc = astNewCALL( PROCLOOKUP( WSTRCONCATWA ) )
2173 
2174  '' byval str1 as wstring ptr
2175  if( astNewARG( proc, str1 ) = NULL ) then
2176  exit function
2177  end if
2178 
2179  '' always calc len before pushing the param
2180  str2len = rtlCalcStrLen( str2, sdtype2 )
2181 
2182  '' byref str2 as any
2183  if( astNewARG( proc, str2, sdtype2 ) = NULL ) then
2184  exit function
2185  end if
2186 
2187  '' byval str2_len as integer
2188  if( astNewARG( proc, astNewCONSTi( str2len ) ) = NULL ) then
2189  exit function
2190  end if
2191 
2192  function = proc
2193 
2194 end function
2195 
2196 '':::::
2197 function rtlWstrConcatAW _
2198  ( _
2199  byval str1 as ASTNODE ptr, _
2200  byval sdtype1 as integer, _
2201  byval str2 as ASTNODE ptr _
2202  ) as ASTNODE ptr
2203 
2204  dim as ASTNODE ptr proc = any
2205  dim as longint str1len = any
2206 
2207  function = NULL
2208 
2209  proc = astNewCALL( PROCLOOKUP( WSTRCONCATAW ) )
2210 
2211  '' always calc len before pushing the param
2212  str1len = rtlCalcStrLen( str1, sdtype1 )
2213 
2214  '' byref str1 as any
2215  if( astNewARG( proc, str1, sdtype1 ) = NULL ) then
2216  exit function
2217  end if
2218 
2219  '' byval str1_len as integer
2220  if( astNewARG( proc, astNewCONSTi( str1len ) ) = NULL ) then
2221  exit function
2222  end if
2223 
2224  '' byval str2 as wstring ptr
2225  if( astNewARG( proc, str2 ) = NULL ) then
2226  exit function
2227  end if
2228 
2229  function = proc
2230 
2231 end function
2232 
2233 '':::::
2234 function rtlWstrConcat _
2235  ( _
2236  byval str1 as ASTNODE ptr, _
2237  byval sdtype1 as integer, _
2238  byval str2 as ASTNODE ptr, _
2239  byval sdtype2 as integer _
2240  ) as ASTNODE ptr
2241 
2242  dim as ASTNODE ptr proc = any
2243 
2244  function = NULL
2245 
2246  '' both not wstrings?
2247  if( typeGetDtAndPtrOnly( sdtype1 ) <> typeGetDtAndPtrOnly( sdtype2 ) ) then
2248  '' left ?
2249  if( typeGet( sdtype1 ) = FB_DATATYPE_WCHAR ) then
2250  return rtlWstrConcatWA( str1, str2, sdtype2 )
2251 
2252  '' right..
2253  else
2254  return rtlWstrConcatAW( str1, sdtype1, str2 )
2255  end if
2256  end if
2257 
2258  '' both wstrings..
2259  proc = astNewCALL( PROCLOOKUP( WSTRCONCAT ) )
2260 
2261  '' byval str1 as wstring ptr
2262  if( astNewARG( proc, str1 ) = NULL ) then
2263  exit function
2264  end if
2265 
2266  '' byval str2 as wstring ptr
2267  if( astNewARG( proc, str2 ) = NULL ) then
2268  exit function
2269  end if
2270 
2271  function = proc
2272 
2273 end function
2274 
2275 '':::::
2276 function rtlStrConcatAssign _
2277  ( _
2278  byval dst as ASTNODE ptr, _
2279  byval src as ASTNODE ptr _
2280  ) as ASTNODE ptr
2281 
2282  dim as ASTNODE ptr proc = any
2283  dim as integer ddtype = any, sdtype = any
2284  dim as longint lgt = any
2285 
2286  function = NULL
2287 
2288  proc = astNewCALL( PROCLOOKUP( STRCONCATASSIGN ) )
2289 
2290  ddtype = astGetDataType( dst )
2291 
2292  '' always calc len before pushing the param
2293  lgt = rtlCalcStrLen( dst, ddtype )
2294 
2295  '' dst as any
2296  if( astNewARG( proc, dst, ddtype ) = NULL ) then
2297  exit function
2298  end if
2299 
2300  '' byval dstlen as integer
2301  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2302  exit function
2303  end if
2304 
2305  '' always calc len before pushing the param
2306  sdtype = astGetDataType( src )
2307  lgt = rtlCalcStrLen( src, sdtype )
2308 
2309  '' src as any
2310  if( astNewARG( proc, src, sdtype ) = NULL ) then
2311  exit function
2312  end if
2313 
2314  '' byval srclen as integer
2315  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2316  exit function
2317  end if
2318 
2319  '' byval fillrem as integer
2320  if( astNewARG( proc, astNewCONSTi( ddtype = FB_DATATYPE_FIXSTR ) ) = NULL ) then
2321  exit function
2322  end if
2323 
2324  ''
2325  function = proc
2326 
2327 end function
2328 
2329 '':::::
2330 function rtlWstrConcatAssign _
2331  ( _
2332  byval dst as ASTNODE ptr, _
2333  byval src as ASTNODE ptr _
2334  ) as ASTNODE ptr static
2335 
2336  dim as ASTNODE ptr proc
2337  dim as longint lgt = any
2338 
2339  function = NULL
2340 
2341  proc = astNewCALL( PROCLOOKUP( WSTRCONCATASSIGN ) )
2342 
2343  '' always calc len before pushing the param
2344  lgt = rtlCalcStrLen( dst, FB_DATATYPE_WCHAR )
2345 
2346  '' byval dst as wstring ptr
2347  if( astNewARG( proc, dst ) = NULL ) then
2348  exit function
2349  end if
2350 
2351  '' byval dstlen as integer
2352  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2353  exit function
2354  end if
2355 
2356  '' byval src as wstring ptr
2357  if( astNewARG( proc, src ) = NULL ) then
2358  exit function
2359  end if
2360 
2361  ''
2362  function = proc
2363 
2364 end function
2365 
2366 '':::::
2367 function rtlWstrAssignWA _
2368  ( _
2369  byval dst as ASTNODE ptr, _
2370  byval src as ASTNODE ptr, _
2371  byval sdtype as integer _
2372  ) as ASTNODE ptr
2373 
2374  dim as ASTNODE ptr proc = any
2375  dim as longint dstlen = any, srclen = any
2376 
2377  function = NULL
2378 
2379  proc = astNewCALL( PROCLOOKUP( WSTRASSIGNWA ) )
2380 
2381  '' always calc len before pushing the param
2382  dstlen = rtlCalcStrLen( dst, FB_DATATYPE_WCHAR )
2383  srclen = rtlCalcStrLen( src, sdtype )
2384 
2385  '' byval dst as wstring ptr
2386  if( astNewARG( proc, dst ) = NULL ) then
2387  exit function
2388  end if
2389 
2390  '' byval dstlen as integer
2391  if( astNewARG( proc, astNewCONSTi( dstlen ) ) = NULL ) then
2392  exit function
2393  end if
2394 
2395  '' byref src as any
2396  if( astNewARG( proc, src ) = NULL ) then
2397  exit function
2398  end if
2399 
2400  '' byval srclen as integer
2401  if( astNewARG( proc, astNewCONSTi( srclen ) ) = NULL ) then
2402  exit function
2403  end if
2404 
2405  function = proc
2406 
2407 end function
2408 
2409 '':::::
2410 function rtlWstrAssignAW _
2411  ( _
2412  byval dst as ASTNODE ptr, _
2413  byval ddtype as integer, _
2414  byval src as ASTNODE ptr, _
2415  byval is_ini as integer _
2416  ) as ASTNODE ptr
2417 
2418  dim as ASTNODE ptr proc = any
2419  dim as longint lgt = any
2420 
2421  function = NULL
2422 
2423  proc = astNewCALL( iif( is_ini, _
2424  PROCLOOKUP( WSTRASSIGNAW_INIT ), _
2425  PROCLOOKUP( WSTRASSIGNAW ) ) )
2426 
2427  '' always calc len before pushing the param
2428  lgt = rtlCalcStrLen( dst, ddtype )
2429 
2430  '' byref dst as any
2431  if( astNewARG( proc, dst ) = NULL ) then
2432  exit function
2433  end if
2434 
2435  '' byval dstlen as integer
2436  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2437  exit function
2438  end if
2439 
2440  '' byval src as wstring ptr
2441  if( astNewARG( proc, src ) = NULL ) then
2442  exit function
2443  end if
2444 
2445  '' byval fillrem as integer
2446  if( astNewARG( proc, astNewCONSTi( ddtype = FB_DATATYPE_FIXSTR ) ) = NULL ) then
2447  exit function
2448  end if
2449 
2450  function = proc
2451 
2452 end function
2453 
2454 '':::::
2455 function rtlStrAssign _
2456  ( _
2457  byval dst as ASTNODE ptr, _
2458  byval src as ASTNODE ptr, _
2459  byval is_ini as integer _
2460  ) as ASTNODE ptr
2461 
2462  dim as ASTNODE ptr proc = any
2463  dim as integer ddtype = any, sdtype = any
2464  dim as longint lgt = any
2465 
2466  function = NULL
2467 
2468  ddtype = astGetDataType( dst )
2469  sdtype = astGetDataType( src )
2470 
2471  '' wstring source?
2472  if( sdtype = FB_DATATYPE_WCHAR ) then
2473  return rtlWstrAssignAW( dst, ddtype, src, is_ini )
2474 
2475  '' destine?
2476  elseif( ddtype = FB_DATATYPE_WCHAR ) then
2477  return rtlWstrAssignWA( dst, src, sdtype )
2478  end if
2479 
2480  '' both strings
2481  proc = astNewCALL( iif( is_ini, _
2482  PROCLOOKUP( STRINIT ), _
2483  PROCLOOKUP( STRASSIGN ) ) )
2484 
2485  '' always calc len before pushing the param
2486 
2487  lgt = rtlCalcStrLen( dst, ddtype )
2488 
2489  '' dst as any
2490  if( astNewARG( proc, dst, astGetDataType( dst ) ) = NULL ) then
2491  exit function
2492  end if
2493 
2494  '' byval dstlen as integer
2495  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2496  exit function
2497  end if
2498 
2499  '' always calc len before pushing the param
2500  lgt = rtlCalcStrLen( src, sdtype )
2501 
2502  '' src as any
2503  if( astNewARG( proc, src, astGetDataType( src ) ) = NULL ) then
2504  exit function
2505  end if
2506 
2507  '' byval srclen as integer
2508  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2509  exit function
2510  end if
2511 
2512  '' byval fillrem as integer
2513  if( astNewARG( proc, astNewCONSTi( ddtype = FB_DATATYPE_FIXSTR ) ) = NULL ) then
2514  exit function
2515  end if
2516 
2517  ''
2518  function = proc
2519 
2520 end function
2521 
2522 '':::::
2523 function rtlWstrAssign _
2524  ( _
2525  byval dst as ASTNODE ptr, _
2526  byval src as ASTNODE ptr, _
2527  byval is_ini as integer _
2528  ) as ASTNODE ptr
2529 
2530  dim as ASTNODE ptr proc = any
2531  dim as integer ddtype = any, sdtype = any
2532  dim as longint lgt = any
2533 
2534  function = NULL
2535 
2536  ddtype = astGetDataType( dst )
2537  sdtype = astGetDataType( src )
2538 
2539  '' both not wstrings?
2540  if( ddtype <> sdtype ) then
2541  '' left ?
2542  if( ddtype = FB_DATATYPE_WCHAR ) then
2543  return rtlWstrAssignWA( dst, src, sdtype )
2544  '' right..
2545  else
2546  return rtlWstrAssignAW( dst, ddtype, src, is_ini )
2547  end if
2548  end if
2549 
2550  '' both wstrings..
2551  proc = astNewCALL( PROCLOOKUP( WSTRASSIGN ) )
2552 
2553  '' always calc len before pushing the param
2554  lgt = rtlCalcStrLen( dst, ddtype )
2555 
2556  '' byval dst as wstring ptr
2557  if( astNewARG( proc, dst ) = NULL ) then
2558  exit function
2559  end if
2560 
2561  '' byval dstlen as integer
2562  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2563  exit function
2564  end if
2565 
2566  '' byval src as wstring ptr
2567  if( astNewARG( proc, src ) = NULL ) then
2568  exit function
2569  end if
2570 
2571  function = proc
2572 
2573 end function
2574 
2575 '':::::
2576 function rtlStrDelete _
2577  ( _
2578  byval strg as ASTNODE ptr _
2579  ) as ASTNODE ptr
2580 
2581  dim as ASTNODE ptr proc = any
2582  dim as integer dtype = any
2583 
2584  function = NULL
2585 
2586  ''
2587  dtype = astGetDataType( strg )
2588  select case as const dtype
2589  '' it could be a wstring ptr too due the temporary
2590  '' wstrings that must be handled by AST
2591  case FB_DATATYPE_WCHAR, _
2592  typeAddrOf( FB_DATATYPE_WCHAR )
2593  proc = astNewCALL( PROCLOOKUP( WSTRDELETE ) )
2594  case else
2595  proc = astNewCALL( PROCLOOKUP( STRDELETE ) )
2596  dtype = FB_DATATYPE_STRING
2597  end select
2598 
2599  '' str as ANY
2600  if( astNewARG( proc, strg, dtype ) = NULL ) then
2601  exit function
2602  end if
2603 
2604  function = proc
2605 
2606 end function
2607 
2608 '':::::
2609 function rtlStrAllocTmpResult _
2610  ( _
2611  byval strg as ASTNODE ptr _
2612  ) as ASTNODE ptr static
2613 
2614  dim as ASTNODE ptr proc
2615 
2616  function = NULL
2617 
2618  ''
2619  proc = astNewCALL( PROCLOOKUP( STRALLOCTMPRES ), NULL )
2620 
2621  '' src as string
2622  if( astNewARG( proc, strg, FB_DATATYPE_STRING ) = NULL ) then
2623  exit function
2624  end if
2625 
2626  function = proc
2627 
2628 end function
2629 
2630 '':::::
2631 function rtlStrAllocTmpDesc _
2632  ( _
2633  byval strexpr as ASTNODE ptr _
2634  ) as ASTNODE ptr
2635 
2636  dim as ASTNODE ptr proc = any
2637  dim as integer dtype = any
2638  dim as longint lgt = any
2639  dim as FBSYMBOL ptr litsym = any
2640 
2641  function = NULL
2642 
2643  ''
2644  dtype = astGetDataType( strexpr )
2645 
2646  select case as const dtype
2647  case FB_DATATYPE_STRING
2648  proc = astNewCALL( PROCLOOKUP( STRALLOCTMPDESCV ) )
2649 
2650  '' str as string
2651  if( astNewARG( proc, strexpr ) = NULL ) then
2652  exit function
2653  end if
2654 
2655  case FB_DATATYPE_CHAR
2656 
2657  '' literal?
2658  litsym = astGetStrLitSymbol( strexpr )
2659  if( litsym = NULL ) then
2660  proc = astNewCALL( PROCLOOKUP( STRALLOCTMPDESCZ ) )
2661  else
2662  proc = astNewCALL( PROCLOOKUP( STRALLOCTMPDESCZEX ) )
2663  end if
2664 
2665  '' byval str as zstring ptr
2666  if( astNewARG( proc, strexpr ) = NULL ) then
2667  exit function
2668  end if
2669 
2670  '' length is known at compile-time
2671  if( litsym <> NULL ) then
2672  lgt = symbGetStrLen( litsym ) - 1 '' less the null-term
2673 
2674  '' byval len as integer
2675  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2676  exit function
2677  end if
2678  end if
2679 
2680  case FB_DATATYPE_FIXSTR
2681  proc = astNewCALL( PROCLOOKUP( STRALLOCTMPDESCF ) )
2682 
2683  '' always calc len before pushing the param
2684  lgt = rtlCalcStrLen( strexpr, dtype )
2685 
2686  '' str as any
2687  if( astNewARG( proc, strexpr ) = NULL ) then
2688  exit function
2689  end if
2690 
2691  '' byval strlen as integer
2692  if( astNewARG( proc, astNewCONSTi( lgt ) ) = NULL ) then
2693  exit function
2694  end if
2695 
2696  end select
2697 
2698  ''
2699  function = proc
2700 
2701 end function
2702 
2703 '':::::
2704 function rtlWstrAlloc _
2705  ( _
2706  byval lenexpr as ASTNODE ptr _
2707  ) as ASTNODE ptr
2708 
2709  dim as ASTNODE ptr proc = any
2710 
2711  function = NULL
2712 
2713  proc = astNewCALL( PROCLOOKUP( WSTRALLOC ) )
2714 
2715  '' byval len as integer
2716  if( astNewARG( proc, lenexpr ) = NULL ) then
2717  exit function
2718  end if
2719 
2720  function = proc
2721 
2722 end function
2723 
2724 '':::::
2725 function rtlWstrToA _
2726  ( _
2727  byval expr as ASTNODE ptr _
2728  ) as ASTNODE ptr
2729 
2730  dim as ASTNODE ptr proc = any
2731 
2732  function = NULL
2733 
2734  proc = astNewCALL( PROCLOOKUP( WSTR2STR ) )
2735 
2736  '' byval str as wstring ptr
2737  if( astNewARG( proc, expr ) = NULL ) then
2738  exit function
2739  end if
2740 
2741  function = proc
2742 
2743 end function
2744 
2745 '':::::
2746 function rtlAToWstr _
2747  ( _
2748  byval expr as ASTNODE ptr _
2749  ) as ASTNODE ptr
2750 
2751  dim as ASTNODE ptr proc = any
2752 
2753  function = NULL
2754 
2755  proc = astNewCALL( PROCLOOKUP( STR2WSTR ) )
2756 
2757  '' byval str as zstring ptr
2758  if( astNewARG( proc, expr ) = NULL ) then
2759  exit function
2760  end if
2761 
2762  function = proc
2763 
2764 end function
2765 
2766 '':::::
2767 function rtlToStr _
2768  ( _
2769  byval expr as ASTNODE ptr, _
2770  byval pad as integer _
2771  ) as ASTNODE ptr
2772 
2773  dim as ASTNODE ptr proc = any
2774  dim as FBSYMBOL ptr f = any, litsym = any
2775  dim as integer dtype = any
2776 
2777  function = NULL
2778 
2779  dtype = astGetDatatype( expr )
2780 
2781  '' constant? evaluate
2782  if( astIsCONST( expr ) ) then
2783  dim s As String
2784  if( pad ) then
2785  if( typeIsSigned( astGetDataType( expr ) ) ) then
2786  if astConstGetAsDouble( expr ) >= 0 then
2787  s = " "
2788  end if
2789  else
2790  s = " "
2791  end if
2792  end if
2793  s += astConstFlushToStr( expr )
2794  return astNewCONSTstr( s )
2795  end if
2796 
2797  '' wstring literal? convert from unicode at compile-time
2798  if( dtype = FB_DATATYPE_WCHAR ) then
2799  litsym = astGetStrLitSymbol( expr )
2800  if( litsym <> NULL ) then
2801  if( env.wchar_doconv ) then
2802  litsym = symbAllocStrConst( str( *symbGetVarLitTextW( litsym ) ), _
2803  symbGetWstrLen( litsym ) - 1 )
2804 
2805  return astNewVAR( litsym )
2806  end if
2807  end if
2808  end if
2809 
2810  ''
2811  select case as const astGetDataClass( expr )
2812  case FB_DATACLASS_INTEGER
2813 
2814  '' Convert pointer to uinteger
2815  if( typeIsPtr( dtype ) ) then
2816  expr = astNewCONV( FB_DATATYPE_UINT, NULL, expr )
2817  dtype = astGetDatatype( expr )
2818  end if
2819 
2820  select case( dtype )
2821  '' zstring? do nothing
2822  case FB_DATATYPE_CHAR
2823  return expr
2824  '' wstring? convert..
2825  case FB_DATATYPE_WCHAR
2826  return rtlWStrToA( expr )
2827  end select
2828 
2829  select case as const( typeGetSizeType( dtype ) )
2830  case FB_SIZETYPE_INT64
2831  f = iif( pad = FALSE, _
2832  PROCLOOKUP( LONGINT2STR ), _
2833  PROCLOOKUP( LONGINT2STR_QB ) )
2834 
2835  case FB_SIZETYPE_UINT64
2836  f = iif( pad = FALSE, _
2837  PROCLOOKUP( ULONGINT2STR ), _
2838  PROCLOOKUP( ULONGINT2STR_QB ) )
2839 
2840  case FB_SIZETYPE_INT8, FB_SIZETYPE_INT16, FB_SIZETYPE_INT32
2841  f = iif( pad = FALSE, _
2842  PROCLOOKUP( INT2STR ), _
2843  PROCLOOKUP( INT2STR_QB ) )
2844 
2845  case FB_SIZETYPE_UINT8, FB_SIZETYPE_UINT16, FB_SIZETYPE_UINT32
2846  f = iif( pad = FALSE, _
2847  PROCLOOKUP( UINT2STR ), _
2848  PROCLOOKUP( UINT2STR_QB ) )
2849 
2850  end select
2851 
2852  case FB_DATACLASS_FPOINT
2853  if( astGetDataType( expr ) = FB_DATATYPE_SINGLE ) then
2854  f = iif( pad = FALSE, _
2855  PROCLOOKUP( FLT2STR ), _
2856  PROCLOOKUP( FLT2STR_QB ) )
2857  else
2858  f = iif( pad = FALSE, _
2859  PROCLOOKUP( DBL2STR ), _
2860  PROCLOOKUP( DBL2STR_QB ) )
2861  end if
2862 
2863  case FB_DATACLASS_STRING
2864  '' do nothing
2865  return expr
2866 
2867  '' UDT's, classes: try cast(string) op overloading
2868  case FB_DATACLASS_UDT
2869  return astNewCONV( FB_DATATYPE_STRING, NULL, expr )
2870 
2871  '' anything else, can't convert
2872  case else
2873  return NULL
2874  end select
2875 
2876  ''
2877  proc = astNewCALL( f )
2878 
2879  ''
2880  if( astNewARG( proc, expr ) = NULL ) then
2881  exit function
2882  end if
2883 
2884  function = proc
2885 
2886 end function
2887 
2888 '':::::
2889 function rtlToWstr _
2890  ( _
2891  byval expr as ASTNODE ptr _
2892  ) as ASTNODE ptr
2893 
2894  dim as ASTNODE ptr proc = any
2895  dim as FBSYMBOL ptr f = any, litsym = any
2896  dim as integer dtype
2897 
2898  function = NULL
2899 
2900  dtype = astGetDataType( expr )
2901 
2902  '' constant? evaluate
2903  if( astIsCONST( expr ) ) then
2904  return astNewCONSTwstr( astConstFlushToWstr( expr ) )
2905  end if
2906 
2907  '' string literal? convert to unicode at compile-time
2908  if( dtype = FB_DATATYPE_CHAR ) then
2909  litsym = astGetStrLitSymbol( expr )
2910  if( litsym <> NULL ) then
2911  if( env.wchar_doconv ) then
2912  litsym = symbAllocWstrConst( wstr( *symbGetVarLitText( litsym ) ), _
2913  symbGetStrLen( litsym ) - 1 )
2914  return astNewVAR( litsym )
2915  end if
2916  end if
2917  end if
2918 
2919  select case as const astGetDataClass( expr )
2920  case FB_DATACLASS_INTEGER
2921  '' Convert pointer to uinteger
2922  if( typeIsPtr( dtype ) ) then
2923  expr = astNewCONV( FB_DATATYPE_UINT, NULL, expr )
2924  dtype = astGetDatatype( expr )
2925  end if
2926 
2927  select case( dtype )
2928  '' wstring? do nothing
2929  case FB_DATATYPE_WCHAR
2930  return expr
2931  '' zstring? convert..
2932  case FB_DATATYPE_CHAR
2933  return rtlAToWstr( expr )
2934  end select
2935 
2936  select case as const( typeGetSizeType( dtype ) )
2937  case FB_SIZETYPE_INT64
2938  f = PROCLOOKUP( LONGINT2WSTR )
2939  case FB_SIZETYPE_UINT64
2940  f = PROCLOOKUP( ULONGINT2WSTR )
2941  case FB_SIZETYPE_INT8, FB_SIZETYPE_INT16, FB_SIZETYPE_INT32
2942  f = PROCLOOKUP( INT2WSTR )
2943  case FB_SIZETYPE_UINT8, FB_SIZETYPE_UINT16, FB_SIZETYPE_UINT32
2944  f = PROCLOOKUP( UINT2WSTR )
2945  end select
2946 
2947  case FB_DATACLASS_FPOINT
2948  if( astGetDataType( expr ) = FB_DATATYPE_SINGLE ) then
2949  f = PROCLOOKUP( FLT2WSTR )
2950  else
2951  f = PROCLOOKUP( DBL2WSTR )
2952  end if
2953 
2954  case FB_DATACLASS_STRING
2955  '' convert
2956  return rtlAToWstr( expr )
2957 
2958  '' UDT's, classes: try cast(wstring ptr) op overloading
2959  case FB_DATACLASS_UDT
2960  return astNewCONV( typeAddrOf( FB_DATATYPE_WCHAR ), NULL, expr )
2961 
2962  '' anything else: can't convert
2963  case else
2964  return NULL
2965  end select
2966 
2967  ''
2968  proc = astNewCALL( f )
2969 
2970  ''
2971  if( astNewARG( proc, expr ) = NULL ) then
2972  exit function
2973  end if
2974 
2975  function = proc
2976 
2977 end function
2978 
2979 '':::::
2980 function rtlStrToVal _
2981  ( _
2982  byval expr as ASTNODE ptr, _
2983  byval to_dtype as integer _
2984  ) as ASTNODE ptr
2985 
2986  dim as ASTNODE ptr proc = any
2987  dim as FBSYMBOL ptr f = any, s = any
2988  dim as FB_CALL_ARG arg = any
2989  dim as FB_ERRMSG err_num = any
2990 
2991  function = NULL
2992 
2993  '' Convert pointer to uinteger
2994  if( typeIsPtr( to_dtype ) ) then
2995  expr = astNewCONV( FB_DATATYPE_UINT, NULL, expr )
2996  end if
2997 
2998  select case as const typeGet( to_dtype )
2999  case FB_DATATYPE_SINGLE, FB_DATATYPE_DOUBLE
3000  f = PROCLOOKUP( STR2DBL )
3001 
3002  case FB_DATATYPE_BYTE, FB_DATATYPE_UBYTE, _
3003  FB_DATATYPE_SHORT, FB_DATATYPE_USHORT, _
3004  FB_DATATYPE_INTEGER, FB_DATATYPE_ENUM, FB_DATATYPE_UINT, _
3005  FB_DATATYPE_LONG, FB_DATATYPE_ULONG, FB_DATATYPE_POINTER, _
3006  FB_DATATYPE_LONGINT, FB_DATATYPE_ULONGINT
3007 
3008  select case as const( typeGetSizeType( to_dtype ) )
3009  case FB_SIZETYPE_INT64
3010  f = PROCLOOKUP( STR2LNG )
3011  case FB_SIZETYPE_UINT64
3012  f = PROCLOOKUP( STR2ULNG )
3013  case FB_SIZETYPE_INT8, FB_SIZETYPE_INT16, FB_SIZETYPE_INT32
3014  f = PROCLOOKUP( STR2INT )
3015  case FB_SIZETYPE_UINT8, FB_SIZETYPE_UINT16, FB_SIZETYPE_UINT32
3016  f = PROCLOOKUP( STR2UINT )
3017  end select
3018 
3019  '' UDT's, classes: try cast(to_dtype) op overloading
3020  case FB_DATATYPE_STRUCT ', FB_DATATYPE_CLASS
3021  return astNewCONV( to_dtype, NULL, expr )
3022 
3023  case else
3024  '' anything else..
3025  exit function
3026  end select
3027 
3028  '' resolve zstring or wstring
3029  arg.expr = expr
3030  arg.mode = INVALID
3031  arg.next = NULL
3032  f = symbFindClosestOvlProc( f, 1, @arg, @err_num )
3033  if( f = NULL ) then
3034  exit function
3035  end if
3036 
3037  proc = astNewCALL( f )
3038 
3039  ''
3040  if( astNewARG( proc, expr ) = NULL ) then
3041  exit function
3042  end if
3043 
3044  function = astNewCONV( to_dtype, NULL, proc )
3045 
3046 end function
3047 
3048 '':::::
3049 function rtlStrMid _
3050  ( _
3051  byval expr1 as ASTNODE ptr, _
3052  byval expr2 as ASTNODE ptr, _
3053  byval expr3 as ASTNODE ptr _
3054  ) as ASTNODE ptr
3055 
3056  dim as ASTNODE ptr proc = any
3057 
3058  function = NULL
3059 
3060  ''
3061  if( astGetDataType( expr1 ) <> FB_DATATYPE_WCHAR ) then
3062  proc = astNewCALL( PROCLOOKUP( STRMID ) )
3063  else
3064  proc = astNewCALL( PROCLOOKUP( WSTRMID ) )
3065  end if
3066 
3067  ''
3068  if( astNewARG( proc, expr1 ) = NULL ) then
3069  exit function
3070  end if
3071 
3072  if( astNewARG( proc, expr2 ) = NULL ) then
3073  exit function
3074  end if
3075 
3076  if( astNewARG( proc, expr3 ) = NULL ) then
3077  exit function
3078  end if
3079 
3080  function = proc
3081 
3082 end function
3083 
3084 '':::::
3085 function rtlStrAssignMid _
3086  ( _
3087  byval expr1 as ASTNODE ptr, _
3088  byval expr2 as ASTNODE ptr, _
3089  byval expr3 as ASTNODE ptr, _
3090  byval expr4 as ASTNODE ptr _
3091  ) as ASTNODE ptr
3092 
3093  dim as ASTNODE ptr proc = any
3094  dim as longint dst_len = any
3095 
3096  function = NULL
3097 
3098  ''
3099  if( astGetDataType( expr1 ) <> FB_DATATYPE_WCHAR ) then
3100  proc = astNewCALL( PROCLOOKUP( STRASSIGNMID ) )
3101  dst_len = -1
3102  else
3103  proc = astNewCALL( PROCLOOKUP( WSTRASSIGNMID ) )
3104  '' always calc len before pushing the param
3105  dst_len = rtlCalcStrLen( expr1, FB_DATATYPE_WCHAR )
3106  end if
3107 
3108  ''
3109  if( astNewARG( proc, expr1 ) = NULL ) then
3110  exit function
3111  end if
3112 
3113  ''
3114  if( dst_len <> -1 ) then
3115  if( astNewARG( proc, astNewCONSTi( dst_len ) ) = NULL ) then
3116  exit function
3117  end if
3118  end if
3119 
3120  if( astNewARG( proc, expr2 ) = NULL ) then
3121  exit function
3122  end if
3123 
3124  if( astNewARG( proc, expr3 ) = NULL ) then
3125  exit function
3126  end if
3127 
3128  if( astNewARG( proc, expr4 ) = NULL ) then
3129  exit function
3130  end if
3131 
3132  ''
3133  astAdd( proc )
3134 
3135  function = proc
3136 
3137 end function
3138 
3139 '':::::
3140 function rtlStrLRSet _
3141  ( _
3142  byval dstexpr as ASTNODE ptr, _
3143  byval srcexpr as ASTNODE ptr, _
3144  byval is_rset as integer _
3145  ) as integer
3146 
3147  dim as ASTNODE ptr proc = any
3148 
3149  function = FALSE
3150 
3151  ''
3152  if( astGetDataType( dstexpr ) <> FB_DATATYPE_WCHAR ) then
3153  proc = astNewCALL( iif( is_rset, _
3154  PROCLOOKUP( STRRSET ), _
3155  PROCLOOKUP( STRLSET ) ) )
3156  else
3157  proc = astNewCALL( iif( is_rset, _
3158  PROCLOOKUP( WSTRRSET ), _
3159  PROCLOOKUP( WSTRLSET ) ) )
3160  end if
3161 
3162  '' dst as string
3163  if( astNewARG( proc, dstexpr ) = NULL ) then
3164  exit function
3165  end if
3166 
3167  '' src as string
3168  if( astNewARG( proc, srcexpr ) = NULL ) then
3169  exit function
3170  end if
3171 
3172  ''
3173  astAdd( proc )
3174 
3175  function = TRUE
3176 
3177 end function
3178 
3179 '':::::
3180 function rtlStrFill _
3181  ( _
3182  byval expr1 as ASTNODE ptr, _
3183  byval expr2 as ASTNODE ptr _
3184  ) as ASTNODE ptr
3185 
3186  dim as ASTNODE ptr proc = any
3187  dim as FBSYMBOL ptr f = any
3188 
3189  function = NULL
3190 
3191  select case astGetDataType( expr2 )
3192  case FB_DATATYPE_STRING, FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
3193  f = PROCLOOKUP( STRFILL2 )
3194  case else
3195  f = PROCLOOKUP( STRFILL1 )
3196  end select
3197 
3198  proc = astNewCALL( f )
3199 
3200  ''
3201  if( astNewARG( proc, expr1 ) = NULL ) then
3202  exit function
3203  end if
3204 
3205  if( astNewARG( proc, expr2 ) = NULL ) then
3206  exit function
3207  end if
3208 
3209  function = proc
3210 
3211 end function
3212 
3213 '':::::
3214 function rtlWstrFill _
3215  ( _
3216  byval expr1 as ASTNODE ptr, _
3217  byval expr2 as ASTNODE ptr _
3218  ) as ASTNODE ptr
3219 
3220  dim as ASTNODE ptr proc = any
3221  dim as FBSYMBOL ptr f = any
3222 
3223  function = NULL
3224 
3225  if( astGetDataType( expr2 ) = FB_DATATYPE_WCHAR ) then
3226  f = PROCLOOKUP( WSTRFILL2 )
3227  else
3228  f = PROCLOOKUP( WSTRFILL1 )
3229  end if
3230 
3231  proc = astNewCALL( f )
3232 
3233  ''
3234  if( astNewARG( proc, expr1 ) = NULL ) then
3235  exit function
3236  end if
3237 
3238  if( astNewARG( proc, expr2 ) = NULL ) then
3239  exit function
3240  end if
3241 
3242  function = proc
3243 
3244 end function
3245 
3246 function rtlStrLen( byval expr as ASTNODE ptr ) as ASTNODE ptr
3247  dim as ASTNODE ptr proc = any
3248  dim as longint length = any
3249 
3250  function = NULL
3251 
3252  proc = astNewCALL( PROCLOOKUP( STRLEN ) )
3253 
3254  '' always calc len before pushing the param
3255  length = rtlCalcStrLen( expr, astGetDataType( expr ) )
3256 
3257  '' str as any
3258  if( astNewARG( proc, expr, FB_DATATYPE_STRING ) = NULL ) then
3259  exit function
3260  end if
3261 
3262  '' byval strlen as integer
3263  if( astNewARG( proc, astNewCONSTi( length ) ) = NULL ) then
3264  exit function
3265  end if
3266 
3267  function = proc
3268 end function
3269 
3270 function rtlWstrLen( byval expr as ASTNODE ptr ) as ASTNODE ptr
3271  dim as ASTNODE ptr proc = any
3272 
3273  function = NULL
3274 
3275  proc = astNewCALL( PROCLOOKUP( WSTRLEN ) )
3276 
3277  '' byval str as wchar ptr
3278  if( astNewARG( proc, expr ) = NULL ) then
3279  exit function
3280  end if
3281 
3282  function = proc
3283 end function
3284 
3285 '':::::
3286 function rtlStrAsc _
3287  ( _
3288  byval expr as ASTNODE ptr, _
3289  byval posexpr as ASTNODE ptr _
3290  ) as ASTNODE ptr
3291 
3292  dim as ASTNODE ptr proc = any
3293 
3294  function = NULL
3295 
3296  ''
3297  if( astGetDataType( expr ) <> FB_DATATYPE_WCHAR ) then
3298  proc = astNewCALL( PROCLOOKUP( STRASC ) )
3299  else
3300  proc = astNewCALL( PROCLOOKUP( WSTRASC ) )
3301  end if
3302 
3303  '' src as string
3304  if( astNewARG( proc, expr ) = NULL ) then
3305  exit function
3306  end if
3307 
3308  '' byval pos as integer
3309  if( posexpr = NULL ) then
3310  posexpr = astNewCONSTi( 1 )
3311  end if
3312 
3313  if( astNewARG( proc, posexpr ) = NULL ) then
3314  exit function
3315  end if
3316 
3317  function = proc
3318 
3319 end function
3320 
3321 '':::::
3322 function rtlStrChr _
3323  ( _
3324  byval args as integer, _
3325  exprtb() as ASTNODE ptr, _
3326  byval is_wstr as integer _
3327  ) as ASTNODE ptr
3328 
3329  dim as ASTNODE ptr proc = any, expr = any
3330  dim as integer dtype = any
3331 
3332  function = NULL
3333 
3334  if( is_wstr = FALSE ) then
3335  proc = astNewCALL( PROCLOOKUP( STRCHR ) )
3336  else
3337  proc = astNewCALL( PROCLOOKUP( WSTRCHR ) )
3338  end if
3339 
3340  '' byval args as integer
3341  if( astNewARG( proc, astNewCONSTi( args ) ) = NULL ) then
3342  exit function
3343  end if
3344 
3345  '' ...
3346  for i as integer = 0 to args-1
3347  expr = exprtb(i)
3348  dtype = astGetDatatype( expr )
3349 
3350  '' check if non-numeric
3351  if( astGetDataClass( expr ) >= FB_DATACLASS_STRING ) then
3352  errReportEx( FB_ERRMSG_PARAMTYPEMISMATCHAT, "at parameter: " + str( i+1 ) )
3353  exit function
3354  end if
3355 
3356  '' don't allow w|zstring's either..
3357  select case as const dtype
3358  case FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
3359  errReportEx( FB_ERRMSG_PARAMTYPEMISMATCHAT, "at parameter: " + str( i+1 ) )
3360  exit function
3361 
3362  case FB_DATATYPE_INTEGER
3363 
3364  '' convert to int as chr() is a varargs function
3365  case else
3366  expr = astNewCONV( FB_DATATYPE_INTEGER, NULL, expr )
3367  end select
3368 
3369  if( astNewARG( proc, expr, FB_DATATYPE_INTEGER ) = NULL ) then
3370  exit function
3371  end if
3372  next
3373 
3374  function = proc
3375 
3376 end function
3377 
3378 '':::::
3379 function rtlStrInstr _
3380  ( _
3381  byval nd_start as ASTNODE ptr, _
3382  byval nd_text as ASTNODE ptr, _
3383  byval nd_pattern as ASTNODE ptr, _
3384  byval search_any as integer _
3385  ) as ASTNODE ptr
3386 
3387  dim as ASTNODE ptr proc = any
3388  dim as FBSYMBOL ptr f = any
3389  dim as integer dtype = any
3390 
3391  function = NULL
3392 
3393  dtype = astGetDataType( nd_text )
3394 
3395  ''
3396  if( search_any ) then
3397  if( dtype <> FB_DATATYPE_WCHAR ) then
3398  f = PROCLOOKUP( STRINSTRANY )
3399  else
3400  f = PROCLOOKUP( WSTRINSTRANY )
3401  end if
3402  else
3403  if( dtype <> FB_DATATYPE_WCHAR ) then
3404  f = PROCLOOKUP( STRINSTR )
3405  else
3406  f = PROCLOOKUP( WSTRINSTR )
3407  end if
3408  end if
3409 
3410  proc = astNewCALL( f )
3411 
3412  ''
3413  if( astNewARG( proc, nd_start ) = NULL ) then
3414  exit function
3415  end if
3416 
3417  if( astNewARG( proc, nd_text ) = NULL ) then
3418  exit function
3419  end if
3420 
3421  if( astNewARG( proc, nd_pattern ) = NULL ) then
3422  exit function
3423  end if
3424 
3425  function = proc
3426 
3427 end function
3428 
3429 '':::::
3430 function rtlStrInstrRev _
3431  ( _
3432  byval nd_start as ASTNODE ptr, _
3433  byval nd_text as ASTNODE ptr, _
3434  byval nd_pattern as ASTNODE ptr, _
3435  byval search_any as integer _
3436  ) as ASTNODE ptr
3437 
3438  dim as ASTNODE ptr proc = any
3439  dim as FBSYMBOL ptr f = any
3440  dim as integer dtype = any
3441 
3442  function = NULL
3443 
3444  dtype = astGetDataType( nd_text )
3445 
3446  ''
3447  if( search_any ) then
3448  if( dtype <> FB_DATATYPE_WCHAR ) then
3449  f = PROCLOOKUP( STRINSTRREVANY )
3450  else
3451  f = PROCLOOKUP( WSTRINSTRREVANY )
3452  end if
3453  else
3454  if( dtype <> FB_DATATYPE_WCHAR ) then
3455  f = PROCLOOKUP( STRINSTRREV )
3456  else
3457  f = PROCLOOKUP( WSTRINSTRREV )
3458  end if
3459  end if
3460 
3461  proc = astNewCALL( f )
3462 
3463  if( astNewARG( proc, nd_text ) = NULL ) then
3464  exit function
3465  end if
3466 
3467  if( astNewARG( proc, nd_pattern ) = NULL ) then
3468  exit function
3469  end if
3470 
3471  ''
3472  if( astNewARG( proc, nd_start ) = NULL ) then
3473  exit function
3474  end if
3475 
3476  function = proc
3477 
3478 end function
3479 
3480 '':::::
3481 function rtlStrTrim _
3482  ( _
3483  byval nd_text as ASTNODE ptr, _
3484  byval nd_pattern as ASTNODE ptr, _
3485  byval is_any as integer _
3486  ) as ASTNODE ptr
3487 
3488  dim as ASTNODE ptr proc = any
3489  dim as FBSYMBOL ptr f = any
3490  dim as integer dtype = any
3491 
3492  function = NULL
3493 
3494  dtype = astGetDataType( nd_text )
3495 
3496  ''
3497  if( is_any ) then
3498  if( dtype <> FB_DATATYPE_WCHAR ) then
3499  f = PROCLOOKUP( STRTRIMANY )
3500  else
3501  f = PROCLOOKUP( WSTRTRIMANY )
3502  end if
3503  elseif( nd_pattern <> NULL ) then
3504  if( dtype <> FB_DATATYPE_WCHAR ) then
3505  f = PROCLOOKUP( STRTRIMEX )
3506  else
3507  f = PROCLOOKUP( WSTRTRIMEX )
3508  end if
3509  else
3510  if( dtype <> FB_DATATYPE_WCHAR ) then
3511  f = PROCLOOKUP( STRTRIM )
3512  else
3513  f = PROCLOOKUP( WSTRTRIM )
3514  end if
3515  end if
3516  proc = astNewCALL( f )
3517 
3518  ''
3519  if( astNewARG( proc, nd_text ) = NULL ) then
3520  exit function
3521  end if
3522 
3523  if( nd_pattern<>NULL or is_any ) then
3524  if( astNewARG( proc, nd_pattern ) = NULL ) then
3525  exit function
3526  end if
3527  end if
3528 
3529  function = proc
3530 
3531 end function
3532 
3533 '':::::
3534 function rtlStrRTrim _
3535  ( _
3536  byval nd_text as ASTNODE ptr, _
3537  byval nd_pattern as ASTNODE ptr, _
3538  byval is_any as integer _
3539  ) as ASTNODE ptr
3540 
3541  dim as ASTNODE ptr proc = any
3542  dim as FBSYMBOL ptr f = any
3543  dim as integer dtype = any
3544 
3545  function = NULL
3546 
3547  dtype = astGetDataType( nd_text )
3548 
3549  ''
3550  if( is_any ) then
3551  if( dtype <> FB_DATATYPE_WCHAR ) then
3552  f = PROCLOOKUP( STRRTRIMANY )
3553  else
3554  f = PROCLOOKUP( WSTRRTRIMANY )
3555  end if
3556  elseif( nd_pattern <> NULL ) then
3557  if( dtype <> FB_DATATYPE_WCHAR ) then
3558  f = PROCLOOKUP( STRRTRIMEX )
3559  else
3560  f = PROCLOOKUP( WSTRRTRIMEX )
3561  end if
3562  else
3563  if( dtype <> FB_DATATYPE_WCHAR ) then
3564  f = PROCLOOKUP( STRRTRIM )
3565  else
3566  f = PROCLOOKUP( WSTRRTRIM )
3567  end if
3568  end if
3569  proc = astNewCALL( f )
3570 
3571  ''
3572  if( astNewARG( proc, nd_text ) = NULL ) then
3573  exit function
3574  end if
3575 
3576  if( nd_pattern<>NULL or is_any ) then
3577  if( astNewARG( proc, nd_pattern ) = NULL ) then
3578  exit function
3579  end if
3580  end if
3581 
3582  function = proc
3583 
3584 end function
3585 
3586 '':::::
3587 function rtlStrLTrim _
3588  ( _
3589  byval nd_text as ASTNODE ptr, _
3590  byval nd_pattern as ASTNODE ptr, _
3591  byval is_any as integer _
3592  ) as ASTNODE ptr
3593 
3594  dim as ASTNODE ptr proc = any
3595  dim as FBSYMBOL ptr f = any
3596  dim as integer dtype = any
3597 
3598  function = NULL
3599 
3600  dtype = astGetDataType( nd_text )
3601 
3602  ''
3603  if( is_any ) then
3604  if( dtype <> FB_DATATYPE_WCHAR ) then
3605  f = PROCLOOKUP( STRLTRIMANY )
3606  else
3607  f = PROCLOOKUP( WSTRLTRIMANY )
3608  end if
3609  elseif( nd_pattern <> NULL ) then
3610  if( dtype <> FB_DATATYPE_WCHAR ) then
3611  f = PROCLOOKUP( STRLTRIMEX )
3612  else
3613  f = PROCLOOKUP( WSTRLTRIMEX )
3614  end if
3615  else
3616  if( dtype <> FB_DATATYPE_WCHAR ) then
3617  f = PROCLOOKUP( STRLTRIM )
3618  else
3619  f = PROCLOOKUP( WSTRLTRIM )
3620  end if
3621  end if
3622  proc = astNewCALL( f )
3623 
3624  ''
3625  if( astNewARG( proc, nd_text ) = NULL ) then
3626  exit function
3627  end if
3628 
3629  if( nd_pattern<>NULL or is_any ) then
3630  if( astNewARG( proc, nd_pattern ) = NULL ) then
3631  exit function
3632  end if
3633  end if
3634 
3635  function = proc
3636 
3637 end function
3638 
3639 '' Takes the text from a string literal symbol and performs ASCII-only
3640 '' Lcase/AscUcase on it. The result is a new literal symbol holding the
3641 '' lcased/ucased text.
3642 function hEvalAscCase _
3643  ( _
3644  byval literal as FBSYMBOL ptr, _
3645  byval is_lcase as integer _
3646  ) as FBSYMBOL ptr
3647 
3648  dim as wstring ptr w = any
3649  dim as zstring ptr z = any
3650  dim as integer reallength = any, internallength = any
3651  dim as integer char = any, chara = any, charz = any, chardiff = any
3652 
3653  function = NULL
3654 
3655  '' Convert to lower case?
3656  if( is_lcase ) then
3657  chara = asc( "A" )
3658  charz = asc( "Z" )
3659  chardiff = asc( "a" ) - asc( "A" )
3660  else
3661  chara = asc( "a" )
3662  charz = asc( "z" )
3663  chardiff = asc( "A" ) - asc( "a" )
3664  end if
3665 
3666  if( symbGetType( literal ) = FB_DATATYPE_WCHAR ) then
3667  w = symbGetVarLitTextW( literal )
3668  internallength = len( *w )
3669  w = hUnescapeW( w )
3670  reallength = symbGetWstrLen( literal ) - 1
3671 
3672  if( internallength <> reallength ) then
3673  exit function
3674  end if
3675 
3676  for i as integer = 0 to reallength - 1
3677  char = (*w)[i]
3678  if( (char >= chara) and (char <= charz) ) then
3679  char += chardiff
3680  end if
3681  (*w)[i] = char
3682  next
3683 
3684  function = symbAllocWstrConst( w, reallength )
3685  else
3686  z = symbGetVarLitText( literal )
3687  internallength = len( *z )
3688  z = hUnescape( z )
3689  reallength = symbGetStrLen( literal ) - 1
3690 
3691  '' Don't do it if it includes internal escape sequences,
3692  '' handling these here would be quite hard... (TODO)
3693  '' On one hand we should handle "A" disguised as !"\&h41" which
3694  '' internally is something involving FB_INTSCAPECHAR; on the
3695  '' other hand to do that we'd have to solve the internal escape
3696  '' sequences, do the lcase/ucase, and then re-create internal
3697  '' escape sequences where needed.
3698  if( internallength <> reallength ) then
3699  exit function
3700  end if
3701 
3702  for i as integer = 0 to reallength - 1
3703  char = (*z)[i]
3704  if( (char >= chara) and (char <= charz) ) then
3705  char += chardiff
3706  end if
3707  (*z)[i] = char
3708  next
3709 
3710  function = symbAllocStrConst( z, reallength )
3711  end if
3712 end function
3713 
3714 function rtlStrCase _
3715  ( _
3716  byval expr as ASTNODE ptr, _
3717  byval mode as ASTNODE ptr, _
3718  byval is_lcase as integer _
3719  ) as ASTNODE ptr
3720 
3721  dim as ASTNODE ptr proc = any
3722  dim as FBSYMBOL ptr f = any, literal = any
3723 
3724  '' Evalute ASCII-only Lcase/Ucase at compile-time if possible.
3725 
3726  '' Mode given?
3727  if( mode ) then
3728  '' Constant string?
3729  literal = astGetStrLitSymbol( expr )
3730  if( literal ) then
3731  '' Constant mode?
3732  if( astIsCONST( mode ) ) then
3733  '' ASCII-only mode (1)?
3734  if( astConstGetAsInt64( mode ) = 1 ) then
3735  literal = hEvalAscCase( literal, is_lcase )
3736  if( literal ) then
3737  return astNewVAR( literal )
3738  end if
3739  end if
3740  end if
3741  end if
3742  end if
3743 
3744  if( is_lcase ) then
3745  if( astGetDataType( expr ) = FB_DATATYPE_WCHAR ) then
3746  f = PROCLOOKUP( WSTRLCASE2 )
3747  else
3748  f = PROCLOOKUP( STRLCASE2 )
3749  end if
3750  else
3751  if( astGetDataType( expr ) = FB_DATATYPE_WCHAR ) then
3752  f = PROCLOOKUP( WSTRUCASE2 )
3753  else
3754  f = PROCLOOKUP( STRUCASE2 )
3755  end if
3756  end if
3757 
3758  proc = astNewCALL( f )
3759 
3760  if( astNewARG( proc, expr ) = NULL ) then
3761  exit function
3762  end if
3763 
3764  '' mode can be NULL, in which case the param's default arg will be used
3765  if( astNewARG( proc, mode ) = NULL ) then
3766  exit function
3767  end if
3768 
3769  function = proc
3770 end function
3771 
3772 '':::::
3773 function rtlStrSwap _
3774  ( _
3775  byval str1 as ASTNODE ptr, _
3776  byval str2 as ASTNODE ptr _
3777  ) as integer
3778 
3779  function = FALSE
3780 
3781  var proc = astNewCALL( PROCLOOKUP( STRSWAP ) )
3782 
3783  '' always calc len before pushing the param
3784  var dtype1 = astGetDataType( str1 )
3785  var length1 = rtlCalcStrLen( str1, dtype1 )
3786 
3787  '' always calc len before pushing the param
3788  var dtype2 = astGetDataType( str2 )
3789  var length2 = rtlCalcStrLen( str2, dtype2 )
3790 
3791  '' byref str1 as any
3792  if( astNewARG( proc, str1, FB_DATATYPE_STRING ) = NULL ) then
3793  exit function
3794  end if
3795 
3796  '' byval len1 as integer
3797  if( astNewARG( proc, astNewCONSTi( length1 ) ) = NULL ) then
3798  exit function
3799  end if
3800 
3801  '' byval fillrem1 as integer = 1
3802  if( astNewARG( proc, astNewCONSTi( (dtype1 = FB_DATATYPE_FIXSTR) ) ) = NULL ) then
3803  exit function
3804  end if
3805 
3806  '' byref str2 as any
3807  if( astNewARG( proc, str2, FB_DATATYPE_STRING ) = NULL ) then
3808  exit function
3809  end if
3810 
3811  '' byval len2 as integer
3812  if( astNewARG( proc, astNewCONSTi( length2 ) ) = NULL ) then
3813  exit function
3814  end if
3815 
3816  '' byval fillrem2 as integer = 1
3817  if( astNewARG( proc, astNewCONSTi( (dtype2 = FB_DATATYPE_FIXSTR) ) ) = NULL ) then
3818  exit function
3819  end if
3820 
3821  astAdd( proc )
3822 
3823  function = TRUE
3824 end function
3825 
3826 '':::::
3827 function rtlWstrSwap _
3828  ( _
3829  byval str1 as ASTNODE ptr, _
3830  byval str2 as ASTNODE ptr _
3831  ) as integer
3832 
3833  function = FALSE
3834 
3835  var proc = astNewCALL( PROCLOOKUP( WSTRSWAP ) )
3836 
3837  '' always calc len before pushing the param
3838  var length = rtlCalcStrLen( str1, astGetDataType( str1 ) )
3839 
3840  '' byval str1 as wstring ptr
3841  if( astNewARG( proc, str1 ) = NULL ) then
3842  exit function
3843  end if
3844 
3845  '' byval len1 as integer
3846  if( astNewARG( proc, astNewCONSTi( length ) ) = NULL ) then
3847  exit function
3848  end if
3849 
3850  '' always calc len before pushing the param
3851  length = rtlCalcStrLen( str2, astGetDataType( str2 ) )
3852 
3853  '' byval str2 as wstring ptr
3854  if( astNewARG( proc, str2 ) = NULL ) then
3855  exit function
3856  end if
3857 
3858  '' byval len2 as integer
3859  if( astNewARG( proc, astNewCONSTi( length ) ) = NULL ) then
3860  exit function
3861  end if
3862 
3863  astAdd( proc )
3864 
3865  function = TRUE
3866 end function
3867