home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / IO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-09  |  6.4 KB  |  191 lines

  1. /*  io.h
  2.  
  3.     Definitions for low level I/O functions.
  4.  
  5. */
  6.  
  7. /* $Copyright: 1987$ */
  8. /* $Revision:   8.4  $ */
  9.  
  10. #ifndef __IO_H
  11. #define __IO_H
  12.  
  13. #if !defined(___DEFS_H)
  14. #include <_defs.h>
  15. #endif
  16.  
  17. #if !defined(___NFILE_H)
  18. #include <_nfile.h>
  19. #endif
  20.  
  21.  
  22. #if !defined(RC_INVOKED)
  23.  
  24. #if defined(__STDC__)
  25. #pragma warn -nak
  26. #endif
  27.  
  28. #pragma pack(push, 1)
  29.  
  30. #endif  /* !RC_INVOKED */
  31.  
  32.  
  33. #ifndef __cplusplus
  34. #if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
  35. #define _WCHAR_T
  36. #define _WCHAR_T_DEFINED  /* For WINDOWS.H */
  37. typedef unsigned short wchar_t;
  38. #endif
  39. #endif
  40.  
  41. extern  unsigned    _RTLENTRY _EXPDATA _nfile;
  42.  
  43. #define HANDLE_MAX   (_NFILE_)
  44. struct  ftime   {
  45.     unsigned    ft_tsec  : 5;   /* Two second interval */
  46.     unsigned    ft_min   : 6;   /* Minutes */
  47.     unsigned    ft_hour  : 5;   /* Hours */
  48.     unsigned    ft_day   : 5;   /* Days */
  49.     unsigned    ft_month : 4;   /* Months */
  50.     unsigned    ft_year  : 7;   /* Year */
  51. };
  52.  
  53. #define SEEK_CUR    1
  54. #define SEEK_END    2
  55. #define SEEK_SET    0
  56.  
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60. int  _RTLENTRYF _EXPFUNC access  (const char _FAR *path, int amode);
  61. #ifdef __IN_CHMOD
  62. int  _RTLENTRY  _EXPFUNC _rtl_chmod  ();
  63. int  _RTLENTRY  _EXPFUNC _chmod  ();
  64. #else
  65. int  _RTLENTRY  _EXPFUNC _rtl_chmod (const char _FAR *__pathname, int __func, ... );
  66. int  _RTLENTRY  _EXPFUNC _chmod     (const char _FAR *__pathname, int __func, ... );
  67. #endif
  68. int  _RTLENTRY  _EXPFUNC chmod   (const char _FAR *__path, int __amode);
  69. int  _RTLENTRY  _EXPFUNC chsize  (int __handle, long __size);
  70. int  _RTLENTRYF _EXPFUNC _rtl_close  (int __handle);
  71. int  _RTLENTRYF _EXPFUNC _close  (int __handle);
  72. int  _RTLENTRYF _EXPFUNC close   (int __handle);
  73. int  _RTLENTRYF _EXPFUNC _rtl_creat  (const char _FAR *__path, int __attribute);
  74. int  _RTLENTRYF _EXPFUNC _creat  (const char _FAR *__path, int __attribute);
  75. int  _RTLENTRYF _EXPFUNC creat   (const char _FAR *__path, int __amode);
  76. int  _RTLENTRY  _EXPFUNC creatnew(const char _FAR *__path, int __mode); /* DOS 3.0 or later */
  77. int  _RTLENTRY  _EXPFUNC creattemp(char _FAR *__path, int __amode); /* DOS 3.0 or later */
  78. int  _RTLENTRY  _EXPFUNC32 dup   (int __handle);
  79. int  _RTLENTRY  _EXPFUNC32 dup2  (int __oldhandle, int __newhandle);
  80. int  _RTLENTRYF _EXPFUNC eof     (int __handle);
  81. long _RTLENTRYF _EXPFUNC filelength(int __handle);
  82. int  _RTLENTRY  _EXPFUNC32 getftime(int __handle, struct ftime _FAR *__ftimep);
  83.  
  84. #if defined(__FLAT__)
  85. int  _RTLENTRYF _EXPFUNC _waccess   (const wchar_t *__path, int __amode);
  86. int  _RTLENTRY  _EXPFUNC _wchmod    (const wchar_t *__path, int __amode);
  87. int  _RTLENTRY  _EXPFUNC _wrtl_chmod(const wchar_t *__pathname, int __func, ... );
  88. int  _RTLENTRYF _EXPFUNC _wcreat    (const wchar_t *__path, int __amode);
  89. int  _RTLENTRYF _EXPFUNC _wrtl_creat(const wchar_t *__path, int __attribute);
  90. #endif
  91.  
  92. #if defined(__OS2__)
  93. int  _RTLENTRY  _EXPFUNC _truncate(const char *__path, long __size);
  94. int  _RTLENTRYF _EXPFUNC _ftruncate(int __handle, long __size);
  95. #endif  /* __OS2__ */
  96.  
  97. #if defined(__WIN32__)
  98. long _RTLENTRY  _EXPFUNC _get_osfhandle(int __handle);
  99. int  _RTLENTRY  _EXPFUNC _open_osfhandle(long __osfhandle, int __oflag);
  100. #endif  /* __FLAT__ */
  101.  
  102. #ifdef __IN_IOCTL
  103. int  _RTLENTRY           ioctl   ();
  104. #else
  105. int  _RTLENTRY  _EXPFUNC ioctl   (int __handle, int __func, ...);
  106.         /* optional 3rd and 4th args are: void _FAR * __argdx, int argcx */
  107. #endif
  108.  
  109. int  _RTLENTRY  _EXPFUNC32 isatty(int __handle);
  110. int  _RTLENTRY  _EXPFUNC   lock  (int __handle, long __offset, long __length);
  111. int  _RTLENTRY  _EXPFUNC   locking(int __handle, int __mode, long __length);
  112. long _RTLENTRYF _EXPFUNC32 lseek (int __handle, long __offset, int __fromwhere);
  113. char _FAR * _RTLENTRYF _EXPFUNC mktemp( char _FAR *__template );
  114. #ifdef __IN_OPEN
  115. int  _RTLENTRY  _EXPFUNC   open  ();
  116. #else
  117. int  _RTLENTRY  _EXPFUNC   open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
  118. #endif
  119. #ifdef __FLAT__
  120. int  _RTLENTRY  _EXPFUNC   _wopen(const wchar_t *__path, int __access,... /*unsigned mode*/);
  121. #endif
  122. int  _RTLENTRYF _EXPFUNC   _rtl_open (const char _FAR *__path, int __oflags);
  123. int  _RTLENTRYF _EXPFUNC   _open (const char _FAR *__path, int __oflags);
  124. int  _RTLENTRYF _EXPFUNC   read  (int __handle, void _FAR *__buf, unsigned __len);
  125. int  _RTLENTRYF _EXPFUNC32 _rtl_read (int __handle, void _FAR *__buf, unsigned __len);
  126. int  _RTLENTRYF _EXPFUNC32 _read (int __handle, void _FAR *__buf, unsigned __len);
  127. int  _RTLENTRYF _EXPFUNC32 remove(const char _FAR *__path);
  128. int  _RTLENTRYF _EXPFUNC   rename(const char _FAR *__oldname,const char _FAR *__newname);
  129. int  _RTLENTRY  _EXPFUNC32 setftime(int __handle, struct ftime _FAR *__ftimep);
  130. int  _RTLENTRY  _EXPFUNC   setmode(int __handle, int __amode);
  131.  
  132. #ifdef __IN_SOPEN
  133. int  _RTLENTRY  _EXPFUNC32 sopen ();
  134. #else
  135. int  _RTLENTRY  _EXPFUNC32 sopen (const char _FAR *__path, int __access, int __shflag,
  136.                       ... /* unsigned mode */);
  137. #if defined(__FLAT__)
  138. int  _RTLENTRYF _EXPFUNC   _wrtl_open (const wchar_t *__path, int __oflags);
  139. int  _RTLENTRY  _EXPFUNC32 _wsopen (const wchar_t *__path, int __access, int __shflag,
  140.                       ... /* unsigned mode */);
  141. #endif
  142. #endif
  143. long _RTLENTRY  _EXPFUNC32 tell  (int __handle);
  144. unsigned _RTLENTRY         umask (unsigned __cmask);
  145. int  _RTLENTRYF _EXPFUNC32 unlink(const char _FAR *__path);
  146. #if defined(__FLAT__)
  147. int  _RTLENTRYF _EXPFUNC32 _wunlink(const wchar_t *__path);
  148. #endif
  149. int  _RTLENTRY  _EXPFUNC   unlock(int __handle, long __offset, long __length);
  150. int  _RTLENTRYF _EXPFUNC   _rtl_write(int __handle, const void _FAR *__buf, unsigned __len);
  151. int  _RTLENTRYF _EXPFUNC   _write(int __handle, const void _FAR *__buf, unsigned __len);
  152. int  _RTLENTRYF _EXPFUNC   write (int __handle, const void _FAR *__buf, unsigned __len);
  153.  
  154. #if !defined(__FLAT__)
  155.  /* Initialization call for Easy Windows */
  156. void _RTLENTRY             _InitEasyWin(void);
  157. #endif
  158.  
  159. #if defined(__MSC)
  160. #define _lseek(__handle, __offset, __fromwhere) lseek(__handle, __offset, __fromwhere)
  161. #define _dup(h) dup(h)
  162. #endif
  163.  
  164. #ifdef __cplusplus
  165. }
  166. #endif
  167.  
  168.  
  169. #if !defined(RC_INVOKED)
  170.  
  171. /* Obsolete functions */
  172. #pragma obsolete _chmod
  173. #pragma obsolete _close
  174. #pragma obsolete _creat
  175. #pragma obsolete _open
  176. #pragma obsolete _read
  177. #pragma obsolete _write
  178.  
  179. /* restore default packing */
  180. #pragma pack(pop)
  181.  
  182. #if defined(__STDC__)
  183. #pragma warn .nak
  184. #endif
  185.  
  186. #endif  /* !RC_INVOKED */
  187.  
  188.  
  189. #endif  /* __IO_H */
  190.  
  191.