This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Various attempts at MSVC debug - not sure what has
[perl5.git] / fakesdio.h
CommitLineData
76ced9ad
NIS
1/*
2 * This is "source level" stdio compatibility mode.
3 * We try and #define stdio functions in terms of PerlIO.
4 */
5#define _CANNOT "CANNOT"
6#undef FILE
7#define FILE PerlIO
cf677677 8#undef clearerr
76ced9ad 9#undef fclose
cf677677
JH
10#undef fdopen
11#undef feof
12#undef ferror
13#undef fflush
76ced9ad 14#undef fgetc
cf677677
JH
15#undef fgetpos
16#undef fgets
17#undef fileno
400e04b6 18#undef flockfile
cf677677
JH
19#undef fopen
20#undef fprintf
76ced9ad 21#undef fputc
76ced9ad 22#undef fputs
76ced9ad 23#undef fread
cf677677
JH
24#undef freopen
25#undef fscanf
76ced9ad
NIS
26#undef fseek
27#undef fsetpos
28#undef ftell
400e04b6
JH
29#undef ftrylockfile
30#undef funlockfile
cf677677
JH
31#undef fwrite
32#undef getc
33#undef getc_unlocked
76ced9ad 34#undef getw
cf677677
JH
35#undef pclose
36#undef popen
37#undef putc
38#undef putc_unlocked
76ced9ad 39#undef putw
cf677677 40#undef rewind
76ced9ad
NIS
41#undef setbuf
42#undef setvbuf
cf677677 43#undef stderr
76ced9ad
NIS
44#undef stdin
45#undef stdout
cf677677
JH
46#undef tmpfile
47#undef ungetc
48#undef vfprintf
76ced9ad
NIS
49#define fprintf PerlIO_printf
50#define stdin PerlIO_stdin()
51#define stdout PerlIO_stdout()
52#define stderr PerlIO_stderr()
53#define tmpfile() PerlIO_tmpfile()
54#define fclose(f) PerlIO_close(f)
55#define fflush(f) PerlIO_flush(f)
56#define fopen(p,m) PerlIO_open(p,m)
57#define vfprintf(f,fmt,a) PerlIO_vprintf(f,fmt,a)
58#define fgetc(f) PerlIO_getc(f)
59#define fputc(c,f) PerlIO_putc(f,c)
60#define fputs(s,f) PerlIO_puts(f,s)
61#define getc(f) PerlIO_getc(f)
76ced9ad
NIS
62#define getc_unlocked(f) PerlIO_getc(f)
63#define putc(c,f) PerlIO_putc(f,c)
76ced9ad
NIS
64#define putc_unlocked(c,f) PerlIO_putc(c,f)
65#define ungetc(c,f) PerlIO_ungetc(f,c)
66#if 0
67/* return values of read/write need work */
68#define fread(b,s,c,f) PerlIO_read(f,b,(s*c))
69#define fwrite(b,s,c,f) PerlIO_write(f,b,(s*c))
70#else
71#define fread(b,s,c,f) _CANNOT fread
72#define fwrite(b,s,c,f) _CANNOT fwrite
73#endif
74#define fgetpos(f,p) PerlIO_getpos(f,p)
75#define fseek(f,o,w) PerlIO_seek(f,o,w)
76#define fsetpos(f,p) PerlIO_setpos(f,p)
77#define ftell(f) PerlIO_tell(f)
78#define rewind(f) PerlIO_rewind(f)
79#define clearerr(f) PerlIO_clearerr(f)
80#define feof(f) PerlIO_eof(f)
81#define ferror(f) PerlIO_error(f)
82#define fdopen(fd,p) PerlIO_fdopen(fd,p)
83#define fileno(f) PerlIO_fileno(f)
84#define popen(c,m) my_popen(c,m)
85#define pclose(f) my_pclose(f)
86
87#define __filbuf(f) _CANNOT __filbuf_
88#define _filbuf(f) _CANNOT _filbuf_
89#define __flsbuf(c,f) _CANNOT __flsbuf_
90#define _flsbuf(c,f) _CANNOT _flsbuf_
91#define getw(f) _CANNOT _getw_
92#define putw(v,f) _CANNOT _putw_
93#if SFIO_VERSION < 20000101L
94#define flockfile(f) _CANNOT _flockfile_
95#define ftrylockfile(f) _CANNOT _ftrylockfile_
96#define funlockfile(f) _CANNOT _funlockfile_
97#endif
98#define freopen(p,m,f) _CANNOT _freopen_
99#define setbuf(f,b) _CANNOT _setbuf_
100#define setvbuf(f,b,x,s) _CANNOT _setvbuf_
101#define fscanf _CANNOT _fscanf_
102#define fgets(s,n,f) _CANNOT _fgets_
103