📄 utility.h
字号:
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.24 06/05/06 */ /* */ /* UTILITY HEADER FILE */ /*******************************************************//*************************************************************//* Purpose: Provides a set of utility functions useful to *//* other modules. Primarily these are the functions for *//* handling periodic garbage collection and appending *//* string data. *//* *//* Principal Programmer(s): *//* Gary D. Riley *//* *//* Contributing Programmer(s): *//* *//* Revision History: *//* *//* 6.24: Renamed BOOLEAN macro type to intBool. *//* *//*************************************************************/#ifndef _H_utility#define _H_utility#ifdef LOCALE#undef LOCALE#endifstruct cleanupFunction { char *name; void (*ip)(void *); int priority; struct cleanupFunction *next; short int environmentAware; };struct callFunctionItem { char *name; void (*func)(void *); int priority; struct callFunctionItem *next; short int environmentAware; }; struct trackedMemory { void *theMemory; struct trackedMemory *next; struct trackedMemory *prev; size_t memSize; }; #define UTILITY_DATA 55struct utilityData { struct cleanupFunction *ListOfCleanupFunctions; struct cleanupFunction *ListOfPeriodicFunctions; short GarbageCollectionLocks; short GarbageCollectionHeuristicsEnabled; short PeriodicFunctionsEnabled; short YieldFunctionEnabled; long EphemeralItemCount; long EphemeralItemSize; long CurrentEphemeralCountMax; long CurrentEphemeralSizeMax; void (*YieldTimeFunction)(void); int LastEvaluationDepth ; struct trackedMemory *trackList; };#define UtilityData(theEnv) ((struct utilityData *) GetEnvironmentData(theEnv,UTILITY_DATA)) #ifdef _UTILITY_SOURCE_#define LOCALE#else#define LOCALE extern#endif#if ENVIRONMENT_API_ONLY#define DecrementGCLocks(theEnv) EnvDecrementGCLocks(theEnv)#define IncrementGCLocks(theEnv) EnvIncrementGCLocks(theEnv)#define RemovePeriodicFunction(theEnv,a) EnvRemovePeriodicFunction(theEnv,a)#else#define DecrementGCLocks() EnvDecrementGCLocks(GetCurrentEnvironment())#define IncrementGCLocks() EnvIncrementGCLocks(GetCurrentEnvironment())#define RemovePeriodicFunction(a) EnvRemovePeriodicFunction(GetCurrentEnvironment(),a)#endif LOCALE void InitializeUtilityData(void *); LOCALE void PeriodicCleanup(void *,intBool,intBool); LOCALE intBool AddCleanupFunction(void *,char *,void (*)(void *),int); LOCALE intBool EnvAddPeriodicFunction(void *,char *,void (*)(void *),int); LOCALE intBool AddPeriodicFunction(char *,void (*)(void),int); LOCALE intBool RemoveCleanupFunction(void *,char *); LOCALE intBool EnvRemovePeriodicFunction(void *,char *); LOCALE char *AppendStrings(void *,char *,char *); LOCALE char *StringPrintForm(void *,char *); LOCALE char *AppendToString(void *,char *,char *,size_t *,size_t *); LOCALE char *AppendNToString(void *,char *,char *,size_t,size_t *,size_t *); LOCALE char *ExpandStringWithChar(void *,int,char *,size_t *,size_t *,size_t); LOCALE struct callFunctionItem *AddFunctionToCallList(void *,char *,int,void (*)(void *), struct callFunctionItem *,intBool); LOCALE struct callFunctionItem *RemoveFunctionFromCallList(void *,char *, struct callFunctionItem *, int *); LOCALE void DeallocateCallList(void *,struct callFunctionItem *); LOCALE unsigned ItemHashValue(void *,unsigned short,void *,unsigned); LOCALE void YieldTime(void *); LOCALE short SetGarbageCollectionHeuristics(void *,short); LOCALE void EnvIncrementGCLocks(void *); LOCALE void EnvDecrementGCLocks(void *); LOCALE short EnablePeriodicFunctions(void *,short); LOCALE short EnableYieldFunction(void *,short); LOCALE struct trackedMemory *AddTrackedMemory(void *,void *,size_t); LOCALE void RemoveTrackedMemory(void *,struct trackedMemory *);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -