home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / win3 / patches / symantec / rtlinc.exe / IO.H < prev    next >
C/C++ Source or Header  |  1993-09-28  |  3KB  |  136 lines

  1. /*_ io.h   Sat Aug 19 1989   Modified by: Walter Bright */
  2. /* Copyright (C) 1987-1990 by Walter Bright    */
  3. /* All Rights Reserved                */
  4. /* Written by Walter Bright            */
  5. /* $Revision:   1.3  $ */
  6.  
  7. /* Declarations for low level I/O functions    */
  8.  
  9. #ifndef __IO_H
  10. #define __IO_H    1
  11.  
  12. #if __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. #ifdef __STDC__
  17. #define __CDECL
  18. #define __STDCALL
  19. #else
  20. #define __CDECL __cdecl
  21. #define __STDCALL __stdcall
  22. #endif
  23.  
  24. #if __OS2__ && __INTSIZE == 4
  25. #define __CLIB    __STDCALL
  26. #else
  27. #define __CLIB    __CDECL
  28. #endif
  29.  
  30. int __CLIB read(int,void *,unsigned);
  31. int __CLIB write(int,const void *,unsigned);
  32. #define _read read
  33. #define _write write
  34.  
  35. #if __INTSIZE == 2
  36. int __CLIB _readx(int,void *,unsigned,unsigned);
  37. int __CLIB _writex(int,void *,unsigned,unsigned);
  38. #endif
  39.  
  40. #if M_UNIX || M_XENIX
  41. char __CLIB *ttyname(int filedes);
  42. int __CLIB rdchk(int filedes);
  43. int __CLIB fcntl(int filedes, int cmd, int arg);
  44. int __CDECL ioctl(int filedes, int cmd,...);
  45. int __CDECL umask(int mask);
  46. long __CDECL ulimit(int,long);
  47. #else
  48. int __CDECL dos_open(const char *,int,...);
  49. int __CDECL sopen(const char *, int, int, ...);
  50. int __CLIB setmode(int,int);
  51. #define _setmode setmode
  52. #define _sopen sopen
  53. #endif
  54.  
  55. struct ftime   
  56. {
  57.    unsigned ft_tsec  : 5;
  58.    unsigned ft_min   : 6;
  59.    unsigned ft_hour  : 5;
  60.    unsigned ft_day   : 5;
  61.    unsigned ft_month : 4;
  62.    unsigned ft_year  : 7;
  63. };
  64.  
  65. int __CLIB getftime(int FHdl, struct ftime *FtPtr);
  66. int __CLIB setftime(int handle, struct ftime *ptr);
  67. int __CLIB lock(int FHdl, long Offset, long Size);
  68. int __CLIB unlock(int handle, long offset, long length);
  69.  
  70.  
  71. int __CDECL creatnew(const char *, int);
  72. int __CDECL creattemp(char *, int);
  73. int __CDECL open(const char *,int,...);
  74. int __CLIB creat(const char *,int);
  75. int __CLIB close(int);
  76. int __CLIB locking(int, int, long);
  77. int __CLIB _commit(int);
  78. int __CLIB eof(int handle);
  79. #define _open open
  80. #define _close close
  81. #define _creat creat
  82. #define _locking locking
  83. #define _eof eof
  84.  
  85. int __CLIB unlink(const char *);
  86. #define _unlink unlink
  87.  
  88. int __CLIB remove(const char *);
  89. int __CLIB chsize(int, long);
  90. #define _chsize chsize
  91. #define tell( handle ) _lseek( handle, 0L, SEEK_CUR )
  92. #define _tell tell
  93.  
  94. int __CLIB chmod(const char *,int);
  95. #define _chmod chmod
  96.  
  97. int __CLIB dup(int);
  98. int __CLIB dup2(int, int);
  99. char * __CLIB mktemp(char *);
  100. #define _mktemp mktemp
  101. #define _dup dup
  102. #define _dup2 dup2
  103.  
  104. int __CLIB access(const char *,int);
  105. #define _access access
  106.  
  107. #define F_OK    0    /* does file exist?    */
  108. #define X_OK    1    /* execute permission?    */
  109. #define W_OK    2    /* write permission?    */
  110. #define R_OK    4    /* read permission?    */
  111.  
  112. long __CLIB lseek(int,long,int);
  113. #define _lseek lseek
  114. #define SEEK_SET    0    /* seek from start of file    */
  115. #define SEEK_CUR    1    /* relative to current position */
  116. #define SEEK_END    2    /* relative to end of file    */
  117.  
  118. long __CLIB filesize(const char *);
  119. long __CLIB filelength(int);
  120. int __CLIB isatty(int);
  121. #define _filelength filelength
  122. #define _isatty isatty
  123.  
  124. unsigned short __CLIB getDS(void);
  125.  
  126. #ifndef __STDC__
  127. #define getDS() ((unsigned short)__emit__(0x8C,0xD8))
  128. #endif
  129.  
  130. #if __cplusplus
  131. }
  132. #endif
  133.  
  134. #endif /* __IO_H */
  135.  
  136.