PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/clips-6.30.0.20090722svn/clips/watch.h

#
C Header | 89 lines | 50 code | 16 blank | 23 comment | 0 complexity | 3987983db601c29ba729fce667972ca7 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*******************************************************/
  2. /* "C" Language Integrated Production System */
  3. /* */
  4. /* CLIPS Version 6.24 06/05/06 */
  5. /* */
  6. /* WATCH HEADER FILE */
  7. /*******************************************************/
  8. /*************************************************************/
  9. /* Purpose: Support functions for the watch and unwatch */
  10. /* commands. */
  11. /* */
  12. /* Principal Programmer(s): */
  13. /* Gary D. Riley */
  14. /* */
  15. /* Contributing Programmer(s): */
  16. /* */
  17. /* Revision History: */
  18. /* */
  19. /* 6.24: Renamed BOOLEAN macro type to intBool. */
  20. /* */
  21. /* Added EnvSetWatchItem function. */
  22. /* */
  23. /*************************************************************/
  24. #ifndef _H_watch
  25. #define _H_watch
  26. #ifndef _H_expressn
  27. #include <clips/expressn.h>
  28. #endif
  29. #define WATCH_DATA 54
  30. struct watchItem
  31. {
  32. char *name;
  33. unsigned *flag;
  34. int code,priority;
  35. unsigned (*accessFunc)(void *,int,unsigned,struct expr *);
  36. unsigned (*printFunc)(void *,char *,int,struct expr *);
  37. struct watchItem *next;
  38. };
  39. struct watchData
  40. {
  41. struct watchItem *ListOfWatchItems;
  42. };
  43. #define WatchData(theEnv) ((struct watchData *) GetEnvironmentData(theEnv,WATCH_DATA))
  44. #ifdef LOCALE
  45. #undef LOCALE
  46. #endif
  47. #ifdef _WATCH_SOURCE_
  48. #define LOCALE
  49. #else
  50. #define LOCALE extern
  51. #endif
  52. #define GetWatchItem(a) EnvGetWatchItem(GetCurrentEnvironment(),a)
  53. #define SetWatchItem(a,b) EnvSetWatchItem(GetCurrentEnvironment(),a,b)
  54. #if ALLOW_ENVIRONMENT_GLOBALS
  55. LOCALE intBool Watch(char *);
  56. LOCALE intBool Unwatch(char *);
  57. #endif
  58. LOCALE intBool EnvWatch(void *,char *);
  59. LOCALE intBool EnvUnwatch(void *,char *);
  60. LOCALE void InitializeWatchData(void *);
  61. LOCALE int EnvSetWatchItem(void *,char *,unsigned,struct expr *);
  62. LOCALE int EnvGetWatchItem(void *,char *);
  63. LOCALE intBool AddWatchItem(void *,char *,int,unsigned *,int,
  64. unsigned (*)(void *,int,unsigned,struct expr *),
  65. unsigned (*)(void *,char *,int,struct expr *));
  66. LOCALE char *GetNthWatchName(void *,int);
  67. LOCALE int GetNthWatchValue(void *,int);
  68. LOCALE void WatchCommand(void *);
  69. LOCALE void UnwatchCommand(void *);
  70. LOCALE void ListWatchItemsCommand(void *);
  71. LOCALE void WatchFunctionDefinitions(void *);
  72. LOCALE int GetWatchItemCommand(void *);
  73. #endif