home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / io.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  8.2 KB  |  258 lines

  1. /*  io.h
  2.  
  3.     Definitions for low level I/O functions.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1987, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.6  $ */
  15.  
  16. #ifndef __IO_H
  17. #define __IO_H
  18.  
  19. #ifndef ___STDDEF_H
  20. #include <_stddef.h>
  21. #endif
  22.  
  23. #if !defined(___NFILE_H)
  24. #include <_nfile.h>
  25. #endif
  26.  
  27.  
  28. #if !defined(RC_INVOKED)
  29.  
  30. #if defined(__STDC__)
  31. #pragma warn -nak
  32. #endif
  33.  
  34. #pragma pack(push, 1)
  35.  
  36. #endif  /* !RC_INVOKED */
  37.  
  38. #ifdef __cplusplus
  39. namespace std {
  40. #endif
  41.  
  42. extern  unsigned    _RTLENTRY _EXPDATA _nfile;
  43.  
  44. #define HANDLE_MAX   (_NFILE_)
  45. struct  ftime   {
  46.     unsigned    ft_tsec  : 5;   /* Two second interval */
  47.     unsigned    ft_min   : 6;   /* Minutes */
  48.     unsigned    ft_hour  : 5;   /* Hours */
  49.     unsigned    ft_day   : 5;   /* Days */
  50.     unsigned    ft_month : 4;   /* Months */
  51.     unsigned    ft_year  : 7;   /* Year */
  52. };
  53.  
  54. #define SEEK_CUR    1
  55. #define SEEK_END    2
  56. #define SEEK_SET    0
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. int  _RTLENTRYF _EXPFUNC access  (const char _FAR *__path, int __amode);
  62. #ifdef __IN_CHMOD
  63. int  _RTLENTRY  _EXPFUNC _rtl_chmod  ();
  64. int  _RTLENTRY  _EXPFUNC _chmod  ();
  65. #else
  66. int  _RTLENTRY  _EXPFUNC _rtl_chmod (const char _FAR *__pathname, int __func, ... );
  67. int  _RTLENTRY  _EXPFUNC _chmod     (const char _FAR *__pathname, int __func, ... );
  68. #endif
  69. int  _RTLENTRY  _EXPFUNC chmod   (const char _FAR *__path, int __amode);
  70. int  _RTLENTRY  _EXPFUNC chsize  (int __handle, long __size);
  71. int  _RTLENTRYF _EXPFUNC _rtl_close  (int __handle);
  72. int  _RTLENTRYF _EXPFUNC _close  (int __handle);
  73. int  _RTLENTRYF _EXPFUNC close   (int __handle);
  74. int  _RTLENTRYF _EXPFUNC _rtl_creat  (const char _FAR *__path, int __attribute);
  75. int  _RTLENTRYF _EXPFUNC _creat  (const char _FAR *__path, int __attribute);
  76. int  _RTLENTRYF _EXPFUNC creat   (const char _FAR *__path, int __amode);
  77. int  _RTLENTRY  _EXPFUNC creatnew(const char _FAR *__path, int __mode); /* DOS 3.0 or later */
  78. int  _RTLENTRY  _EXPFUNC creattemp(char _FAR *__path, int __amode); /* DOS 3.0 or later */
  79. int  _RTLENTRY  _EXPFUNC32 dup   (int __handle);
  80. int  _RTLENTRY  _EXPFUNC32 dup2  (int __oldhandle, int __newhandle);
  81. int  _RTLENTRYF _EXPFUNC eof     (int __handle);
  82. long _RTLENTRYF _EXPFUNC filelength(int __handle);
  83. int  _RTLENTRY  _EXPFUNC32 getftime(int __handle, struct ftime _FAR *__ftimep);
  84.  
  85. int  _RTLENTRY _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  _RTLENTRY _EXPFUNC _wcreat    (const wchar_t *__path, int __amode);
  89. int  _RTLENTRY _EXPFUNC _wrtl_creat(const wchar_t *__path, int __attribute);
  90. int  _RTLENTRY _EXPFUNC _wunlink   (const wchar_t *__path);
  91. int  _RTLENTRY _EXPFUNC _wremove   (const wchar_t * __path);
  92. int  _RTLENTRY _EXPFUNC _wrename   (const wchar_t *__oldname,const wchar_t *__newname);
  93. int  _RTLENTRY _EXPFUNC _wrtl_open (const wchar_t *__path, int __oflags);
  94. wchar_t   * _RTLENTRY  _EXPFUNC     _wmktemp(wchar_t *__template);
  95.  
  96. long _RTLENTRY  _EXPFUNC _get_osfhandle(int __handle);
  97. int  _RTLENTRY  _EXPFUNC _open_osfhandle(long __osfhandle, int __oflag);
  98.  
  99. #ifdef __IN_IOCTL
  100. int  _RTLENTRY           ioctl   ();
  101. #else
  102. int  _RTLENTRY  _EXPFUNC ioctl   (int __handle, int __func, ...);
  103.         /* optional 3rd and 4th args are: void _FAR * __argdx, int argcx */
  104. #endif
  105.  
  106. int  _RTLENTRY  _EXPFUNC32 isatty (int __handle);
  107. int  _RTLENTRY  _EXPFUNC   lock   (int __handle, long __offset, long __length);
  108. int  _RTLENTRY  _EXPFUNC   locking(int __handle, int __mode, long __length);
  109. long _RTLENTRY  _EXPFUNC32 lseek  (int __handle, long __offset, int __fromwhere);
  110. char * _RTLENTRY  _EXPFUNC   _mktemp(char *__template );
  111.  
  112. #ifdef __IN_OPEN
  113. int  _RTLENTRY  _EXPFUNC   open  ();
  114. int  _RTLENTRY  _EXPFUNC   _wopen  ();
  115. #else
  116. int  _RTLENTRY  _EXPFUNC   open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
  117. #endif
  118. int  _RTLENTRY  _EXPFUNC   _wopen(const wchar_t *__path, int __access,... /*unsigned mode*/);
  119. int  _RTLENTRYF _EXPFUNC   _rtl_open (const char _FAR *__path, int __oflags);
  120. int  _RTLENTRYF _EXPFUNC   _open (const char _FAR *__path, int __oflags);
  121. int  _RTLENTRYF _EXPFUNC   read  (int __handle, void _FAR *__buf, unsigned __len);
  122. int  _RTLENTRYF _EXPFUNC32 _rtl_read (int __handle, void _FAR *__buf, unsigned __len);
  123. int  _RTLENTRYF _EXPFUNC32 _read (int __handle, void _FAR *__buf, unsigned __len);
  124. #if 0
  125.   int  _RTLENTRYF _EXPFUNC32 remove(const char _FAR *__path);
  126.   int  _RTLENTRYF _EXPFUNC   rename(const char _FAR *__oldname,const char _FAR *__newname);
  127. #endif
  128. int  _RTLENTRY  _EXPFUNC32 setftime(int __handle, struct ftime _FAR *__ftimep);
  129. int  _RTLENTRY  _EXPFUNC   setmode(int __handle, int __amode);
  130.  
  131. #ifdef __IN_SOPEN
  132. int  _RTLENTRY  _EXPFUNC32 _sopen ();
  133. int  _RTLENTRY  _EXPFUNC32 _wsopen ();
  134. #else
  135. int  _RTLENTRY  _EXPFUNC32 _sopen (const char *__path, int __access, int __shflag,
  136.                       ... /* unsigned mode */);
  137. int  _RTLENTRY  _EXPFUNC32 _wsopen (const wchar_t *__path, int __access, int __shflag,
  138.                       ... /* unsigned mode */);
  139. #endif
  140. long _RTLENTRY  _EXPFUNC32 tell  (int __handle);
  141. unsigned _RTLENTRY         umask (unsigned __cmask);
  142. int  _RTLENTRYF _EXPFUNC32 unlink(const char _FAR *__path);
  143. int  _RTLENTRY  _EXPFUNC   unlock(int __handle, long __offset, long __length);
  144. int  _RTLENTRYF _EXPFUNC   _rtl_write(int __handle, const void _FAR *__buf, unsigned __len);
  145. int  _RTLENTRYF _EXPFUNC   _write(int __handle, const void _FAR *__buf, unsigned __len);
  146. int  _RTLENTRYF _EXPFUNC   write (int __handle, const void _FAR *__buf, unsigned __len);
  147. #if !defined(__STDC__)
  148. char  * _RTLENTRY _EXPFUNC mktemp( char *__template );
  149. #ifdef __IN_SOPEN
  150. int  _RTLENTRY _EXPFUNC32 sopen ();
  151. #else
  152. int  _RTLENTRY _EXPFUNC32 sopen (const char *__path, int __access, int __shflag,
  153.                       ... /* unsigned mode */);
  154. #endif /* __IN_SOPEN */
  155. #endif /* __STDC__ */
  156.  
  157. #if defined(__MSC)
  158. #define _lseek(__handle, __offset, __fromwhere) lseek(__handle, __offset, __fromwhere)
  159. #define _dup(h) dup(h)
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166.  
  167. #if !defined(RC_INVOKED)
  168.  
  169. /* Obsolete functions */
  170. #pragma obsolete _chmod
  171. #pragma obsolete _close
  172. #pragma obsolete _creat
  173. #pragma obsolete _open
  174. #pragma obsolete _read
  175. #pragma obsolete _write
  176.  
  177. /* restore default packing */
  178. #pragma pack(pop)
  179.  
  180. #if defined(__STDC__)
  181. #pragma warn .nak
  182. #endif
  183.  
  184. #endif  /* !RC_INVOKED */
  185.  
  186. #ifdef __cplusplus
  187. } // std
  188. #endif
  189.  
  190. #endif  /* __IO_H */
  191.  
  192. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__IO_H_USING_LIST)
  193. #define __IO_H_USING_LIST
  194.     using std::_nfile;
  195.     using std::access;
  196.     using std::_rtl_chmod;
  197.     using std::_chmod;
  198.     using std::_rtl_chmod;
  199.     using std::_chmod;
  200.     using std::chmod;
  201.     using std::chsize;
  202.     using std::_rtl_close;
  203.     using std::_close;
  204.     using std::close;
  205.     using std::_rtl_creat;
  206.     using std::_creat;
  207.     using std::creat;
  208.     using std::creatnew;
  209.     using std::creattemp;
  210.     using std::dup;
  211.     using std::dup2;
  212.     using std::eof;
  213.     using std::filelength;
  214.     using std::getftime;
  215.     using std::_waccess;
  216.     using std::_wchmod;
  217.     using std::_wrtl_chmod;
  218.     using std::_wcreat;
  219.     using std::_wrtl_creat;
  220.     using std::_wunlink;
  221.     using std::_wremove;
  222.     using std::_wrename;
  223.     using std::_wrtl_open;
  224.     using std::_wmktemp;
  225.     using std::_get_osfhandle;
  226.     using std::_open_osfhandle;
  227.     using std::ioctl;
  228.     using std::isatty;
  229.     using std::lock;
  230.     using std::locking;
  231.     using std::lseek;
  232.     using std::_mktemp;
  233.     using std::open;
  234.     using std::_wopen;
  235.     using std::open;
  236.     using std::_wopen;
  237.     using std::_rtl_open;
  238.     using std::_open;
  239.     using std::read;
  240.     using std::_rtl_read;
  241.     using std::_read;
  242.     using std::setftime;
  243.     using std::setmode;
  244.     using std::_sopen;
  245.     using std::_wsopen;
  246.     using std::tell;
  247.     using std::umask;
  248.     using std::unlink;
  249.     using std::unlock;
  250.     using std::_rtl_write;
  251.     using std::_write;
  252.     using std::write;
  253. #if !defined(__STDC__)
  254.     using std::mktemp;
  255.     using std::sopen;
  256. #endif
  257. #endif /* __USING_CNAME__ */
  258.