trgLibP.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* trgLibP.h - event triggers header */
  2. /* Copyright 1997 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01f,07sep98,pr   Replaced LIST_MAX_LENGTH with TRG_MAX_REQUESTS
  7. 01e,12feb98,pr   Added hitCnt field in struct trigger. 
  8.  Moved some definitions in ../trgLib.h. Cleanup.
  9. 01d,15dec97,nps  Added 'library' conditional type.
  10. 01c,20nov97,pr   added several triggering macros, reworked triggering
  11.                  structure, added trgActionDefPerform 
  12. 01b,27oct97,pr   modified the struct trigger into an object. cleanup
  13. 01a,18jul97,pr   written
  14. */
  15. #ifndef __INCtrglibph
  16. #define __INCtrglibph
  17. /* This file contains event triggering information. See also eventP.h */
  18. #define TRIGGER_MASK   0x0000ffff
  19. #define TRG_MSGQ_MAX_MSGS  50
  20. #define TRG_MSGQ_OPTIONS   (MSG_Q_FIFO)
  21. #define TRG_MSG_LEN        4
  22. #define TRG_ACT_PRIORITY          100
  23. #define TRG_ACT_OPTIONS           VX_UNBREAKABLE
  24. #define TRG_ACT_SIZE              2048
  25.  
  26. #ifndef _ASMLANGUAGE
  27. #include "private/eventP.h"
  28. #include "msgQLib.h"
  29. #include "trgLib.h"
  30. #define TRG_MAX_REQUESTS 50
  31. typedef struct trigger 
  32.     {
  33.     OBJ_CORE objCore; /* trigger object core */
  34.     event_t             eventId;        /* event type */
  35.     UINT16              status;     /* status of the trigger, */
  36. /* i.e. enabled, disabled, etc */
  37.     BOOL                disable; /* check if trigger needs to be */
  38. /* disabled after use */
  39.     int                 contextType;    /* type of the context where the event occurs */
  40.     UINT32              contextId;      /* id of the context where the event occurs */
  41.     OBJ_ID objId;      /* object type */
  42.     struct trigger      *chain;         /* pointer to chained trigger */
  43.     struct trigger      *next;          /* ptr to next trigger in the list */
  44.     int  conditional;   /* check if a condition is set */
  45.     int  condType;   /* check the expression type (var/fn) */
  46.     void * condEx1;   /* pointer to conditional expression */
  47.     int  condOp;   /* conditional operator (==, !=, ...) */
  48.     int  condEx2;   /* second operand (constant) */
  49.     int          actionType;  /* type of action (none, fn, lib) */
  50.     FUNCPTR      actionFunc;  /* pointer to the action */
  51.     int                 actionArg;     /* argument passed to the action */
  52.     BOOL          actionDef;  /* defer the action */
  53.     int hitCnt;
  54.     } TRIGGER;
  55. #if defined(__STDC__) || defined(__cplusplus)
  56. extern STATUS    trgInit (void);
  57. extern STATUS  trgActionDefPerform (void);
  58. extern STATUS  trgActionDefStart (void);
  59. extern int     trgEvtToIndex (event_t event);
  60. extern BOOL     trgContextMatch (TRIGGER_ID pTrg);
  61. extern BOOL     trgCondTest (TRIGGER_ID pTrg, int objId);
  62. extern TRIGGER_ID     trgAddTcl (char * buff);
  63. extern void     trgActionPerform (TRIGGER_ID pTrg);
  64. extern void     trgCheck (event_t event, int index, int obj, int arg1, int arg2, 
  65.  int arg3, int arg4, int arg5);
  66. #else   /* __STDC__ */
  67. extern STATUS    trgInit ();
  68. extern STATUS  trgActionDefPerform ();
  69. extern STATUS  trgActionDefStart ();
  70. extern int     trgEvtToIndex ();
  71. extern BOOL     trgContextMatch ();
  72. extern BOOL     trgCondTest ();
  73. extern TRIGGER_ID     trgAddTcl ();
  74. extern void     trgActionPerform ();
  75. extern void     trgCheck () :
  76. #endif  /* __STDC__ */
  77. #endif /* _ASMLANGUAGE */ 
  78. #endif /* __INCtrglibph*/