:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / include / msvcrt / internal / file.h
1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
2
3 #ifndef __dj_include_libc_file_h__
4 #define __dj_include_libc_file_h__
5
6 #include <msvcrt/stdio.h>
7 #include <msvcrt/fcntl.h>
8
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 #ifndef __dj_ENFORCE_ANSI_FREESTANDING
15
16 #ifndef __STRICT_ANSI__
17
18 #ifndef _POSIX_SOURCE
19
20 #ifndef _IORMONCL
21 #define _IORMONCL 004000  /* remove on close, for temp files */
22 #endif
23 /* if _flag & _IORMONCL, ._name_to_remove needs freeing */
24
25 #ifndef _IOUNGETC
26 #define _IOUNGETC 010000  /* there is an ungetc'ed character in the buffer */
27 #endif
28
29
30 // might need check for IO_APPEND aswell
31 #define OPEN4WRITING(f) ((((f)->_flag & _IOWRT) == _IOWRT ) )
32
33 #define OPEN4READING(f) ((((f)->_flag & _IOREAD) == _IOREAD ) )
34
35 // might need check for IO_APPEND aswell
36 #define WRITE_STREAM(f) ((((f)->_flag & _IOWRT) == _IOWRT ) )
37
38 #define READ_STREAM(f) ((((f)->_flag & _IOREAD) == _IOREAD ) )
39
40
41 char __validfp (FILE *f);
42
43 int __set_errno(int err);
44 int __set_doserrno (int error);
45
46 void *filehnd(int fn);
47
48 char __is_text_file(FILE *p);
49
50 int __fileno_alloc(void *hFile, int mode);
51
52 int _doprnt(const char *fmt, va_list args, FILE *f);
53 int _doscan(FILE *iop, const char *fmt, va_list argp);
54
55
56 int __fileno_dup2( int handle1, int handle2 );
57 int __fileno_getmode(int _fd);
58 int __fileno_setmode(int _fd, int _newmode);
59 int __fileno_close(int _fd);
60
61 void sigabort_handler(int sig);
62
63 #include <windows.h>
64
65 void UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, DWORD remainder );
66 time_t FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder );
67
68
69 #endif /* !_POSIX_SOURCE */
70 #endif /* !__STRICT_ANSI__ */
71 #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
72
73 #ifndef __dj_ENFORCE_FUNCTION_CALLS
74 #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
75
76
77 #define __FILE_REC_MAX 20
78 typedef struct __file_rec 
79 {
80    struct __file_rec *next;
81    int count;
82    FILE *files[__FILE_REC_MAX];
83 } __file_rec;
84
85 extern __file_rec *__file_rec_list;
86
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92
93 #endif /* __dj_include_libc_file_h__ */
94
95
96