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

VxWorks

开发平台:

C/C++

  1. /* objLib.h - object management library header */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01q,20jun96,kkk  undid 01p change.
  7. 01p,09feb96,mem  test for NULL pointer in OBJ_VERIFY.
  8. 01o,31aug94,rdc  beefed up OBJ_VERIFY.
  9. 01n,15oct93,cd   added #ifndef _ASMLANGUAGE.
  10. 01m,10dec93,smb  modified OBJ_VERIFY for windview level 1 instrumentation
  11. 01l,22sep92,rrr  added support for c++
  12. 01k,29jul92,jcf  added errno.h include.
  13. 01j,04jul92,jcf  cleaned up.
  14. 01i,26may92,rrr  the tree shuffle
  15. 01h,04dec91,rrr  some ansi cleanup.
  16. 01g,04oct91,rrr  passed through the ansification filter
  17.   -fixed #else and #endif
  18.   -changed VOID to void
  19.   -changed copyright notice
  20. 01f,10jun91.del  added pragma for gnu960 alignment.
  21. 01e,05apr91,gae  added NOMANUAL to avoid fooling mangen.
  22. 01d,05oct90,shl  added ANSI function prototypes.
  23.                  made #endif ANSI style.
  24.  added copyright notice.
  25. 01c,15jul90,dnw  changed objAlloc() from (char*) to (void*)
  26.  added objAllocExtra()
  27. 01b,26jun90,jcf  added objAlloc()/objFree().
  28.  added standard object status codes.
  29. 01a,10dec89,jcf  written.
  30. */
  31. #ifndef __INCobjLibh
  32. #define __INCobjLibh
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #include "vxWorks.h"
  37. #include "errno.h"
  38. #include "vwModNum.h"
  39. /* status codes */
  40. #define S_objLib_OBJ_ID_ERROR (M_objLib | 1)
  41. #define S_objLib_OBJ_UNAVAILABLE (M_objLib | 2)
  42. #define S_objLib_OBJ_DELETED (M_objLib | 3)
  43. #define S_objLib_OBJ_TIMEOUT (M_objLib | 4)
  44. #define S_objLib_OBJ_NO_METHOD (M_objLib | 5)
  45. #ifndef _ASMLANGUAGE
  46. /* typedefs */
  47. typedef struct obj_core  *OBJ_ID; /* object id */
  48. /*******************************************************************************
  49. *
  50. * OBJ_VERIFY - check the validity of an object pointer
  51. *
  52. * This macro verifies the existence of the specified object by comparing the
  53. * object's classId with the expected class id.  If the object does not check
  54. * out, errno is set with the appropriate invalid id status.
  55. *
  56. * This macro also checks for the existance of an windview instrumented object.
  57. *
  58. * RETURNS: OK or ERROR if invalid object id
  59. *
  60. * NOMANUAL
  61. */
  62. #define OBJ_VERIFY(objId,classId)  
  63.     (                                                                    
  64.       (  
  65.       (((OBJ_ID)(objId))->pObjClass == (struct obj_class *)(classId)) || 
  66.        (  
  67.        ((OBJ_ID)(objId))->pObjClass &&  
  68.          (((OBJ_ID)(objId))->pObjClass ==                                
  69.         (CLASS_ID)(((struct obj_class *)(classId))->initRtn))    
  70.        )  
  71.       )                                                                  
  72.         ?                                                                
  73.             OK                                                           
  74.         :                                                                
  75.             (errno = S_objLib_OBJ_ID_ERROR, ERROR)                       
  76.     )
  77. /* function declarations */
  78. #if defined(__STDC__) || defined(__cplusplus)
  79. extern STATUS  objShow (OBJ_ID objId, int showType);
  80. #else /* __STDC__ */
  81. extern STATUS  objShow ();
  82. #endif /* __STDC__ */
  83. #endif /* _ASMLANGUAGE */
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* __INCobjLibh */