104 dim as FBSYMBOL
ptr param =
any
105 dim as integer callconv =
any
109 if( procdef->
name = NULL )
then
113 callconv = procdef->callconv
116 if( callconv = FB_FUNCMODE_FBCALL )
then
117 callconv = env.target.fbcall
120 dim as integer doadd = TRUE
121 if( procdef->options
and FB_RTL_OPT_MT )
then
122 doadd = fbLangOptIsSet( FB_LANG_OPT_MT )
125 if( procdef->options
and FB_RTL_OPT_X86ONLY )
then
126 doadd
and= fbCpuTypeIsX86( )
130 if( (procdef->options
and FB_RTL_OPT_QBONLY) <> 0 )
then
131 doadd = ( env.clopt.lang = FB_LANG_QB )
133 if( (procdef->options
and FB_RTL_OPT_FBONLY) <> 0 )
then
134 doadd = ( env.clopt.lang = FB_LANG_FB )
136 if( (procdef->options
and FB_RTL_OPT_NOFB) <> 0 )
then
137 doadd = ( env.clopt.lang <> FB_LANG_FB )
145 for i
as integer = 0
to procdef->params-1
146 with procdef->paramTb(i)
147 dim as FBSYMBOL
ptr subtype = NULL
148 dim as integer attrib =
any, dtype =
any
149 dim as ASTNODE
ptr param_optval =
any
151 attrib = FB_SYMBATTRIB_OPTIONAL
153 select case as const .dtype
154 case FB_DATATYPE_STRING
158 case FB_DATATYPE_SINGLE, FB_DATATYPE_DOUBLE
162 case typeAddrOf( FB_DATATYPE_FUNCTION )
163 dim as integer inner_attrib =
any, func_arg =
any
164 dim as ASTNODE
ptr inner_param_optval =
any
165 dim as FBSYMBOL
ptr inner_proc =
any
169 for func_arg = 0
to .optval-1
172 with procdef->paramTb(i)
174 inner_attrib = FB_SYMBATTRIB_OPTIONAL
175 select case as const .dtype
176 case FB_DATATYPE_STRING
180 case FB_DATATYPE_SINGLE, FB_DATATYPE_DOUBLE
187 inner_param_optval = NULL
191 param =
symbAddProcParam( inner_proc, NULL, .dtype, NULL, .mode, inner_attrib )
199 with procdef->paramTb(i)
205 subtype =
symbAddProcPtr( inner_proc, .dtype, NULL, 0, env.target.fbcall )
210 if( .isopt = FALSE )
then
227 if( dtype = FB_DATATYPE_INVALID )
then
228 dtype = typeAddrOf( FB_DATATYPE_VOID )
233 if( .check_const )
then
234 symbSetIsRTLConst( param )
242 dim as FB_SYMBATTRIB attrib = 0
243 if( (procdef->options
and FB_RTL_OPT_OVER) <> 0 )
then
244 attrib = FB_SYMBATTRIB_OVERLOADED
247 if( (procdef->options
and FB_RTL_OPT_STRSUFFIX) <> 0 )
then
248 attrib
or= FB_SYMBATTRIB_SUFFIXED
252 dim as const zstring ptr pname = procdef->
name
253 dim as const zstring ptr palias = procdef->
alias
256 if( (procdef->options
and FB_RTL_OPT_OPERATOR) = 0 )
then
258 if( (procdef->options
and FB_RTL_OPT_NOQB) <> 0 )
then
259 if( fbLangIsSet( FB_LANG_QB ) )
then
260 if( palias = NULL )
then
261 static as string tmp_alias
263 palias =
strptr( tmp_alias )
266 static as string tmp_name
267 tmp_name =
"__" + *pname
268 pname =
strptr( tmp_name )
272 if( palias = NULL )
then
277 procdef->dtype, NULL, attrib, callconv, _
278 FB_SYMBOPT_DECLARING
or FB_SYMBOPT_RTL )
283 procdef->dtype, NULL, attrib
or FB_SYMBATTRIB_OPERATOR, callconv, _
284 FB_SYMBOPT_DECLARING
or FB_SYMBOPT_RTL )
286 if( proc <> NULL )
then
287 symbGetMangling( proc ) = FB_MANGLING_CPP
291 if( proc <> NULL )
then
292 symbSetProcCallback( proc, procdef->callback )
293 if( (procdef->options
and FB_RTL_OPT_ERROR) <> 0 )
then
294 symbSetIsThrowable( proc )
297 if( (procdef->options
and FB_RTL_OPT_IRHLCBUILTIN) <> 0 )
then
298 symbSetIsIrHlcBuiltin( proc )
301 if( (procdef->options
and FB_RTL_OPT_GCCBUILTIN) <> 0 )
then
302 symbSetIsGccBuiltin( proc )
305 if( (procdef->options
and FB_RTL_OPT_OPERATOR) = 0 )
then
306 errReportEx( FB_ERRMSG_DUPDEFINITION, *procdef->
name )
321 byval pname
as const zstring ptr, _
322 byval pidx
as integer _
325 dim as FBSYMCHAIN
ptr chain_ =
any
330 chain_ =
symbLookupAt( @symbGetGlobalNamespc( ), pname, FALSE, FALSE )
331 if( chain_ = NULL )
then
333 if( fbLangIsSet( FB_LANG_QB ) )
then
334 static as string tmp_name
335 tmp_name =
"__" + *pname
336 pname =
strptr( tmp_name )
337 chain_ =
symbLookupAt( @symbGetGlobalNamespc( ), pname, FALSE, FALSE )
338 if( chain_ = NULL )
then
361 byval sym
as FBSYMBOL
ptr, _
362 byval param1
as ASTNODE
ptr, _
363 byval param2
as ASTNODE
ptr _
366 dim as FB_ERRMSG err_num =
any
367 dim as integer args = 0
368 dim as FB_CALL_ARG_LIST arg_list = ( 0, NULL, NULL )
372 arg->mode = FB_PARAMMODE_BYVAL
375 if( param2 <> NULL )
then
378 arg->mode = FB_PARAMMODE_BYVAL
384 if( proc = NULL )
then
393 do while( arg <> NULL )
396 if(
astNewARG( procexpr, arg->expr, , arg->mode ) = NULL )
then
414 dim as FBSYMBOL
ptr s =
any
415 dim as integer dtype =
any
417 dtype = astGetDataType( expr )
418 select case as const dtype
419 case FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR, FB_DATATYPE_WCHAR
423 function =
symbCalcLen( dtype, astGetSubtype( expr ) )
432 byval expr
as ASTNODE
ptr, _
433 byval dtype
as integer _
436 dim as FBSYMBOL
ptr s
438 select case as const typeGet( dtype )
439 case FB_DATATYPE_BYTE, FB_DATATYPE_UBYTE
442 case FB_DATATYPE_FIXSTR, FB_DATATYPE_CHAR
443 s = astGetSymbol( expr )
448 if( symbGetType( s ) <> typeGetDtAndPtrOnly( dtype ) )
then
451 function = symbGetStrLen( s )
455 case FB_DATATYPE_WCHAR
456 s = astGetSymbol( expr )
461 if( symbGetType( s ) <> typeGetDtAndPtrOnly( dtype ) )
then
464 function = symbGetWStrLen( s )