本文整理汇总了C++中FindFunction函数的典型用法代码示例。如果您正苦于以下问题:C++ FindFunction函数的具体用法?C++ FindFunction怎么用?C++ FindFunction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindFunction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompileText
/*
================
idProgram::CompileFunction
================
*/
const function_t *idProgram::CompileFunction( const char *functionName, const char *text ) {
bool result;
result = CompileText( functionName, text, false );
if ( g_disasm.GetBool() ) {
Disassemble();
}
if ( !result ) {
gameLocal.Error( "Compile failed." );
}
return FindFunction( functionName );
}
示例2: GetFunction
int GetFunction(ScriptValue *s, ScriptValue *o, ObjectValue *&obj) {
int function;
if (o->type != SCRIPT_OBJECT) {
function = FindFunction(s->stringVal->value);
obj = 0;
}
else {
obj = o->objectVal;
function = types[obj->type].FindFunction(s->stringVal);
if (function < 0) return function;
function = types[obj->type].functs[function].functionID;
obj->AddRef();
}
return function;
}
示例3: ExpectedTypeError2
globle void ExpectedTypeError2(
void *theEnv,
char *functionName,
int whichArg)
{
struct FunctionDefinition *theFunction;
char *theType;
theFunction = FindFunction(theEnv,functionName);
if (theFunction == NULL) return;
theType = GetArgumentTypeName(GetNthRestriction(theFunction,whichArg));
ExpectedTypeError1(theEnv,functionName,whichArg,theType);
}
示例4: RemoveFunctionParser
globle int RemoveFunctionParser(
char *functionName)
{
struct FunctionDefinition *fdPtr;
fdPtr = FindFunction(functionName);
if (fdPtr == NULL)
{
PrintRouter(WERROR,"Function parsers can only be removed from existing functions.\n");
return(0);
}
fdPtr->parser = NULL;
return(1);
}
示例5: method
/********************************************************
NAME : AddImplicitMethods
DESCRIPTION : Adds a method(s) for a generic function
for an overloaded system function
INPUTS : A pointer to a gneeric function
RETURNS : Nothing useful
SIDE EFFECTS : Method added
NOTES : Method marked as system
Assumes no other methods already present
********************************************************/
globle void AddImplicitMethods(
void *theEnv,
DEFGENERIC *gfunc)
{
struct FunctionDefinition *sysfunc;
EXPRESSION action;
sysfunc = FindFunction(theEnv,ValueToString(gfunc->header.name));
if (sysfunc == NULL)
return;
action.type = FCALL;
action.value = (void *) sysfunc;
action.nextArg = NULL;
action.argList = NULL;
FormMethodsFromRestrictions(theEnv,gfunc,sysfunc->restrictions,&action);
}
示例6: FindFunction
void FunctionTable::UpdateBuiltinFunction(const string & name, void * newInitFunction)
{
//Find the function
int funcIndex = FindFunction(name);
//Assign the function pointer
if(funcIndex != -1)
{
functionTable[funcIndex].origionalInternalPtr = newInitFunction;
}
else
{
LOGERR(("UpdateBuiltinFunction - Unknown built-in function? %s", name.c_str()));
}
}
示例7: AddFunction
//---------------------------------------------------------------------------
void AddFunction(AnsiString func_name, void *DELEGATE, JSContext *ctx = 0, JSObject *obj = 0) {
FunctionTypes *ft = FindFunction(func_name, ctx, obj);
bool created = false;
if (!ft) {
ft = new FunctionTypes;
created = true;
}
ft->func_name = func_name;
ft->DELEGATE = DELEGATE;
ft->ctx = ctx;
ft->obj = obj;
if (created) {
functions.push_back(ft);
}
}
示例8: ExpectedTypeError2
void ExpectedTypeError2(
Environment *theEnv,
const char *functionName,
unsigned int whichArg)
{
unsigned theRestriction;
struct functionDefinition *theFunction;
theFunction = FindFunction(theEnv,functionName);
if (theFunction == NULL) return;
theRestriction = GetNthRestriction(theEnv,theFunction,whichArg);
ExpectedTypeError0(theEnv,functionName,whichArg);
PrintTypesString(theEnv,STDERR,theRestriction,true);
}
示例9: RemoveFunctionParser
int RemoveFunctionParser(
void *theEnv,
const char *functionName)
{
struct FunctionDefinition *fdPtr;
fdPtr = FindFunction(theEnv,functionName);
if (fdPtr == NULL)
{
EnvPrintRouter(theEnv,WERROR,"Function parsers can only be removed from existing functions.\n");
return(0);
}
fdPtr->parser = NULL;
return(1);
}
示例10: _ASSERT
HRESULT StackFrame::GetLanguageName( BSTR* langName )
{
_ASSERT( langName != NULL );
HRESULT hr = S_OK;
hr = FindFunction();
if ( FAILED( hr ) )
return hr;
// if a function was found for our address, then it has a language
// we'll assume it's D for now
*langName = SysAllocString( L"D" );
if ( *langName == NULL )
return E_OUTOFMEMORY;
return S_OK;
}
示例11: FuncSeqOvlFlags
globle int FuncSeqOvlFlags(
char *functionName,
int seqp,
int ovlp)
{
struct FunctionDefinition *fdPtr;
fdPtr = FindFunction(functionName);
if (fdPtr == NULL)
{
PrintRouter(WERROR,"Only existing functions can be marked as using sequence expansion arguments/overloadable or not.\n");
return(FALSE);
}
fdPtr->sequenceuseok = (short) (seqp ? TRUE : FALSE);
fdPtr->overloadable = (short) (ovlp ? TRUE : FALSE);
return(TRUE);
}
示例12: return
globle struct expr *FunctionReferenceExpression(
void *theEnv,
const char *name)
{
#if DEFGENERIC_CONSTRUCT
void *gfunc;
#endif
#if DEFFUNCTION_CONSTRUCT
void *dptr;
#endif
struct FunctionDefinition *fptr;
/*=====================================================*/
/* Check to see if the function call is a deffunction. */
/*=====================================================*/
#if DEFFUNCTION_CONSTRUCT
if ((dptr = (void *) LookupDeffunctionInScope(theEnv,name)) != NULL)
{ return(GenConstant(theEnv,PCALL,dptr)); }
#endif
/*====================================================*/
/* Check to see if the function call is a defgeneric. */
/*====================================================*/
#if DEFGENERIC_CONSTRUCT
if ((gfunc = (void *) LookupDefgenericInScope(theEnv,name)) != NULL)
{ return(GenConstant(theEnv,GCALL,gfunc)); }
#endif
/*======================================*/
/* Check to see if the function call is */
/* a system or user defined function. */
/*======================================*/
if ((fptr = FindFunction(theEnv,name)) != NULL)
{ return(GenConstant(theEnv,FCALL,fptr)); }
/*===================================================*/
/* The specified function name is not a deffunction, */
/* defgeneric, or user/system defined function. */
/*===================================================*/
return(NULL);
}
示例13: FuncSeqOvlFlags
bool FuncSeqOvlFlags(
void *theEnv,
const char *functionName,
bool seqp,
bool ovlp)
{
struct FunctionDefinition *fdPtr;
fdPtr = FindFunction(theEnv,functionName);
if (fdPtr == NULL)
{
EnvPrintRouter(theEnv,WERROR,"Only existing functions can be marked as using sequence expansion arguments/overloadable or not.\n");
return(false);
}
fdPtr->sequenceuseok = (short) (seqp ? true : false);
fdPtr->overloadable = (short) (ovlp ? true : false);
return(true);
}
示例14: AddFunctionParser
globle int AddFunctionParser(
char *functionName,
struct expr *(*fpPtr)(struct expr *,char *))
{
struct FunctionDefinition *fdPtr;
fdPtr = FindFunction(functionName);
if (fdPtr == NULL)
{
PrintRouter(WERROR,"Function parsers can only be added for existing functions.\n");
return(0);
}
fdPtr->restrictions = NULL;
fdPtr->parser = fpPtr;
fdPtr->overloadable = FALSE;
return(1);
}
示例15: DefineFunction2
/********************************************************************
NAME : GetFunctionRestrictions
DESCRIPTION : Gets DefineFunction2() restriction list for function
INPUTS : None
RETURNS : A string containing the function restriction codes
SIDE EFFECTS : EvaluationError set on errors
NOTES : None
********************************************************************/
globle void *GetFunctionRestrictions(
void *theEnv)
{
DATA_OBJECT temp;
struct FunctionDefinition *fptr;
if (EnvArgTypeCheck(theEnv,"get-function-restrictions",1,SYMBOL,&temp) == FALSE)
return((SYMBOL_HN *) EnvAddSymbol(theEnv,""));
fptr = FindFunction(theEnv,DOToString(temp));
if (fptr == NULL)
{
CantFindItemErrorMessage(theEnv,"function",DOToString(temp));
SetEvaluationError(theEnv,TRUE);
return((SYMBOL_HN *) EnvAddSymbol(theEnv,""));
}
if (fptr->restrictions == NULL)
return((SYMBOL_HN *) EnvAddSymbol(theEnv,"0**"));
return((SYMBOL_HN *) EnvAddSymbol(theEnv,fptr->restrictions));
}