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

VxWorks

开发平台:

C/C++

  1. /* simLib.h - miscellaneous simulator routines header */
  2. /*
  3. modification history
  4. --------------------
  5. 02i,19dec01,jmp  added simReadSelect().
  6. 02h,04apr97,kab  added HPSIM ioctls, added more open() flags. (HPSIM merge,
  7.                  18mar98.)
  8. 02g,26mar97,jmb  added macros for converting file modes in HPSIM. (HPSIM merge,
  9.                  18mar98.)
  10. 02f,21mar97,cth  added forward declaration for s_ulipIoctl (SPR 8221, 8240)
  11. 02e,29jan97,pr   moved conversion code from simLib.c into a macro
  12. 02d,09jan97,pr   added macros for converting file modes in simsolaris
  13. 02c,14dec93,gae  removed u_printf() declaration (u_Lib.c) conflict for non stdc.
  14. 02b,14jul93,gae  fixed banner.
  15. 02a,09jan93,gae  renamed from sysULib.h; discarded major portions.
  16. 01c,05aug92,gae  added non-ANSI forward declarations.
  17. 01b,29jul92,gae  added more prototypes; ANSIfied.
  18. 01a,04jun92,gae  written.
  19. */
  20. /*
  21. This header contains the declarations for miscellaneous simulator routines.
  22. */
  23. #ifndef INCsimLibh
  24. #define INCsimLibh
  25. /* prototypes */
  26. #ifdef __STDC__
  27. extern void s_userGet (char *hostname, char *hostip, char *username, char *cwd);
  28. extern void s_fdint (int fd, int raw);
  29. extern void s_uname (char *sysname, char *nodename, char *release,
  30.      char *version, char *machine);
  31. extern int simReadSelect (int u_fd, int tv_sec, int tv_usec);
  32. #if CPU==SIMSPARCSOLARIS
  33. extern unsigned int solarisCvtFlags (unsigned int oFlags);
  34. extern int s_ulipIoctl (int fd, int cmd, char *pData, int len);
  35. #endif  /* CPU==SIMSPARCSOLARIS */
  36. #else /* __STDC__ */
  37. extern void s_userGet ();
  38. extern void s_fdint ();
  39. extern void s_uname ();
  40. extern int simReadSelect ();
  41. #if CPU==SIMSPARCSOLARIS
  42. extern unsigned int solarisCvtFlags ();
  43. extern int s_ulipIoctl ();
  44. #endif  /* CPU==SIMSPARCSOLARIS */
  45. #endif /* __STDC__ */
  46. /*
  47.  * VxWorks, SunOS and HPUX currently all use the same defines for most
  48.  * of the file modes.  Local versions of the modes are converted using yhe
  49.  * following macros so that they can be used instead of hard coded values.
  50.  */
  51. #if CPU==SIMSPARCSOLARIS
  52. #define L_RDONLY        0x000
  53. #define L_WRONLY        0x001
  54. #define L_RDWR          0x002
  55. #define L_NDELAY        0x004
  56. #define L_APPEND        0x008
  57. #define L_SYNC          0x010
  58. #define L_DSYNC         0x040
  59. #define L_NONBLOCK      0x080
  60. #define L_CREAT         0x100
  61. #define L_TRUNC         0x200
  62. #define L_EXCL          0x400
  63. #define L_NOCTTY        0x800
  64. #define L_RSYNC         0x8000
  65. #define L_VXSTART 0x4000
  66. #define ARCHCVTFLAGS(x) ((x&O_RDONLY ? L_RDONLY : 0) | (x&O_RDWR ? L_RDWR : 0)|
  67. (x&O_WRONLY ? L_WRONLY : 0) | (x&O_SYNC ? L_SYNC : 0)|
  68. (x&O_NDELAY ? L_NDELAY : 0)| (x&O_CREAT ? L_CREAT : 0)|
  69. (x&O_APPEND ? L_APPEND : 0) | (x&O_TRUNC ? L_TRUNC:0)|
  70. (x&O_EXCL ? L_EXCL : 0) | (x&O_NOCTTY ? L_NOCTTY : 0)|
  71. (x&O_NONBLOCK ? L_NONBLOCK : 0))
  72. #endif /* CPU==SIMSPARCSOLARIS */
  73. #endif /* INCsimLibh */