Confusion over uselargefiles.cbu and uselfs.cbu (the first one
[p5sagit/p5-mst-13.2.git] / perlsfio.h
CommitLineData
760ac839 1/* The next #ifdef should be redundant if Configure behaves ... */
2#ifdef I_SFIO
3#include <sfio.h>
4#endif
5
6extern Sfio_t* _stdopen _ARG_((int, const char*));
7extern int _stdprintf _ARG_((const char*, ...));
8
9#define PerlIO Sfio_t
10#define PerlIO_stderr() sfstderr
11#define PerlIO_stdout() sfstdout
12#define PerlIO_stdin() sfstdin
13
14#define PerlIO_printf sfprintf
15#define PerlIO_stdoutf _stdprintf
16#define PerlIO_vprintf(f,fmt,a) sfvprintf(f,fmt,a)
17#define PerlIO_read(f,buf,count) sfread(f,buf,count)
18#define PerlIO_write(f,buf,count) sfwrite(f,buf,count)
19#define PerlIO_open(path,mode) sfopen(NULL,path,mode)
20#define PerlIO_fdopen(fd,mode) _stdopen(fd,mode)
644a2880 21#define PerlIO_reopen(path,mode,f) sfopen(f,path,mode)
760ac839 22#define PerlIO_close(f) sfclose(f)
23#define PerlIO_puts(f,s) sfputr(f,s,-1)
24#define PerlIO_putc(f,c) sfputc(f,c)
25#define PerlIO_ungetc(f,c) sfungetc(f,c)
26#define PerlIO_sprintf sfsprintf
27#define PerlIO_getc(f) sfgetc(f)
28#define PerlIO_eof(f) sfeof(f)
29#define PerlIO_error(f) sferror(f)
30#define PerlIO_fileno(f) sffileno(f)
31#define PerlIO_clearerr(f) sfclrerr(f)
32#define PerlIO_flush(f) sfsync(f)
33#define PerlIO_tell(f) sftell(f)
34#define PerlIO_seek(f,o,w) sfseek(f,o,w)
35#define PerlIO_rewind(f) (void) sfseek((f),0L,0)
36#define PerlIO_tmpfile() sftmp(0)
37
cea2e8a9 38#define PerlIO_importFILE(f,fl) Perl_croak(aTHX_ "Import from FILE * unimplemeted")
39#define PerlIO_exportFILE(f,fl) Perl_croak(aTHX_ "Export to FILE * unimplemeted")
760ac839 40#define PerlIO_findFILE(f) NULL
cea2e8a9 41#define PerlIO_releaseFILE(p,f) Perl_croak(aTHX_ "Release of FILE * unimplemeted")
760ac839 42
43#define PerlIO_setlinebuf(f) sfset(f,SF_LINE,1)
44
45/* Now our interface to equivalent of Configure's FILE_xxx macros */
46
47#define PerlIO_has_cntptr(f) 1
a20bf0c3 48#define PerlIO_get_ptr(f) ((f)->next)
49#define PerlIO_get_cnt(f) ((f)->endr - (f)->next)
760ac839 50#define PerlIO_canset_cnt(f) 1
51#define PerlIO_fast_gets(f) 1
a20bf0c3 52#define PerlIO_set_ptrcnt(f,p,c) ((f)->next = (p))
53#define PerlIO_set_cnt(f,c) 1
760ac839 54
55#define PerlIO_has_base(f) 1
a20bf0c3 56#define PerlIO_get_base(f) ((f)->data)
57#define PerlIO_get_bufsiz(f) ((f)->endr - (f)->data)
760ac839 58
59