home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / IO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  11.2 KB  |  351 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.5
  9.  *
  10.  *      Copyright (c) 1987, 1999 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.10  $ */
  16.  
  17. #ifndef __IO_H
  18. #define __IO_H
  19.  
  20. #ifndef ___STDDEF_H
  21. #include <_stddef.h>
  22. #endif
  23.  
  24. #if !defined(___NFILE_H)
  25. #include <_nfile.h>
  26. #endif
  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. #ifndef  _TIME_T
  59. typedef long time_t;
  60. #ifdef __cplusplus
  61. #  define _TIME_T std::time_t
  62. #else
  63. #  define _TIME_T time_t
  64. #endif /* __cplusplus */
  65. #endif
  66.  
  67. /* MSC names for file attributes */
  68.  
  69. #define _A_NORMAL   0x00        /* Normal file, no attributes */
  70. #define _A_RDONLY   0x01        /* Read only attribute */
  71. #define _A_HIDDEN   0x02        /* Hidden file */
  72. #define _A_SYSTEM   0x04        /* System file */
  73. #define _A_VOLID    0x08        /* Volume label */
  74. #define _A_SUBDIR   0x10        /* Directory */
  75. #define _A_ARCH     0x20        /* Archive */
  76.  
  77. #ifndef MAXPATH
  78. #define MAXPATH   260
  79. #define MAXDIR    256
  80. #define MAXFILE   256
  81. #define MAXEXT    256
  82. #define MAXDRIVE    3
  83. #endif
  84.  
  85. /* Microsoft C compatible findfirst() data types */
  86.  
  87. #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) && !defined(__STDC__)
  88. struct _wfinddatai64_t {
  89.         unsigned attrib;
  90.         _TIME_T  time_create;   /* -1 for FAT file systems */
  91.         _TIME_T  time_access;   /* -1 for FAT file systems */
  92.         _TIME_T  time_write;
  93.         __int64  size;
  94.         wchar_t  name[MAXPATH];
  95. };
  96.  
  97. struct _finddatai64_t {
  98.         unsigned attrib;
  99.         _TIME_T  time_create;   /* -1 for FAT file systems */
  100.         _TIME_T  time_access;   /* -1 for FAT file systems */
  101.         _TIME_T  time_write;
  102.         __int64  size;
  103.         char     name[MAXPATH];
  104. };
  105. #endif /* _INTEGRAL_MAX_BITS */
  106.  
  107. struct _wfinddata_t {
  108.         unsigned attrib;
  109.         _TIME_T  time_create;   /* -1 for FAT file systems */
  110.         _TIME_T  time_access;   /* -1 for FAT file systems */
  111.         _TIME_T  time_write;
  112.         long     size;
  113.         wchar_t  name[MAXPATH];
  114. };
  115.  
  116. struct _finddata_t {
  117.         unsigned attrib;
  118.         _TIME_T  time_create;   /* -1 for FAT file systems */
  119.         _TIME_T  time_access;   /* -1 for FAT file systems */
  120.         _TIME_T  time_write;
  121.         long     size;
  122.         char     name[MAXPATH];
  123. };
  124.  
  125. #ifdef __cplusplus
  126. extern "C" {
  127. #endif
  128. int  _RTLENTRY _EXPFUNC access  (const char _FAR *__path, int __amode);
  129. #ifdef __IN_CHMOD
  130. int  _RTLENTRY _EXPFUNC _rtl_chmod  ();
  131. int  _RTLENTRY _EXPFUNC _chmod  ();
  132. #else
  133. int  _RTLENTRY _EXPFUNC _rtl_chmod (const char _FAR *__pathname, int __func, ... );
  134. int  _RTLENTRY _EXPFUNC _chmod     (const char _FAR *__pathname, int __func, ... );
  135. #endif
  136. int  _RTLENTRY _EXPFUNC chmod   (const char _FAR *__path, int __amode);
  137. int  _RTLENTRY _EXPFUNC chsize  (int __handle, long __size);
  138. int  _RTLENTRY _EXPFUNC _rtl_close  (int __handle);
  139. int  _RTLENTRY _EXPFUNC _close  (int __handle);
  140. int  _RTLENTRY _EXPFUNC close   (int __handle);
  141. int  _RTLENTRY _EXPFUNC _rtl_creat  (const char _FAR *__path, int __attribute);
  142. int  _RTLENTRY _EXPFUNC _creat  (const char _FAR *__path, int __attribute);
  143. int  _RTLENTRY _EXPFUNC creat   (const char _FAR *__path, int __amode);
  144. int  _RTLENTRY _EXPFUNC creatnew(const char _FAR *__path, int __mode); /* DOS 3.0 or later */
  145. int  _RTLENTRY _EXPFUNC creattemp(char _FAR *__path, int __amode); /* DOS 3.0 or later */
  146. int  _RTLENTRY _EXPFUNC dup   (int __handle);
  147. int  _RTLENTRY _EXPFUNC dup2  (int __oldhandle, int __newhandle);
  148. int  _RTLENTRY _EXPFUNC eof     (int __handle);
  149. long _RTLENTRY _EXPFUNC filelength(int __handle);
  150. int  _RTLENTRY _EXPFUNC getftime(int __handle, struct ftime _FAR *__ftimep);
  151.  
  152. #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) && !defined(__STDC__)
  153. long _RTLENTRY _EXPFUNC _wfindfirsti64(wchar_t *, struct _wfinddatai64_t *);
  154. long _RTLENTRY _EXPFUNC _wfindnexti64(long, struct _wfinddatai64_t *);
  155. long _RTLENTRY _EXPFUNC _findfirsti64(char *, struct _finddatai64_t *);
  156. long _RTLENTRY _EXPFUNC _findnexti64(long, struct _finddatai64_t *);
  157. #endif /* _INTEGRAL_MAX_BITS */
  158.  
  159. long _RTLENTRY _EXPFUNC __wfindfirst(wchar_t *, struct _wfinddata_t *);
  160. long _RTLENTRY _EXPFUNC __wfindnext(long, struct _wfinddata_t *);
  161. long _RTLENTRY _EXPFUNC _findfirst(char *, struct _finddata_t *);
  162. long _RTLENTRY _EXPFUNC _findnext(long, struct _finddata_t *);
  163.  
  164. int _RTLENTRY _EXPFUNC _findclose(long);
  165.  
  166. int  _RTLENTRY _EXPFUNC _waccess   (const wchar_t *__path, int __amode);
  167. int  _RTLENTRY _EXPFUNC _wchmod    (const wchar_t *__path, int __amode);
  168. int  _RTLENTRY _EXPFUNC _wrtl_chmod(const wchar_t *__pathname, int __func, ... );
  169. int  _RTLENTRY _EXPFUNC _wcreat    (const wchar_t *__path, int __amode);
  170. int  _RTLENTRY _EXPFUNC _wrtl_creat(const wchar_t *__path, int __attribute);
  171. int  _RTLENTRY _EXPFUNC _wunlink   (const wchar_t *__path);
  172. int  _RTLENTRY _EXPFUNC _wremove   (const wchar_t * __path);
  173. int  _RTLENTRY _EXPFUNC _wrename   (const wchar_t *__oldname,const wchar_t *__newname);
  174. int  _RTLENTRY _EXPFUNC _wrtl_open (const wchar_t *__path, int __oflags);
  175. wchar_t   * _RTLENTRY  _EXPFUNC     _wmktemp(wchar_t *__template);
  176.  
  177. long _RTLENTRY  _EXPFUNC _get_osfhandle(int __handle);
  178. int  _RTLENTRY  _EXPFUNC _open_osfhandle(long __osfhandle, int __oflag);
  179.  
  180. #ifdef __IN_IOCTL
  181. int  _RTLENTRY           ioctl   ();
  182. #else
  183. int  _RTLENTRY _EXPFUNC ioctl   (int __handle, int __func, ...);
  184.         /* optional 3rd and 4th args are: void _FAR * __argdx, int argcx */
  185. #endif
  186.  
  187. int  _RTLENTRY _EXPFUNC isatty (int __handle);
  188. int  _RTLENTRY _EXPFUNC lock   (int __handle, long __offset, long __length);
  189. int  _RTLENTRY _EXPFUNC locking(int __handle, int __mode, long __length);
  190. long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
  191. char * _RTLENTRY _EXPFUNC   _mktemp(char *__template );
  192.  
  193. #ifdef __IN_OPEN
  194. int  _RTLENTRY _EXPFUNC open  ();
  195. int  _RTLENTRY _EXPFUNC _wopen  ();
  196. #else
  197. int  _RTLENTRY _EXPFUNC open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
  198. #endif
  199. int  _RTLENTRY _EXPFUNC _wopen(const wchar_t *__path, int __access,... /*unsigned mode*/);
  200. int  _RTLENTRY _EXPFUNC _rtl_open (const char _FAR *__path, int __oflags);
  201. int  _RTLENTRY _EXPFUNC _open (const char _FAR *__path, int __oflags);
  202. int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
  203. int  _RTLENTRY _EXPFUNC _rtl_read (int __handle, void _FAR *__buf, unsigned __len);
  204. int  _RTLENTRY _EXPFUNC _read (int __handle, void _FAR *__buf, unsigned __len);
  205. int  _RTLENTRY _EXPFUNC remove(const char _FAR *__path);
  206. int  _RTLENTRY _EXPFUNC rename(const char _FAR *__oldname,const char _FAR *__newname);
  207. int  _RTLENTRY  _EXPFUNC setftime(int __handle, struct ftime _FAR *__ftimep);
  208. int  _RTLENTRY  _EXPFUNC setmode(int __handle, int __amode);
  209.  
  210. #ifdef __IN_SOPEN
  211. int  _RTLENTRY  _EXPFUNC _sopen ();
  212. int  _RTLENTRY  _EXPFUNC _wsopen ();
  213. #else
  214. int  _RTLENTRY  _EXPFUNC _sopen (const char *__path, int __access, int __shflag,
  215.                       ... /* unsigned mode */);
  216. int  _RTLENTRY  _EXPFUNC _wsopen (const wchar_t *__path, int __access, int __shflag,
  217.                       ... /* unsigned mode */);
  218. #endif
  219. long _RTLENTRY _EXPFUNC tell  (int __handle);
  220. unsigned _RTLENTRY      umask (unsigned __cmask);
  221. int  _RTLENTRY _EXPFUNC unlink(const char _FAR *__path);
  222. int  _RTLENTRY _EXPFUNC unlock(int __handle, long __offset, long __length);
  223. int  _RTLENTRY _EXPFUNC _rtl_write(int __handle, const void _FAR *__buf, unsigned __len);
  224. int  _RTLENTRY _EXPFUNC _write(int __handle, const void _FAR *__buf, unsigned __len);
  225. int  _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
  226. #if !defined(__STDC__)
  227. char  * _RTLENTRY _EXPFUNC mktemp( char *__template );
  228. #ifdef __IN_SOPEN
  229. int  _RTLENTRY _EXPFUNC sopen ();
  230. #else
  231. int  _RTLENTRY _EXPFUNC sopen (const char *__path, int __access, int __shflag,
  232.                       ... /* unsigned mode */);
  233. #endif /* __IN_SOPEN */
  234. #endif /* __STDC__ */
  235.  
  236. #define _lseek(__handle, __offset, __fromwhere) lseek(__handle, __offset, __fromwhere)
  237. #define _dup(__h) dup(__h)
  238.  
  239. #ifdef __cplusplus
  240. }
  241. #endif
  242.  
  243.  
  244. #if !defined(RC_INVOKED)
  245.  
  246. /* Obsolete functions */
  247. #pragma obsolete _chmod
  248. #pragma obsolete _close
  249. #pragma obsolete _creat
  250. #pragma obsolete _open
  251. #pragma obsolete _read
  252. #pragma obsolete _write
  253.  
  254. /* restore default packing */
  255. #pragma pack(pop)
  256.  
  257. #if defined(__STDC__)
  258. #pragma warn .nak
  259. #endif
  260.  
  261. #endif  /* !RC_INVOKED */
  262.  
  263. #ifdef __cplusplus
  264. } // std
  265. #endif
  266.  
  267. #endif  /* __IO_H */
  268.  
  269. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__IO_H_USING_LIST)
  270. #define __IO_H_USING_LIST
  271.     using std::_nfile;
  272.     using std::access;
  273.     using std::_rtl_chmod;
  274.     using std::_chmod;
  275.     using std::_rtl_chmod;
  276.     using std::_chmod;
  277.     using std::chmod;
  278.     using std::chsize;
  279.     using std::_rtl_close;
  280.     using std::_close;
  281.     using std::close;
  282.     using std::_rtl_creat;
  283.     using std::_creat;
  284.     using std::creat;
  285.     using std::creatnew;
  286.     using std::creattemp;
  287.     using std::dup;
  288.     using std::dup2;
  289.     using std::eof;
  290.     using std::filelength;
  291.     using std::getftime;
  292.     using std::_waccess;
  293.     using std::_wchmod;
  294.     using std::_wrtl_chmod;
  295.     using std::_wcreat;
  296.     using std::_wrtl_creat;
  297.     using std::_wunlink;
  298.     using std::_wremove;
  299.     using std::_wrename;
  300.     using std::_wrtl_open;
  301.     using std::_wmktemp;
  302.     using std::_get_osfhandle;
  303.     using std::_open_osfhandle;
  304.     using std::ioctl;
  305.     using std::isatty;
  306.     using std::lock;
  307.     using std::locking;
  308.     using std::lseek;
  309.     using std::_mktemp;
  310.     using std::open;
  311.     using std::_wopen;
  312.     using std::open;
  313.     using std::_wopen;
  314.     using std::_rtl_open;
  315.     using std::_open;
  316.     using std::read;
  317.     using std::_rtl_read;
  318.     using std::_read;
  319.     using std::setftime;
  320.     using std::setmode;
  321.     using std::_sopen;
  322.     using std::_wsopen;
  323.     using std::tell;
  324.     using std::umask;
  325.     using std::unlink;
  326.     using std::unlock;
  327.     using std::_rtl_write;
  328.     using std::_write;
  329.     using std::write;
  330. #if !defined(__STDC__)
  331.     using std::mktemp;
  332.     using std::sopen;
  333. #endif
  334. #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) && !defined(__STDC__)
  335.     using std::_wfindfirsti64;
  336.     using std::_wfindnexti64;
  337.     using std::_findfirsti64;
  338.     using std::_findnexti64;
  339.     using std::_wfinddatai64_t;
  340.     using std::_finddatai64_t;
  341. #endif /* _INTEGRAL_MAX_BITS */
  342.     using std::__wfindfirst;
  343.     using std::__wfindnext;
  344.     using std::_findfirst;
  345.     using std::_findnext;
  346.     using std::_findclose;
  347.     using std::ftime;
  348.     using std::_wfinddata_t;
  349.     using std::_finddata_t;
  350. #endif /* __USING_CNAME__ */
  351.