home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 2.ddi / INCLUDE.ZIP / IO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-13  |  3.3 KB  |  106 lines

  1. /*  io.h
  2.  
  3.     Definitions for low level I/O functions.
  4.  
  5.         Copyright (c) Borland International 1987,1988,1990,1991
  6.     All Rights Reserved.
  7. */
  8.  
  9. #ifndef __IO_H
  10. #define __IO_H
  11.  
  12. #ifdef __DLL__
  13. #define _FAR far
  14. #else
  15. #define _FAR
  16. #endif
  17.  
  18. #if __STDC__
  19. #define _Cdecl
  20. #else
  21. #define _Cdecl  cdecl
  22. #endif
  23.  
  24. #ifndef __PAS__
  25. #define _CType _Cdecl
  26. #else
  27. #define _CType pascal
  28. #endif
  29.  
  30. #define HANDLE_MAX  20U
  31.  
  32. extern  unsigned int    _Cdecl _openfd[];
  33.  
  34. struct  ftime   {
  35.     unsigned    ft_tsec  : 5;   /* Two second interval */
  36.     unsigned    ft_min   : 6;   /* Minutes */
  37.     unsigned    ft_hour  : 5;   /* Hours */
  38.     unsigned    ft_day   : 5;   /* Days */
  39.     unsigned    ft_month : 4;   /* Months */
  40.     unsigned    ft_year  : 7;   /* Year */
  41. };
  42.  
  43. #define SEEK_CUR    1
  44. #define SEEK_END    2
  45. #define SEEK_SET    0
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. int  _Cdecl access   (const char _FAR *path, int amode);
  51. #ifdef __IN_CHMOD
  52. int  _Cdecl _chmod   ();
  53. #else
  54. int  _Cdecl _chmod   (const char _FAR *__pathname, int __func, ... );
  55. #endif
  56. int  _Cdecl chmod    (const char _FAR *__path, int __amode);
  57. int  _Cdecl chsize   (int __handle, long __size);
  58. int  _CType _close   (int __handle);
  59. int  _CType close    (int __handle);
  60. int  _CType _creat   (const char _FAR *__path, int __attribute);
  61. int  _CType creat    (const char _FAR *__path, int __amode);
  62. int  _Cdecl creatnew (const char _FAR *__path, int __mode); /* DOS 3.0 or later */
  63. int  _Cdecl creattemp(char _FAR *__path, int __amode); /* DOS 3.0 or later */
  64. int  _Cdecl dup      (int __handle);
  65. int  _Cdecl dup2     (int __oldhandle, int __newhandle);
  66. int  _Cdecl eof      (int __handle);
  67. long _Cdecl filelength   (int __handle);
  68. int  _Cdecl getftime     (int __handle, struct ftime _FAR *__ftimep);
  69. #ifdef __IN_IOCTL
  70. int  _Cdecl ioctl    ();
  71. #else
  72. int  _Cdecl ioctl    (int __handle, int __func, ...);
  73.         /* optional 3rd and 4th args are: void _FAR * __argdx, int argcx */
  74. #endif
  75.  
  76. int  _Cdecl isatty   (int __handle);
  77. int  _Cdecl lock     (int __handle, long __offset, long __length);
  78. long _CType lseek    (int __handle, long __offset, int __fromwhere);
  79. char _FAR * _Cdecl mktemp( char _FAR *__template );
  80. #ifdef __IN_OPEN
  81. int  _Cdecl open();
  82. #else
  83. int _Cdecl open(const char _FAR *__path, int __access,... /*unsigned mode*/);
  84. #endif
  85. int  _CType _open    (const char _FAR *__path, int __oflags);
  86. int  _CType read     (int __handle, void _FAR *__buf, unsigned __len);
  87. int  _CType _read    (int __handle, void _FAR *__buf, unsigned __len);
  88. int  _CType remove   (const char _FAR *__path);
  89. int  _Cdecl rename   (const char _FAR *__oldname,const char _FAR *__newname);
  90. int  _Cdecl setftime (int __handle, struct ftime _FAR *__ftimep);
  91. int  _Cdecl setmode  (int __handle, int __amode);
  92. long _Cdecl tell     (int __handle);
  93. unsigned _Cdecl umask    (unsigned __cmask);
  94. int  _CType unlink   (const char _FAR *__path);
  95. int  _Cdecl unlock   (int __handle, long __offset, long __length);
  96. int  _CType _write   (int __handle, void _FAR *__buf, unsigned __len);
  97. int  _CType write    (int __handle, void _FAR *__buf, unsigned __len);
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101.  
  102. /* macros for compatibility with earlier versions & other compilers. */
  103. #define sopen(path,access,shflag,mode)   open (path, (access)|(shflag), mode)
  104.  
  105. #endif  /* __IO_H */
  106.