本文整理匯總了C++中EnvDefineFunction2函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnvDefineFunction2函數的具體用法?C++ EnvDefineFunction2怎麽用?C++ EnvDefineFunction2使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnvDefineFunction2函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: WatchFunctionDefinitions
globle void WatchFunctionDefinitions(
void *theEnv)
{
#if ! RUN_TIME
EnvDefineFunction2(theEnv,name_watch, 'v',
PTIEF WatchCommand,
fWatchCommand,
(char*)"1**w");
EnvDefineFunction2(theEnv,name_unwatch, 'v',
PTIEF UnwatchCommand,
fUnwatchCommand,
(char*)"1**w");
EnvDefineFunction2(theEnv, name_getwatchitem, 'b',
PTIEF GetWatchItemCommand,
fGetWatchItemCommand,
(char*)"11w");
EnvDefineFunction2(theEnv,name_listwatchitems, 'v',
PTIEF ListWatchItemsCommand,
fListWatchItemsCommand,
(char*)"0**w");
#endif
EnvAddRouter(theEnv,WTRACE,1000,RecognizeWatchRouters,CaptureWatchPrints,
NULL,NULL,NULL);
EnvDeactivateRouter(theEnv,WTRACE);
}
示例2: WatchFunctionDefinitions
globle void WatchFunctionDefinitions(
void *theEnv)
{
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"watch", 'v',
PTIEF WatchCommand,
"WatchCommand",
"1**w");
EnvDefineFunction2(theEnv,"unwatch", 'v',
PTIEF UnwatchCommand,
"UnwatchCommand",
"1**w");
EnvDefineFunction2(theEnv, "get-watch-item", 'b',
PTIEF GetWatchItemCommand,
"GetWatchItemCommand",
"11w");
EnvDefineFunction2(theEnv,"list-watch-items", 'v',
PTIEF ListWatchItemsCommand,
"ListWatchItemsCommand",
"0**w");
#endif
EnvAddRouter(theEnv,WTRACE,1000,RecognizeWatchRouters,CaptureWatchPrints,
NULL,NULL,NULL);
EnvDeactivateRouter(theEnv,WTRACE);
}
示例3: DefglobalBasicCommands
globle void DefglobalBasicCommands(
void *theEnv)
{
AddSaveFunction(theEnv,"defglobal",SaveDefglobals,40);
EnvAddResetFunction(theEnv,"defglobal",ResetDefglobals,50);
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"get-defglobal-list",'m',PTIEF GetDefglobalListFunction,"GetDefglobalListFunction","01w");
EnvDefineFunction2(theEnv,"undefglobal",'v',PTIEF UndefglobalCommand,"UndefglobalCommand","11w");
EnvDefineFunction2(theEnv,"defglobal-module",'w',PTIEF DefglobalModuleFunction,"DefglobalModuleFunction","11w");
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,"list-defglobals",'v', PTIEF ListDefglobalsCommand,"ListDefglobalsCommand","01w");
EnvDefineFunction2(theEnv,"ppdefglobal",'v',PTIEF PPDefglobalCommand,"PPDefglobalCommand","11w");
AddWatchItem(theEnv,"globals",0,&DefglobalData(theEnv)->WatchGlobals,0,DefglobalWatchAccess,DefglobalWatchPrint);
#endif
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
DefglobalBinarySetup(theEnv);
#endif
#if CONSTRUCT_COMPILER && (! RUN_TIME)
DefglobalCompilerSetup(theEnv);
#endif
#endif
}
示例4: DeftemplateBasicCommands
globle void DeftemplateBasicCommands(
void *theEnv)
{
#if ! DEFFACTS_CONSTRUCT
EnvAddResetFunction(theEnv,(char*)"deftemplate",ResetDeftemplates,0);
#endif
EnvAddClearFunction(theEnv,(char*)"deftemplate",ClearDeftemplates,0);
AddSaveFunction(theEnv,(char*)"deftemplate",SaveDeftemplates,10);
#if ! RUN_TIME
EnvDefineFunction2(theEnv,(char*)"get-deftemplate-list",'m',PTIEF GetDeftemplateListFunction,(char*)"GetDeftemplateListFunction",(char*)"01w");
EnvDefineFunction2(theEnv,(char*)"undeftemplate",'v',PTIEF UndeftemplateCommand,(char*)"UndeftemplateCommand",(char*)"11w");
EnvDefineFunction2(theEnv,(char*)"deftemplate-module",'w',PTIEF DeftemplateModuleFunction,(char*)"DeftemplateModuleFunction",(char*)"11w");
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,(char*)"list-deftemplates",'v', PTIEF ListDeftemplatesCommand,(char*)"ListDeftemplatesCommand",(char*)"01w");
EnvDefineFunction2(theEnv,(char*)"ppdeftemplate",'v',PTIEF PPDeftemplateCommand,(char*)"PPDeftemplateCommand",(char*)"11w");
#endif
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
DeftemplateBinarySetup(theEnv);
#endif
#if CONSTRUCT_COMPILER && (! RUN_TIME)
DeftemplateCompilerSetup(theEnv);
#endif
#endif
}
示例5: InitializeAgenda
globle void InitializeAgenda(
void *theEnv)
{
AllocateEnvironmentData(theEnv,AGENDA_DATA,sizeof(struct agendaData),NULL);
AgendaData(theEnv)->SalienceEvaluation = WHEN_DEFINED;
AgendaData(theEnv)->Strategy = DEFAULT_STRATEGY;
EnvAddClearFunction(theEnv,(char*)"agenda",AgendaClearFunction,0);
#if DEBUGGING_FUNCTIONS
AddWatchItem(theEnv,(char*)"activations",1,&AgendaData(theEnv)->WatchActivations,40,DefruleWatchAccess,DefruleWatchPrint);
#endif
#if ! RUN_TIME
EnvDefineFunction2(theEnv,(char*)"refresh", 'v', PTIEF RefreshCommand, (char*)"RefreshCommand", (char*)"11w");
EnvDefineFunction2(theEnv,(char*)"refresh-agenda",'v',
PTIEF RefreshAgendaCommand,
(char*)"RefreshAgendaCommand",
(char*)"01w");
EnvDefineFunction2(theEnv,(char*)"get-salience-evaluation",'w',
PTIEF GetSalienceEvaluationCommand,
(char*)"GetSalienceEvaluationCommand",
(char*)"00");
EnvDefineFunction2(theEnv,(char*)"set-salience-evaluation",'w',
PTIEF SetSalienceEvaluationCommand,
(char*)"SetSalienceEvaluationCommand",
(char*)"11w");
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,(char*)"agenda", 'v', PTIEF AgendaCommand, (char*)"AgendaCommand", (char*)"01w");
#endif
#endif
}
示例6: DefmoduleBasicCommands
globle void DefmoduleBasicCommands(
void *theEnv)
{
EnvAddClearFunction(theEnv,"defmodule",ClearDefmodules,2000);
#if DEFMODULE_CONSTRUCT
AddSaveFunction(theEnv,"defmodule",SaveDefmodules,1100);
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"get-defmodule-list",'m',PTIEF EnvGetDefmoduleList,"EnvGetDefmoduleList","00");
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,"list-defmodules",'v', PTIEF ListDefmodulesCommand,"ListDefmodulesCommand","00");
EnvDefineFunction2(theEnv,"ppdefmodule",'v',PTIEF PPDefmoduleCommand,"PPDefmoduleCommand","11w");
#endif
#endif
#endif
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
DefmoduleBinarySetup(theEnv);
#endif
#if CONSTRUCT_COMPILER && (! RUN_TIME)
DefmoduleCompilerSetup(theEnv);
#endif
}
示例7: DeffactsBasicCommands
globle void DeffactsBasicCommands(
void *theEnv)
{
EnvAddResetFunction(theEnv,"deffacts",ResetDeffacts,0);
EnvAddClearFunction(theEnv,"deffacts",ClearDeffacts,0);
AddSaveFunction(theEnv,"deffacts",SaveDeffacts,10);
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"get-deffacts-list",'m',PTIEF GetDeffactsListFunction,"GetDeffactsListFunction","01w");
EnvDefineFunction2(theEnv,"undeffacts",'v',PTIEF UndeffactsCommand,"UndeffactsCommand","11w");
EnvDefineFunction2(theEnv,"deffacts-module",'w',PTIEF DeffactsModuleFunction,"DeffactsModuleFunction","11w");
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,"list-deffacts",'v', PTIEF ListDeffactsCommand,"ListDeffactsCommand","01w");
EnvDefineFunction2(theEnv,"ppdeffacts",'v',PTIEF PPDeffactsCommand,"PPDeffactsCommand","11w");
#endif
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
DeffactsBinarySetup(theEnv);
#endif
#if CONSTRUCT_COMPILER && (! RUN_TIME)
DeffactsCompilerSetup(theEnv);
#endif
#endif
}
示例8: ConstructProfilingFunctionDefinitions
globle void ConstructProfilingFunctionDefinitions(
void *theEnv)
{
struct userDataRecord profileDataInfo = { 0, CreateProfileData, DeleteProfileData };
AllocateEnvironmentData(theEnv,PROFLFUN_DATA,sizeof(struct profileFunctionData),NULL);
memcpy(&ProfileFunctionData(theEnv)->ProfileDataInfo,&profileDataInfo,sizeof(struct userDataRecord));
ProfileFunctionData(theEnv)->LastProfileInfo = NO_PROFILE;
ProfileFunctionData(theEnv)->PercentThreshold = 0.0;
ProfileFunctionData(theEnv)->OutputString = OUTPUT_STRING;
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"profile",'v', PTIEF ProfileCommand,"ProfileCommand","11w");
EnvDefineFunction2(theEnv,"profile-info",'v', PTIEF ProfileInfoCommand,"ProfileInfoCommand","01w");
EnvDefineFunction2(theEnv,"profile-reset",'v', PTIEF ProfileResetCommand,"ProfileResetCommand","00");
EnvDefineFunction2(theEnv,"set-profile-percent-threshold",'d',
PTIEF SetProfilePercentThresholdCommand,
"SetProfilePercentThresholdCommand","11n");
EnvDefineFunction2(theEnv,"get-profile-percent-threshold",'d',
PTIEF GetProfilePercentThresholdCommand,
"GetProfilePercentThresholdCommand","00");
ProfileFunctionData(theEnv)->ProfileDataID = InstallUserDataRecord(theEnv,&ProfileFunctionData(theEnv)->ProfileDataInfo);
EnvAddClearFunction(theEnv,"profile",ProfileClearFunction,0);
#endif
}
示例9: InitializeConstraints
globle void InitializeConstraints(
void *theEnv)
{
#if (! RUN_TIME) && (! BLOAD_ONLY)
int i;
#endif
AllocateEnvironmentData(theEnv,CONSTRAINT_DATA,sizeof(struct constraintData),DeallocateConstraintData);
ConstraintData(theEnv)->StaticConstraintChecking = TRUE;
#if (! RUN_TIME) && (! BLOAD_ONLY)
ConstraintData(theEnv)->ConstraintHashtable = (struct constraintRecord **)
gm2(theEnv,(int) sizeof (struct constraintRecord *) *
SIZE_CONSTRAINT_HASH);
if (ConstraintData(theEnv)->ConstraintHashtable == NULL) EnvExitRouter(theEnv,EXIT_FAILURE);
for (i = 0; i < SIZE_CONSTRAINT_HASH; i++) ConstraintData(theEnv)->ConstraintHashtable[i] = NULL;
#endif
#if (! RUN_TIME)
EnvDefineFunction2(theEnv,"get-dynamic-constraint-checking",'b',GDCCommand,"GDCCommand", "00");
EnvDefineFunction2(theEnv,"set-dynamic-constraint-checking",'b',SDCCommand,"SDCCommand", "11");
EnvDefineFunction2(theEnv,"get-static-constraint-checking",'b',GSCCommand,"GSCCommand", "00");
EnvDefineFunction2(theEnv,"set-static-constraint-checking",'b',SSCCommand,"SSCCommand", "11");
#endif
}
示例10: FactCommandDefinitions
globle void FactCommandDefinitions(
void *theEnv)
{
#if ! RUN_TIME
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,"facts", 'v', PTIEF FactsCommand, "FactsCommand", "*4iu");
#endif
//madianyi Begin
EnvDefineFunction(theEnv,"update", 'u', PTIEF UpdateCommand, "UpdateCommand");
//madianyi End
EnvDefineFunction(theEnv,"assert", 'u', PTIEF AssertCommand, "AssertCommand");
EnvDefineFunction2(theEnv,"retract", 'v', PTIEF RetractCommand, "RetractCommand","1*z");
EnvDefineFunction2(theEnv,"assert-string", 'u', PTIEF AssertStringFunction, "AssertStringFunction", "11s");
EnvDefineFunction2(theEnv,"str-assert", 'u', PTIEF AssertStringFunction, "AssertStringFunction", "11s");
EnvDefineFunction2(theEnv,"get-fact-duplication",'b',
GetFactDuplicationCommand,"GetFactDuplicationCommand", "00");
EnvDefineFunction2(theEnv,"set-fact-duplication",'b',
SetFactDuplicationCommand,"SetFactDuplicationCommand", "11");
EnvDefineFunction2(theEnv,"save-facts", 'b', PTIEF SaveFactsCommand, "SaveFactsCommand", "1*wk");
EnvDefineFunction2(theEnv,"load-facts", 'b', PTIEF LoadFactsCommand, "LoadFactsCommand", "11k");
EnvDefineFunction2(theEnv,"fact-index", 'g', PTIEF FactIndexFunction,"FactIndexFunction", "11y");
AddFunctionParser(theEnv,"assert",AssertParse);
FuncSeqOvlFlags(theEnv,"assert",FALSE,FALSE);
#else
#if MAC_XCD
#pragma unused(theEnv)
#endif
#endif
}
示例11: DeveloperCommands
globle void DeveloperCommands(
void *theEnv)
{
#if ! RUN_TIME
EnvDefineFunction2(theEnv,(char*)"primitives-info",'v', PTIEF PrimitiveTablesInfo,(char*)"PrimitiveTablesInfo",(char*)"00");
EnvDefineFunction2(theEnv,(char*)"primitives-usage",'v', PTIEF PrimitiveTablesUsage,(char*)"PrimitiveTablesUsage",(char*)"00");
EnvDefineFunction2(theEnv,(char*)"enable-gc-heuristics",'v', PTIEF EnableGCHeuristics,(char*)"EnableGCHeuristics",(char*)"00");
EnvDefineFunction2(theEnv,(char*)"disable-gc-heuristics",'v', PTIEF DisableGCHeuristics,(char*)"DisableGCHeuristics",(char*)"00");
#if DEFRULE_CONSTRUCT && DEFTEMPLATE_CONSTRUCT
EnvDefineFunction2(theEnv,(char*)"validate-fact-integrity", 'b', PTIEF ValidateFactIntegrity, (char*)"ValidateFactIntegrity", "00");
EnvDefineFunction2(theEnv,(char*)"show-fpn",'v', PTIEF ShowFactPatternNetwork,(char*)"ShowFactPatternNetwork",(char*)"11w");
EnvDefineFunction2(theEnv,(char*)"show-fht",'v', PTIEF ShowFactHashTable,(char*)"ShowFactHashTable",(char*)"00");
#endif
#if DEFRULE_CONSTRUCT && OBJECT_SYSTEM
EnvDefineFunction2(theEnv,(char*)"show-opn",'v',PTIEF PrintObjectPatternNetwork,
(char*)"PrintObjectPatternNetwork",(char*)"00");
#endif
#if OBJECT_SYSTEM
EnvDefineFunction2(theEnv,(char*)"instance-table-usage",'v', PTIEF InstanceTableUsage,(char*)"InstanceTableUsage",(char*)"00");
#endif
#endif
}
示例12: FactCommandDefinitions
globle void FactCommandDefinitions(
void *theEnv)
{
#if ! RUN_TIME
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,(char*)"facts", 'v', PTIEF FactsCommand, (char*)"FactsCommand", (char*)"*4iu");
#endif
EnvDefineFunction(theEnv,(char*)"assert", 'u', PTIEF AssertCommand, (char*)"AssertCommand");
EnvDefineFunction2(theEnv,(char*)"retract", 'v', PTIEF RetractCommand, (char*)"RetractCommand",(char*)"1*z");
EnvDefineFunction2(theEnv,(char*)"assert-string", 'u', PTIEF AssertStringFunction, (char*)"AssertStringFunction", (char*)"11s");
EnvDefineFunction2(theEnv,(char*)"str-assert", 'u', PTIEF AssertStringFunction, (char*)"AssertStringFunction", (char*)"11s");
EnvDefineFunction2(theEnv,(char*)"get-fact-duplication",'b',
GetFactDuplicationCommand,(char*)"GetFactDuplicationCommand", (char*)"00");
EnvDefineFunction2(theEnv,(char*)"set-fact-duplication",'b',
SetFactDuplicationCommand,(char*)"SetFactDuplicationCommand", (char*)"11");
EnvDefineFunction2(theEnv,(char*)"save-facts", 'b', PTIEF SaveFactsCommand, (char*)"SaveFactsCommand", (char*)"1*wk");
EnvDefineFunction2(theEnv,(char*)"load-facts", 'b', PTIEF LoadFactsCommand, (char*)"LoadFactsCommand", (char*)"11k");
EnvDefineFunction2(theEnv,(char*)"fact-index", 'g', PTIEF FactIndexFunction,(char*)"FactIndexFunction", (char*)"11y");
AddFunctionParser(theEnv,(char*)"assert",AssertParse);
FuncSeqOvlFlags(theEnv,(char*)"assert",FALSE,FALSE);
#else
#if MAC_MCW || WIN_MCW || MAC_XCD
#pragma unused(theEnv)
#endif
#endif
}
示例13: ProceduralFunctionDefinitions
globle void ProceduralFunctionDefinitions(
void *theEnv)
{
AllocateEnvironmentData(theEnv,PRCDRFUN_DATA,sizeof(struct procedureFunctionData),DeallocateProceduralFunctionData);
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"if", 'u', PTIEF IfFunction, "IfFunction", NULL);
EnvDefineFunction2(theEnv,"while", 'u', PTIEF WhileFunction, "WhileFunction", NULL);
EnvDefineFunction2(theEnv,"loop-for-count",'u', PTIEF LoopForCountFunction, "LoopForCountFunction", NULL);
EnvDefineFunction2(theEnv,"(get-loop-count)",'g', PTIEF GetLoopCount, "GetLoopCount", NULL);
EnvDefineFunction2(theEnv,"bind", 'u', PTIEF BindFunction, "BindFunction", NULL);
EnvDefineFunction2(theEnv,"progn", 'u', PTIEF PrognFunction, "PrognFunction", NULL);
EnvDefineFunction2(theEnv,"return", 'u', PTIEF ReturnFunction, "ReturnFunction",NULL);
EnvDefineFunction2(theEnv,"break", 'v', PTIEF BreakFunction, "BreakFunction",NULL);
EnvDefineFunction2(theEnv,"switch", 'u', PTIEF SwitchFunction, "SwitchFunction",NULL);
ProceduralFunctionParsers(theEnv);
FuncSeqOvlFlags(theEnv,"progn",FALSE,FALSE);
FuncSeqOvlFlags(theEnv,"if",FALSE,FALSE);
FuncSeqOvlFlags(theEnv,"while",FALSE,FALSE);
FuncSeqOvlFlags(theEnv,"loop-for-count",FALSE,FALSE);
FuncSeqOvlFlags(theEnv,"return",FALSE,FALSE);
FuncSeqOvlFlags(theEnv,"switch",FALSE,FALSE);
#endif
EnvAddResetFunction(theEnv,"bind",FlushBindList,0);
EnvAddClearFunction(theEnv,"bind",FlushBindList,0);
}
示例14: FileCommandDefinitions
globle void FileCommandDefinitions(
void *theEnv)
{
AllocateEnvironmentData(theEnv,FILECOM_DATA,sizeof(struct fileCommandData),DeallocateFileCommandData);
#if ! RUN_TIME
#if DEBUGGING_FUNCTIONS
EnvDefineFunction2(theEnv,"batch",'b',PTIEF BatchCommand,"BatchCommand","11k");
EnvDefineFunction2(theEnv,"batch*",'b',PTIEF BatchStarCommand,"BatchStarCommand","11k");
EnvDefineFunction2(theEnv,"dribble-on",'b',PTIEF DribbleOnCommand,"DribbleOnCommand","11k");
EnvDefineFunction2(theEnv,"dribble-off",'b',PTIEF DribbleOffCommand,"DribbleOffCommand","00");
EnvDefineFunction2(theEnv,"save",'b',PTIEF SaveCommand,"SaveCommand","11k");
#endif
EnvDefineFunction2(theEnv,"load",'b',PTIEF LoadCommand,"LoadCommand","11k");
EnvDefineFunction2(theEnv,"load*",'b',PTIEF LoadStarCommand,"LoadStarCommand","11k");
#if BLOAD_AND_BSAVE
InitializeBsaveData(theEnv);
EnvDefineFunction2(theEnv,"bsave",'b', PTIEF BsaveCommand,"BsaveCommand","11k");
#endif
#if BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE
InitializeBloadData(theEnv);
EnvDefineFunction2(theEnv,"bload",'b',PTIEF BloadCommand,"BloadCommand","11k");
#endif
#endif
}
示例15: FactFunctionDefinitions
globle void FactFunctionDefinitions(
void *theEnv)
{
#if ! RUN_TIME
EnvDefineFunction2(theEnv,"fact-existp", 'b', PTIEF FactExistpFunction, "FactExistpFunction", "11z");
EnvDefineFunction2(theEnv,"fact-relation",'w', PTIEF FactRelationFunction,"FactRelationFunction", "11z");
EnvDefineFunction2(theEnv,"fact-slot-value",'u', PTIEF FactSlotValueFunction,"FactSlotValueFunction", "22*zw");
EnvDefineFunction2(theEnv,"fact-slot-names",'u', PTIEF FactSlotNamesFunction,"FactSlotNamesFunction", "11z");
EnvDefineFunction2(theEnv,"get-fact-list",'m',PTIEF GetFactListFunction,"GetFactListFunction","01w");
#else
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(theEnv)
#endif
#endif
}