You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( !(var = g_script.FindOrAddVar(name, strlen(name))) )
16
+
return -1; // Realistically should never happen.
17
+
var->Assign(value);
18
+
return0; // success
19
+
}
20
+
EXPORT unsignedintahkFindFunc(char *funcname)
21
+
{
22
+
return (unsignedint)g_script.FindFunc(funcname);
23
+
}
24
+
25
+
voidBIF_FindFunc(ExprTokenType &aResultToken, ExprTokenType *aParam[], int aParamCount) // Added in Nv8.
26
+
{
27
+
// Set default return value in case of early return.
28
+
aResultToken.symbol = SYM_INTEGER ;
29
+
aResultToken.marker = "";
30
+
// Get the first arg, which is the string used as the source of the extraction. Call it "findfunc" for clarity.
31
+
char funcname_buf[MAX_NUMBER_SIZE]; // A separate buf because aResultToken.buf is sometimes used to store the result.
32
+
char *funcname = ExprTokenToString(*aParam[0], funcname_buf); // Remember that aResultToken.buf is part of a union, though in this case there's no danger of overwriting it since our result will always be of STRING type (not int or float).
33
+
int funcname_length = (int)EXPR_TOKEN_LENGTH(aParam[0], funcname);
// Fix for v1.0.47: Must handle return_value BEFORE calling FreeAndRestoreFunctionVars() because return_value
196
+
// might be the contents of one of the function's local variables (which are about to be free'd).
197
+
/* bool block_further_processing = *return_value; // No need to check the following because they're implied for *return_value!=0: result != EARLY_EXIT && result != FAIL;
198
+
if (block_further_processing)
199
+
aMsgReply = (LPARAM)ATOI64(return_value); // Use 64-bit in case it's an unsigned number greater than 0x7FFFFFFF, in which case this allows it to wrap around to a negative.
200
+
//else leave aMsgReply uninitialized because we'll be returning false later below, which tells our caller
return0 ; // block_further_processing; // If false, the caller will ignore aMsgReply and process this message normally. If true, aMsgReply contains the reply the caller should immediately send for this message.
0 commit comments