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

VxWorks

开发平台:

C/C++

  1. /* iosLibP.h - private I/O system header file */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,22dec98,lrn  add more fields to FD_ENTRY, added obsolete state
  7. 01c,09nov93,rrr  added aio support
  8. 01b,22sep92,rrr  added support for c++
  9. 01a,23aug92,jcf  written.
  10. */
  11. #ifndef __INCiosLibPh
  12. #define __INCiosLibPh
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include "iosLib.h"
  17. #include "dllLib.h"
  18. #include "errnoLib.h"
  19. /* typedefs */
  20. typedef struct /* FD_ENTRY - entries in file table */
  21.     {
  22.     DEV_HDR * pDevHdr; /* device header for this file */
  23.     int  value; /* driver's id for this file */
  24.     char * name; /* actual file name */
  25.     int taskId; /* task to receive SIGIO when enabled */
  26.     BOOL  inuse; /* active entry */
  27.     BOOL obsolete; /* underlying driver has been deleted */
  28.     void * auxValue; /* driver specific ptr, e.g. socket type */
  29.     void * reserved; /* reserved for driver use */
  30.     } FD_ENTRY;
  31. typedef struct /* DRV_ENTRY - entries in driver jump table */
  32.     {
  33.     FUNCPTR de_create;
  34.     FUNCPTR de_delete;
  35.     FUNCPTR de_open;
  36.     FUNCPTR de_close;
  37.     FUNCPTR de_read;
  38.     FUNCPTR de_write;
  39.     FUNCPTR de_ioctl;
  40.     BOOL de_inuse;
  41.     } DRV_ENTRY;
  42. /* macros */
  43. #define STD_FIX(fd) ((fd)+3)
  44. #define STD_UNFIX(fd) ((fd)-3)
  45. #define STD_MAP(fd) (STD_UNFIX(((fd) >= 0 && (fd) < 3) ? 
  46. ioTaskStdGet (0, fd) : (fd)))
  47. #define FD_CHECK(fd) (((fd) >= 0 && (fd) < maxFiles && 
  48. fdTable[(fd)].inuse && !fdTable[(fd)].obsolete )?
  49. &fdTable[(fd)] : (FD_ENTRY *) 
  50. (errnoSet (S_iosLib_INVALID_FILE_DESCRIPTOR), NULL))
  51. /* variable declarations */
  52. extern DL_LIST  iosDvList;
  53. extern DRV_ENTRY * drvTable;
  54. extern FD_ENTRY * fdTable;
  55. extern int  maxDrivers;
  56. extern int  maxFiles;
  57. extern VOIDFUNCPTR iosFdNewHookRtn;
  58. extern VOIDFUNCPTR iosFdFreeHookRtn;
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif /* __INCiosLibPh */