Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
5.9 KiB

  1. /***
  2. *io.h - declarations for low-level file handling and I/O functions
  3. *
  4. * Copyright (c) 1985-1994, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains the function declarations for the low-level
  8. * file handling and I/O functions.
  9. *
  10. ****/
  11. #ifndef _INC_IO
  12. #define _INC_IO
  13. #ifndef _POSIX_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  18. #ifndef _CRTAPI1
  19. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  20. #define _CRTAPI1 __cdecl
  21. #else
  22. #define _CRTAPI1
  23. #endif
  24. #endif
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  28. #define _CRTAPI2 __cdecl
  29. #else
  30. #define _CRTAPI2
  31. #endif
  32. #endif
  33. /* Define _CRTIMP */
  34. #ifndef _CRTIMP
  35. #ifdef _NTSDK
  36. /* definition compatible with NT SDK */
  37. #define _CRTIMP
  38. #else /* ndef _NTSDK */
  39. /* current definition */
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _NTSDK */
  46. #endif /* _CRTIMP */
  47. /* Define __cdecl for non-Microsoft compilers */
  48. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  49. #define __cdecl
  50. #endif
  51. #ifndef _WCHAR_T_DEFINED
  52. typedef unsigned short wchar_t;
  53. #define _WCHAR_T_DEFINED
  54. #endif
  55. #ifndef _TIME_T_DEFINED
  56. typedef long time_t; /* time value */
  57. #define _TIME_T_DEFINED /* avoid multiple def's of time_t */
  58. #endif
  59. #ifndef _FSIZE_T_DEFINED
  60. typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */
  61. #define _FSIZE_T_DEFINED
  62. #endif
  63. #ifndef _FINDDATA_T_DEFINED
  64. struct _finddata_t {
  65. unsigned attrib;
  66. time_t time_create; /* -1 for FAT file systems */
  67. time_t time_access; /* -1 for FAT file systems */
  68. time_t time_write;
  69. _fsize_t size;
  70. char name[260];
  71. };
  72. #define _FINDDATA_T_DEFINED
  73. #endif
  74. #ifndef _WFINDDATA_T_DEFINED
  75. struct _wfinddata_t {
  76. unsigned attrib;
  77. time_t time_create; /* -1 for FAT file systems */
  78. time_t time_access; /* -1 for FAT file systems */
  79. time_t time_write;
  80. _fsize_t size;
  81. wchar_t name[260];
  82. };
  83. #define _WFINDDATA_T_DEFINED
  84. #endif
  85. /* File attribute constants for _findfirst() */
  86. #define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
  87. #define _A_RDONLY 0x01 /* Read only file */
  88. #define _A_HIDDEN 0x02 /* Hidden file */
  89. #define _A_SYSTEM 0x04 /* System file */
  90. #define _A_SUBDIR 0x10 /* Subdirectory */
  91. #define _A_ARCH 0x20 /* Archive file */
  92. /* function prototypes */
  93. _CRTIMP int __cdecl _access(const char *, int);
  94. _CRTIMP int __cdecl _chmod(const char *, int);
  95. _CRTIMP int __cdecl _chsize(int, long);
  96. _CRTIMP int __cdecl _close(int);
  97. _CRTIMP int __cdecl _commit(int);
  98. _CRTIMP int __cdecl _creat(const char *, int);
  99. _CRTIMP int __cdecl _dup(int);
  100. _CRTIMP int __cdecl _dup2(int, int);
  101. _CRTIMP int __cdecl _eof(int);
  102. _CRTIMP long __cdecl _filelength(int);
  103. _CRTIMP long __cdecl _findfirst(char *, struct _finddata_t *);
  104. _CRTIMP int __cdecl _findnext(long, struct _finddata_t *);
  105. _CRTIMP int __cdecl _findclose(long);
  106. _CRTIMP int __cdecl _isatty(int);
  107. _CRTIMP int __cdecl _locking(int, int, long);
  108. _CRTIMP long __cdecl _lseek(int, long, int);
  109. _CRTIMP char * __cdecl _mktemp(char *);
  110. _CRTIMP int __cdecl _open(const char *, int, ...);
  111. _CRTIMP int __cdecl _pipe(int *, unsigned int, int);
  112. _CRTIMP int __cdecl _read(int, void *, unsigned int);
  113. _CRTIMP int __cdecl remove(const char *);
  114. _CRTIMP int __cdecl rename(const char *, const char *);
  115. _CRTIMP int __cdecl _setmode(int, int);
  116. _CRTIMP int __cdecl _sopen(const char *, int, int, ...);
  117. _CRTIMP long __cdecl _tell(int);
  118. _CRTIMP int __cdecl _umask(int);
  119. _CRTIMP int __cdecl _unlink(const char *);
  120. _CRTIMP int __cdecl _write(int, const void *, unsigned int);
  121. #ifndef _WIO_DEFINED
  122. /* wide function prototypes, also declared in wchar.h */
  123. _CRTIMP int __cdecl _waccess(const wchar_t *, int);
  124. _CRTIMP int __cdecl _wchmod(const wchar_t *, int);
  125. _CRTIMP int __cdecl _wcreat(const wchar_t *, int);
  126. _CRTIMP long __cdecl _wfindfirst(wchar_t *, struct _wfinddata_t *);
  127. _CRTIMP int __cdecl _wfindnext(long, struct _wfinddata_t *);
  128. _CRTIMP int __cdecl _wunlink(const wchar_t *);
  129. _CRTIMP int __cdecl _wrename(const wchar_t *, const wchar_t *);
  130. _CRTIMP int __cdecl _wopen(const wchar_t *, int, ...);
  131. _CRTIMP int __cdecl _wsopen(const wchar_t *, int, int, ...);
  132. _CRTIMP wchar_t * __cdecl _wmktemp(wchar_t *);
  133. #define _WIO_DEFINED
  134. #endif
  135. _CRTIMP long __cdecl _get_osfhandle(int);
  136. _CRTIMP int __cdecl _open_osfhandle(long, int);
  137. #if !__STDC__
  138. /* Non-ANSI names for compatibility */
  139. #ifdef _NTSDK
  140. #ifndef __cplusplus
  141. #define access _access
  142. #define chmod _chmod
  143. #define chsize _chsize
  144. #define close _close
  145. #define creat _creat
  146. #define dup _dup
  147. #define dup2 _dup2
  148. #define eof _eof
  149. #define filelength _filelength
  150. #define isatty _isatty
  151. #define locking _locking
  152. #define lseek _lseek
  153. #define mktemp _mktemp
  154. #define open _open
  155. #define read _read
  156. #define setmode _setmode
  157. #define sopen _sopen
  158. #define tell _tell
  159. #define umask _umask
  160. #define unlink _unlink
  161. #define write _write
  162. #endif /* __cplusplus */
  163. #else /* ndef _NTSDK */
  164. _CRTIMP int __cdecl access(const char *, int);
  165. _CRTIMP int __cdecl chmod(const char *, int);
  166. _CRTIMP int __cdecl chsize(int, long);
  167. _CRTIMP int __cdecl close(int);
  168. _CRTIMP int __cdecl creat(const char *, int);
  169. _CRTIMP int __cdecl dup(int);
  170. _CRTIMP int __cdecl dup2(int, int);
  171. _CRTIMP int __cdecl eof(int);
  172. _CRTIMP long __cdecl filelength(int);
  173. _CRTIMP int __cdecl isatty(int);
  174. _CRTIMP int __cdecl locking(int, int, long);
  175. _CRTIMP long __cdecl lseek(int, long, int);
  176. _CRTIMP char * __cdecl mktemp(char *);
  177. _CRTIMP int __cdecl open(const char *, int, ...);
  178. _CRTIMP int __cdecl read(int, void *, unsigned int);
  179. _CRTIMP int __cdecl setmode(int, int);
  180. _CRTIMP int __cdecl sopen(const char *, int, int, ...);
  181. _CRTIMP long __cdecl tell(int);
  182. _CRTIMP int __cdecl umask(int);
  183. _CRTIMP int __cdecl unlink(const char *);
  184. _CRTIMP int __cdecl write(int, const void *, unsigned int);
  185. #endif /* _NTSDK */
  186. #endif /* __STDC__ */
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190. #endif /* _POSIX_ */
  191. #endif /* _INC_IO */