summaryrefslogtreecommitdiff
path: root/win32/win32io.h
blob: 0e849cf783b4bd1c4b084ecb1829b62cd702006c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef WIN32IO_H
#define WIN32IO_H

#ifdef __BORLANDC__
#include <stdarg.h>
#define MSconst
#else
#define MSconst const
#endif

typedef struct {
int	signature_begin;
int *	(*pfnerrno)(void);
char ***(*pfnenviron)(void);
FILE*	(*pfnstdin)(void);
FILE*	(*pfnstdout)(void);
FILE*	(*pfnstderr)(void);
int	(*pfnferror)(FILE *fp);
int	(*pfnfeof)(FILE *fp);
char*	(*pfnstrerror)(int e);
int	(*pfnvfprintf)(FILE *pf, const char *format, va_list arg);
int	(*pfnvprintf)(const char *format, va_list arg);
size_t	(*pfnfread)(void *buf, size_t size, size_t count, FILE *pf);
size_t	(*pfnfwrite)(const void *buf, size_t size, size_t count, FILE *pf);
FILE*	(*pfnfopen)(const char *path, const char *mode);
FILE*	(*pfnfdopen)(int fh,  MSconst char *mode); 
FILE*	(*pfnfreopen)(const char *path, const char *mode, FILE *pf);
int	(*pfnfclose)(FILE *pf);
int	(*pfnfputs)(const char *s,FILE *pf);
int	(*pfnfputc)(int c,FILE *pf);
int	(*pfnungetc)(int c,FILE *pf);
int	(*pfngetc)(FILE *pf);
int	(*pfnfileno)(FILE *pf);
void	(*pfnclearerr)(FILE *pf);
int	(*pfnfflush)(FILE *pf);
long	(*pfnftell)(FILE *pf);
int	(*pfnfseek)(FILE *pf,long offset,int origin);
int	(*pfnfgetpos)(FILE *pf,fpos_t *p);
int	(*pfnfsetpos)(FILE *pf,const fpos_t *p);
void	(*pfnrewind)(FILE *pf);
FILE*	(*pfntmpfile)(void);
void	(*pfnabort)(void);
int  	(*pfnfstat)(int fd,struct stat *bufptr);
int  	(*pfnstat)(const char *name,struct stat *bufptr);
int	(*pfnpipe)( int *phandles, unsigned int psize, int textmode );
FILE*	(*pfnpopen)( const char *command, const char *mode );
int	(*pfnpclose)( FILE *pf);
int	(*pfnsetmode)( int fd, int mode);
long	(*pfnlseek)( int fd, long offset, int origin);
long	(*pfntell)( int fd);
int	(*pfndup)( int fd);
int	(*pfndup2)(int h1, int h2);
int	(*pfnopen)(const char *path, int oflag,...);
int	(*pfnclose)(int fd);
int	(*pfneof)(int fd);
int	(*pfnread)(int fd, void *buf, unsigned int cnt);
int	(*pfnwrite)(int fd, const void *buf, unsigned int cnt);
int	(*pfnopenmode)(int mode);
int	(*pfn_open_osfhandle)(long handle, int flags);
long	(*pfn_get_osfhandle)(int fd);
int	(*pfnspawnvp)(int mode, const char *cmdname, MSconst char * const *argv);
int	(*pfnmkdir)(const char *path);
int	(*pfnrmdir)(const char *path);
int	(*pfnchdir)(const char *path);
int	(*pfnflock)(int fd, int oper);
int	(*pfnexecvp)(const char *cmdname, MSconst char *const *argv);
void	(*pfnperror)(const char *str);
void	(*pfnsetbuf)(FILE *pf, char *buf);
int	(*pfnsetvbuf)(FILE *pf, char *buf, int type, size_t size);
int	(*pfnflushall)(void);
int	(*pfnfcloseall)(void);
char*	(*pfnfgets)(char *s, int n, FILE *pf);
char*	(*pfngets)(char *s);
int	(*pfnfgetc)(FILE *pf);
int	(*pfnputc)(int c, FILE *pf);
int	(*pfnputs)(const char *s);
int	(*pfngetchar)(void);
int	(*pfnputchar)(int c);
int	(*pfnfscanf)(FILE *pf, const char *format, ...);
int	(*pfnscanf)(const char *format, ...);
void*	(*pfnmalloc)(size_t size);
void*	(*pfncalloc)(size_t numitems, size_t size);
void*	(*pfnrealloc)(void *block, size_t size);
void	(*pfnfree)(void *block);
int	signature_end;
} WIN32_IOSUBSYSTEM; 

typedef WIN32_IOSUBSYSTEM	*PWIN32_IOSUBSYSTEM;

#endif /* WIN32IO_H */