本文整理匯總了C++中EnvRtnUnknown函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnvRtnUnknown函數的具體用法?C++ EnvRtnUnknown怎麽用?C++ EnvRtnUnknown使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnvRtnUnknown函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: get_argument
void get_argument(void* env, int argposition, void *& value) {
struct dataObject obj;
EnvRtnUnknown(env, argposition, &obj);
if (obj.type == EXTERNAL_ADDRESS) {
value = (((struct externalAddressHashNode *) (obj.value))->externalAddress);
}
}
示例2: EnvRtnUnknown
globle char *GetLogicalName(
void *theEnv,
int whichArgument,
char *defaultLogicalName)
{
char *logicalName;
DATA_OBJECT result;
EnvRtnUnknown(theEnv,whichArgument,&result);
if ((GetType(result) == SYMBOL) ||
(GetType(result) == STRING) ||
(GetType(result) == INSTANCE_NAME))
{
logicalName = ValueToString(result.value);
if ((strcmp(logicalName,"t") == 0) || (strcmp(logicalName,"T") == 0))
{ logicalName = defaultLogicalName; }
}
else if (GetType(result) == FLOAT)
{
logicalName = ValueToString(EnvAddSymbol(theEnv,FloatToString(theEnv,DOToDouble(result))));
}
else if (GetType(result) == INTEGER)
{
logicalName = ValueToString(EnvAddSymbol(theEnv,LongIntegerToString(theEnv,DOToLong(result))));
}
else
{ logicalName = NULL; }
return(logicalName);
}
示例3: SetBetaMemoryResizingCommand
globle int SetBetaMemoryResizingCommand(
void *theEnv)
{
int oldValue;
DATA_OBJECT argPtr;
oldValue = EnvGetBetaMemoryResizing(theEnv);
/*============================================*/
/* Check for the correct number of arguments. */
/*============================================*/
if (EnvArgCountCheck(theEnv,"set-beta-memory-resizing",EXACTLY,1) == -1)
{ return(oldValue); }
/*=================================================*/
/* The symbol FALSE disables beta memory resizing. */
/* Any other value enables beta memory resizing. */
/*=================================================*/
EnvRtnUnknown(theEnv,1,&argPtr);
if ((argPtr.value == EnvFalseSymbol(theEnv)) && (argPtr.type == SYMBOL))
{ EnvSetBetaMemoryResizing(theEnv,FALSE); }
else
{ EnvSetBetaMemoryResizing(theEnv,TRUE); }
/*=======================*/
/* Return the old value. */
/*=======================*/
return(oldValue);
}
示例4: get_argument
void get_argument(void* env, int argposition, void *& value) {
struct dataObject obj;
EnvRtnUnknown(env, argposition, &obj);
if (obj.type == EXTERNAL_ADDRESS) {
value = obj.value;
}
}
示例5: SetIncrementalResetCommand
globle int SetIncrementalResetCommand(
void *theEnv,
EXEC_STATUS)
{
int oldValue;
DATA_OBJECT argPtr;
struct defmodule *theModule;
oldValue = EnvGetIncrementalReset(theEnv,execStatus);
/*============================================*/
/* Check for the correct number of arguments. */
/*============================================*/
if (EnvArgCountCheck(theEnv,execStatus,"set-incremental-reset",EXACTLY,1) == -1)
{ return(oldValue); }
/*=========================================*/
/* The incremental reset behavior can't be */
/* changed when rules are loaded. */
/*=========================================*/
SaveCurrentModule(theEnv,execStatus);
for (theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,NULL);
theModule != NULL;
theModule = (struct defmodule *) EnvGetNextDefmodule(theEnv,execStatus,theModule))
{
EnvSetCurrentModule(theEnv,execStatus,(void *) theModule);
if (EnvGetNextDefrule(theEnv,execStatus,NULL) != NULL)
{
RestoreCurrentModule(theEnv,execStatus);
PrintErrorID(theEnv,execStatus,"INCRRSET",1,FALSE);
EnvPrintRouter(theEnv,execStatus,WERROR,"The incremental reset behavior cannot be changed with rules loaded.\n");
SetEvaluationError(theEnv,execStatus,TRUE);
return(oldValue);
}
}
RestoreCurrentModule(theEnv,execStatus);
/*==================================================*/
/* The symbol FALSE disables incremental reset. Any */
/* other value enables incremental reset. */
/*==================================================*/
EnvRtnUnknown(theEnv,execStatus,1,&argPtr);
if ((argPtr.value == EnvFalseSymbol(theEnv,execStatus)) && (argPtr.type == SYMBOL))
{ EnvSetIncrementalReset(theEnv,execStatus,FALSE); }
else
{ EnvSetIncrementalReset(theEnv,execStatus,TRUE); }
/*=======================*/
/* Return the old value. */
/*=======================*/
return(oldValue);
}
示例6: PointerpFunction
globle intBool PointerpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"pointerp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if (GetType(item) != EXTERNAL_ADDRESS) return(FALSE);
return(TRUE);
}
示例7: ReturnFunction
globle void ReturnFunction(
void *theEnv,
DATA_OBJECT_PTR result)
{
if (EnvRtnArgCount(theEnv) == 0)
{
result->type = RVOID;
result->value = EnvFalseSymbol(theEnv);
}
else
EnvRtnUnknown(theEnv,1,result);
ProcedureFunctionData(theEnv)->ReturnFlag = TRUE;
}
示例8: FuzzyvaluepFunction
globle intBool FuzzyvaluepFunction(
void *theEnv)
{
DATA_OBJECT valstruct;
if (EnvArgCountCheck(theEnv,"fuzzyvaluep",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&valstruct);
if (GetType(valstruct) != FUZZY_VALUE) return(FALSE);
return(TRUE);
}
示例9: MultifieldpFunction
globle intBool MultifieldpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"multifieldp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if (GetType(item) != MULTIFIELD) return(FALSE);
return(TRUE);
}
示例10: IntegerpFunction
globle intBool IntegerpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"integerp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if (GetType(item) != INTEGER) return(FALSE);
return(TRUE);
}
示例11: GetFactListFunction
globle void GetFactListFunction(
void *theEnv,
DATA_OBJECT_PTR returnValue)
{
struct defmodule *theModule;
DATA_OBJECT result;
int numArgs;
/*===========================================*/
/* Determine if a module name was specified. */
/*===========================================*/
if ((numArgs = EnvArgCountCheck(theEnv,"get-fact-list",NO_MORE_THAN,1)) == -1)
{
EnvSetMultifieldErrorValue(theEnv,returnValue);
return;
}
if (numArgs == 1)
{
EnvRtnUnknown(theEnv,1,&result);
if (GetType(result) != SYMBOL)
{
EnvSetMultifieldErrorValue(theEnv,returnValue);
ExpectedTypeError1(theEnv,"get-fact-list",1,"defmodule name");
return;
}
if ((theModule = (struct defmodule *) EnvFindDefmodule(theEnv,DOToString(result))) == NULL)
{
if (strcmp("*",DOToString(result)) != 0)
{
EnvSetMultifieldErrorValue(theEnv,returnValue);
ExpectedTypeError1(theEnv,"get-fact-list",1,"defmodule name");
return;
}
theModule = NULL;
}
}
else
{ theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv)); }
/*=====================*/
/* Get the constructs. */
/*=====================*/
EnvGetFactList(theEnv,returnValue,theModule);
}
示例12: StringpFunction
globle intBool StringpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,(char*)"stringp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if (GetType(item) == STRING)
{ return(TRUE); }
else
{ return(FALSE); }
}
示例13: FloatpFunction
globle intBool FloatpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"floatp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if (GetType(item) == FLOAT)
{ return(TRUE); }
else
{ return(FALSE); }
}
示例14: NumberpFunction
globle intBool NumberpFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"numberp",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if ((GetType(item) == FLOAT) || (GetType(item) == INTEGER))
{ return(TRUE); }
else
{ return(FALSE); }
}
示例15: LexemepFunction
globle intBool LexemepFunction(
void *theEnv)
{
DATA_OBJECT item;
if (EnvArgCountCheck(theEnv,"lexemep",EXACTLY,1) == -1) return(FALSE);
EnvRtnUnknown(theEnv,1,&item);
if ((GetType(item) == SYMBOL) || (GetType(item) == STRING))
{ return(TRUE); }
else
{ return(FALSE); }
}