home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / IO.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  5KB  |  157 lines

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