home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / INC.PAK / IO.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  6KB  |  171 lines

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