这篇教程C++ EnvArgCountCheck函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中EnvArgCountCheck函数的典型用法代码示例。如果您正苦于以下问题:C++ EnvArgCountCheck函数的具体用法?C++ EnvArgCountCheck怎么用?C++ EnvArgCountCheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了EnvArgCountCheck函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: IntegerFunctiongloble long int IntegerFunction( void *theEnv) { DATA_OBJECT valstruct; /*============================================*/ /* Check for the correct number of arguments. */ /*============================================*/ if (EnvArgCountCheck(theEnv,"integer",EXACTLY,1) == -1) return(0L); /*================================================================*/ /* Check for the correct type of argument. Note that ArgTypeCheck */ /* will convert floats to integers when an integer is requested */ /* (which is the purpose of the integer function). */ /*================================================================*/ if (EnvArgTypeCheck(theEnv,"integer",1,INTEGER,&valstruct) == FALSE) return(0L); /*===================================================*/ /* Return the numeric value converted to an integer. */ /*===================================================*/ return(ValueToLong(valstruct.value)); }
开发者ID:jonathangizmo,项目名称:pyclips,代码行数:25,
示例2: FloatFunctiongloble double FloatFunction( void *theEnv) { DATA_OBJECT valstruct; /*============================================*/ /* Check for the correct number of arguments. */ /*============================================*/ if (EnvArgCountCheck(theEnv,"float",EXACTLY,1) == -1) return(0.0); /*================================================================*/ /* Check for the correct type of argument. Note that ArgTypeCheck */ /* will convert integers to floats when a float is requested */ /* (which is the purpose of the float function). */ /*================================================================*/ if (EnvArgTypeCheck(theEnv,"float",1,FLOAT,&valstruct) == FALSE) return(0.0); /*================================================*/ /* Return the numeric value converted to a float. */ /*================================================*/ return(ValueToDouble(valstruct.value)); }
开发者ID:bitcababy,项目名称:ObjectiveCLIPS,代码行数:25,
示例3: LoadFactsCommandgloble int LoadFactsCommand( void *theEnv) { char *fileName; /*============================================*/ /* Check for the correct number of arguments. */ /*============================================*/ if (EnvArgCountCheck(theEnv,"load-facts",EXACTLY,1) == -1) return(FALSE); /*====================================================*/ /* Get the file name from which facts will be loaded. */ /*====================================================*/ if ((fileName = GetFileName(theEnv,"load-facts",1)) == NULL) return(FALSE); /*====================================*/ /* Call the LoadFacts driver routine. */ /*====================================*/ if (EnvLoadFacts(theEnv,fileName) == FALSE) return(FALSE); return(TRUE); }
开发者ID:DrItanium,项目名称:electron,代码行数:25,
示例4: ListDefmodulesCommandgloble void ListDefmodulesCommand( void *theEnv) { if (EnvArgCountCheck(theEnv,"list-defmodules",EXACTLY,0) == -1) return; EnvListDefmodules(theEnv,WDISPLAY); }
开发者ID:DrItanium,项目名称:durandal,代码行数:7,
示例5: SalienceEvaluationNamegloble void *SetSalienceEvaluationCommand( void *theEnv){ DATA_OBJECT argPtr; char *argument, *oldValue; /*==================================================*/ /* Get the current setting for salience evaluation. */ /*==================================================*/ oldValue = SalienceEvaluationName(EnvGetSalienceEvaluation(theEnv)); /*=========================================*/ /* This function expects a single argument */ /* which must be a symbol. */ /*=========================================*/ if (EnvArgCountCheck(theEnv,(char*)"set-salience-evaluation",EXACTLY,1) == -1) { return((SYMBOL_HN *) EnvAddSymbol(theEnv,oldValue)); } if (EnvArgTypeCheck(theEnv,(char*)"set-salience-evaluation",1,SYMBOL,&argPtr) == FALSE) { return((SYMBOL_HN *) EnvAddSymbol(theEnv,oldValue)); } /*=============================================================*/ /* The allowed symbols to pass as an argument to this function */ /* are when-defined, when-activated, and every-cycle. */ /*=============================================================*/ argument = DOToString(argPtr); if (strcmp(argument,(char*)"when-defined") == 0) { EnvSetSalienceEvaluation(theEnv,WHEN_DEFINED); } else if (strcmp(argument,(char*)"when-activated") == 0) { EnvSetSalienceEvaluation(theEnv,WHEN_ACTIVATED); } else if (strcmp(argument,(char*)"every-cycle") == 0) { EnvSetSalienceEvaluation(theEnv,EVERY_CYCLE); } else { ExpectedTypeError1(theEnv,(char*)"set-salience-evaluation",1, (char*)"symbol with value when-defined, when-activated, or every-cycle"); return((SYMBOL_HN *) EnvAddSymbol(theEnv,oldValue)); } /*=================================================*/ /* Return the old setting for salience evaluation. */ /*=================================================*/ return((SYMBOL_HN *) EnvAddSymbol(theEnv,oldValue));}
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:59,
示例6: SetIncrementalResetCommandgloble 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); }
开发者ID:atrniv,项目名称:CLIPS,代码行数:59,
示例7: ResetCommandgloble void ResetCommand( void *theEnv, EXEC_STATUS) { if (EnvArgCountCheck(theEnv,execStatus,"reset",EXACTLY,0) == -1) return; EnvReset(theEnv,execStatus); return; }
开发者ID:atrniv,项目名称:CLIPS,代码行数:8,
示例8: EnvArgCountCheckgloble void *GetClassDefaultsModeCommand( void *theEnv, EXEC_STATUS) { EnvArgCountCheck(theEnv,execStatus,"get-class-defaults-mode",EXACTLY,0); return((SYMBOL_HN *) EnvAddSymbol(theEnv,execStatus,GetClassDefaultsModeName(EnvGetClassDefaultsMode(theEnv,execStatus)))); }
开发者ID:atrniv,项目名称:CLIPS,代码行数:8,
示例9: GetFocusStackFunctiongloble void GetFocusStackFunction( void *theEnv, DATA_OBJECT_PTR returnValue) { if (EnvArgCountCheck(theEnv,"get-focus-stack",EXACTLY,0) == -1) return; EnvGetFocusStack(theEnv,returnValue); }
开发者ID:femto,项目名称:rbclips,代码行数:8,
示例10: ClearCommandgloble void ClearCommand( void *theEnv, EXEC_STATUS) { if (EnvArgCountCheck(theEnv,execStatus,"clear",EXACTLY,0) == -1) return; EnvClear(theEnv,execStatus); return; }
开发者ID:atrniv,项目名称:CLIPS,代码行数:8,
示例11: LowcaseFunctiongloble void LowcaseFunction( void *theEnv, DATA_OBJECT_PTR returnValue) { DATA_OBJECT theArg; unsigned i; size_t slen; char *osptr, *nsptr; /*================================================*/ /* Function lowcase expects exactly one argument. */ /*================================================*/ if (EnvArgCountCheck(theEnv,"lowcase",EXACTLY,1) == -1) { SetpType(returnValue,STRING); SetpValue(returnValue,(void *) EnvAddSymbol(theEnv,"")); return; } /*==================================================*/ /* The argument should be of type symbol or string. */ /*==================================================*/ if (EnvArgTypeCheck(theEnv,"lowcase",1,SYMBOL_OR_STRING,&theArg) == FALSE) { SetpType(returnValue,STRING); SetpValue(returnValue,(void *) EnvAddSymbol(theEnv,"")); return; } /*======================================================*/ /* Allocate temporary memory and then copy the original */ /* string or symbol to that memory, while lowercasing */ /* upper case alphabetic characters. */ /*======================================================*/ osptr = DOToString(theArg); slen = strlen(osptr) + 1; nsptr = (char *) gm2(theEnv,slen); for (i = 0 ; i < slen ; i++) { if (isupper(osptr[i])) { nsptr[i] = (char) tolower(osptr[i]); } else { nsptr[i] = osptr[i]; } } /*========================================*/ /* Return the lowercased string and clean */ /* up the temporary memory used. */ /*========================================*/ SetpType(returnValue,GetType(theArg)); SetpValue(returnValue,(void *) EnvAddSymbol(theEnv,nsptr)); rm(theEnv,nsptr,slen); }
开发者ID:RobotJustina,项目名称:JUSTINA,代码行数:58,
示例12: EnvArgCountCheckgloble void *GetFocusFunction( void *theEnv) { struct defmodule *rv; EnvArgCountCheck(theEnv,"get-focus",EXACTLY,0); rv = (struct defmodule *) EnvGetFocus(theEnv); if (rv == NULL) return((SYMBOL_HN *) EnvFalseSymbol(theEnv)); return(rv->name); }
开发者ID:femto,项目名称:rbclips,代码行数:10,
示例13: BatchCommandgloble int BatchCommand( void *theEnv){ char *fileName; if (EnvArgCountCheck(theEnv,(char*)"batch",EXACTLY,1) == -1) return(FALSE); if ((fileName = GetFileName(theEnv,(char*)"batch",1)) == NULL) return(FALSE); return(OpenBatch(theEnv,fileName,FALSE));}
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:10,
示例14: DribbleOnCommandgloble int DribbleOnCommand( void *theEnv) { char *fileName; if (EnvArgCountCheck(theEnv,"dribble-on",EXACTLY,1) == -1) return(FALSE); if ((fileName = GetFileName(theEnv,"dribble-on",1)) == NULL) return(FALSE); return (EnvDribbleOn(theEnv,fileName)); }
开发者ID:ricksladkey,项目名称:CLIPS,代码行数:10,
示例15: BatchStarCommandgloble int BatchStarCommand( void *theEnv) { char *fileName; if (EnvArgCountCheck(theEnv,"batch*",EXACTLY,1) == -1) return(FALSE); if ((fileName = GetFileName(theEnv,"batch*",1)) == NULL) return(FALSE); return(EnvBatchStar(theEnv,fileName)); }
开发者ID:ricksladkey,项目名称:CLIPS,代码行数:10,
示例16: ModFunctiongloble void ModFunction( void *theEnv, DATA_OBJECT_PTR result) { DATA_OBJECT item1, item2; double fnum1, fnum2; long long lnum1, lnum2; if (EnvArgCountCheck(theEnv,"mod",EXACTLY,2) == -1) { result->type = INTEGER; result->value = (void *) EnvAddLong(theEnv,0L); return; } if (EnvArgTypeCheck(theEnv,"mod",1,INTEGER_OR_FLOAT,&item1) == FALSE) { result->type = INTEGER; result->value = (void *) EnvAddLong(theEnv,0L); return; } if (EnvArgTypeCheck(theEnv,"mod",2,INTEGER_OR_FLOAT,&item2) == FALSE) { result->type = INTEGER; result->value = (void *) EnvAddLong(theEnv,0L); return; } if (((item2.type == INTEGER) ? (ValueToLong(item2.value) == 0L) : FALSE) || ((item2.type == FLOAT) ? ValueToDouble(item2.value) == 0.0 : FALSE)) { DivideByZeroErrorMessage(theEnv,"mod"); SetEvaluationError(theEnv,TRUE); result->type = INTEGER; result->value = (void *) EnvAddLong(theEnv,0L); return; } if ((item1.type == FLOAT) || (item2.type == FLOAT)) { fnum1 = CoerceToDouble(item1.type,item1.value); fnum2 = CoerceToDouble(item2.type,item2.value); result->type = FLOAT; result->value = (void *) EnvAddDouble(theEnv,fnum1 - (dtrunc(fnum1 / fnum2) * fnum2)); } else { lnum1 = DOToLong(item1); lnum2 = DOToLong(item2); result->type = INTEGER; result->value = (void *) EnvAddLong(theEnv,lnum1 - (lnum1 / lnum2) * lnum2); } }
开发者ID:Khenji55,项目名称:Computacion_UCLM,代码行数:54,
示例17: entryPointdouble entryPoint(void * environment){ if (EnvArgCountCheck(environment,"entryPoint",EXACTLY,1) == -1) return(-1.0); const char* streamName; streamName = EnvRtnLexeme(environment,1); printf("arg:%s", streamName); return 1.0;}
开发者ID:yang-neu,项目名称:brms_src,代码行数:11,
示例18: FactExistpFunctiongloble int FactExistpFunction( void *theEnv) { struct fact *theFact; if (EnvArgCountCheck(theEnv,"fact-existp",EXACTLY,1) == -1) return(-1L); theFact = GetFactAddressOrIndexArgument(theEnv,"fact-existp",1,FALSE); return(EnvFactExistp(theEnv,theFact)); }
开发者ID:noxdafox,项目名称:clips,代码行数:11,
示例19: GetIncrementalResetCommandgloble int GetIncrementalResetCommand( void *theEnv) { int oldValue; oldValue = EnvGetIncrementalReset(theEnv); if (EnvArgCountCheck(theEnv,"get-incremental-reset",EXACTLY,0) == -1) { return(oldValue); } return(oldValue); }
开发者ID:Anusaaraka,项目名称:anusaaraka,代码行数:12,
示例20: GetBetaMemoryResizingCommandgloble int GetBetaMemoryResizingCommand( void *theEnv) { int oldValue; oldValue = EnvGetBetaMemoryResizing(theEnv); if (EnvArgCountCheck(theEnv,"get-beta-memory-resizing",EXACTLY,0) == -1) { return(oldValue); } return(oldValue); }
开发者ID:gmyoungblood,项目名称:CLIPS,代码行数:12,
示例21: GetResetGlobalsCommandgloble int GetResetGlobalsCommand( void *theEnv) { int oldValue; oldValue = EnvGetResetGlobals(theEnv); if (EnvArgCountCheck(theEnv,"get-reset-globals",EXACTLY,0) == -1) { return(oldValue); } return(oldValue); }
开发者ID:femto,项目名称:rbclips,代码行数:12,
示例22: GSCCommandgloble int GSCCommand( void *theEnv) { int oldValue; oldValue = EnvGetStaticConstraintChecking(theEnv); if (EnvArgCountCheck(theEnv,"get-static-constraint-checking",EXACTLY,0) == -1) { return(oldValue); } return(oldValue); }
开发者ID:Khenji55,项目名称:Computacion_UCLM,代码行数:12,
示例23: AgendaDatagloble void *SetStrategyCommand( void *theEnv) { DATA_OBJECT argPtr; char *argument; int oldStrategy; oldStrategy = AgendaData(theEnv)->Strategy; /*=====================================================*/ /* Check for the correct number and type of arguments. */ /*=====================================================*/ if (EnvArgCountCheck(theEnv,"set-strategy",EXACTLY,1) == -1) { return((SYMBOL_HN *) EnvAddSymbol(theEnv,GetStrategyName(EnvGetStrategy(theEnv)))); } if (EnvArgTypeCheck(theEnv,"set-strategy",1,SYMBOL,&argPtr) == FALSE) { return((SYMBOL_HN *) EnvAddSymbol(theEnv,GetStrategyName(EnvGetStrategy(theEnv)))); } argument = DOToString(argPtr); /*=============================================*/ /* Set the strategy to the specified strategy. */ /*=============================================*/ if (strcmp(argument,"depth") == 0) { EnvSetStrategy(theEnv,DEPTH_STRATEGY); } else if (strcmp(argument,"breadth") == 0) { EnvSetStrategy(theEnv,BREADTH_STRATEGY); } else if (strcmp(argument,"lex") == 0) { EnvSetStrategy(theEnv,LEX_STRATEGY); } else if (strcmp(argument,"mea") == 0) { EnvSetStrategy(theEnv,MEA_STRATEGY); } else if (strcmp(argument,"complexity") == 0) { EnvSetStrategy(theEnv,COMPLEXITY_STRATEGY); } else if (strcmp(argument,"simplicity") == 0) { EnvSetStrategy(theEnv,SIMPLICITY_STRATEGY); } else if (strcmp(argument,"random") == 0) { EnvSetStrategy(theEnv,RANDOM_STRATEGY); } else { ExpectedTypeError1(theEnv,"set-strategy",1, "symbol with value depth, breadth, lex, mea, complexity, simplicity, or random"); return((SYMBOL_HN *) EnvAddSymbol(theEnv,GetStrategyName(EnvGetStrategy(theEnv)))); } /*=======================================*/ /* Return the old value of the strategy. */ /*=======================================*/ return((SYMBOL_HN *) EnvAddSymbol(theEnv,GetStrategyName(oldStrategy))); }
开发者ID:jonathangizmo,项目名称:pyclips,代码行数:52,
示例24: SingleNumberCheckstatic int SingleNumberCheck( void *theEnv, const char *functionName, double *theNumber) { DATA_OBJECT theValue; if (EnvArgCountCheck(theEnv,functionName,EXACTLY,1) == -1) return(FALSE); if (EnvArgTypeCheck(theEnv,functionName,1,FLOAT,&theValue) == FALSE) return(FALSE); *theNumber = DOToDouble(theValue); return(TRUE); }
开发者ID:Khenji55,项目名称:Computacion_UCLM,代码行数:13,
示例25: EnvArgCountCheckgloble void *GetCurrentModuleCommand( void *theEnv) { struct defmodule *theModule; EnvArgCountCheck(theEnv,"get-current-module",EXACTLY,0); theModule = (struct defmodule *) EnvGetCurrentModule(theEnv); if (theModule == NULL) return((SYMBOL_HN *) EnvFalseSymbol(theEnv)); return((SYMBOL_HN *) EnvAddSymbol(theEnv,ValueToString(theModule->name))); }
开发者ID:bigsmiles,项目名称:eventCLIPS,代码行数:13,
示例26: FuzzyvaluepFunctiongloble 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); }
开发者ID:garydriley,项目名称:FuzzyCLIPS631,代码行数:13,
示例27: PointerpFunctiongloble 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); }
开发者ID:garydriley,项目名称:FuzzyCLIPS631,代码行数:13,
示例28: MultifieldpFunctiongloble 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); }
开发者ID:garydriley,项目名称:FuzzyCLIPS631,代码行数:13,
示例29: GetFactAddressOrIndexArgumentgloble void *FactRelationFunction( void *theEnv) { struct fact *theFact; if (EnvArgCountCheck(theEnv,"fact-relation",EXACTLY,1) == -1) return(EnvFalseSymbol(theEnv)); theFact = GetFactAddressOrIndexArgument(theEnv,"fact-relation",1,FALSE); if (theFact == NULL) return(EnvFalseSymbol(theEnv)); return(FactRelation(theFact)); }
开发者ID:noxdafox,项目名称:clips,代码行数:13,
注:本文中的EnvArgCountCheck函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ EnvArgTypeCheck函数代码示例 C++ EnvAddSymbol函数代码示例 |