diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-11-14 17:43:04 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-11-14 17:43:04 +0000 |
commit | 76ced9add7b621dfc9d4ecb534aeea8e131a418a (patch) | |
tree | 19a54bbf8edca4550ca6cb5172fae0e065affaa5 /perlsfio.h | |
parent | a10525673ecdf376a72ebd9267ef94c761ff1705 (diff) | |
download | perl-76ced9add7b621dfc9d4ecb534aeea8e131a418a.tar.gz |
PerlIO #include and #ifdef re-work.
p4raw-id: //depot/perlio@7684
Diffstat (limited to 'perlsfio.h')
-rw-r--r-- | perlsfio.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/perlsfio.h b/perlsfio.h index 22f5427f8c..de7e9acc1f 100644 --- a/perlsfio.h +++ b/perlsfio.h @@ -5,7 +5,7 @@ /* sfio 2000 changed _stdopen to _stdfdopen */ #if SFIO_VERSION >= 20000101L -#define _stdopen _stdfdopen +#define _stdopen _stdfdopen #endif extern Sfio_t* _stdopen _ARG_((int, const char*)); @@ -16,9 +16,11 @@ extern int _stdprintf _ARG_((const char*, ...)); #define PerlIO_stdout() sfstdout #define PerlIO_stdin() sfstdin +#define PerlIO_isutf8(f) 0 + #define PerlIO_printf sfprintf #define PerlIO_stdoutf _stdprintf -#define PerlIO_vprintf(f,fmt,a) sfvprintf(f,fmt,a) +#define PerlIO_vprintf(f,fmt,a) sfvprintf(f,fmt,a) #define PerlIO_read(f,buf,count) sfread(f,buf,count) #define PerlIO_write(f,buf,count) sfwrite(f,buf,count) #define PerlIO_open(path,mode) sfopen(NULL,path,mode) @@ -35,7 +37,12 @@ extern int _stdprintf _ARG_((const char*, ...)); #define PerlIO_fileno(f) sffileno(f) #define PerlIO_clearerr(f) sfclrerr(f) #define PerlIO_flush(f) sfsync(f) -#define PerlIO_tell(f) sfseek(f,0,1|SF_SHARE) +#if 0 +/* This breaks tests */ +#define PerlIO_tell(f) sfseek(f,0,1|SF_SHARE) +#else +#define PerlIO_tell(f) sftell(f) +#endif #define PerlIO_seek(f,o,w) sfseek(f,o,w) #define PerlIO_rewind(f) (void) sfseek((f),0L,0) #define PerlIO_tmpfile() sftmp(0) @@ -49,15 +56,15 @@ extern int _stdprintf _ARG_((const char*, ...)); /* Now our interface to equivalent of Configure's FILE_xxx macros */ -#define PerlIO_has_cntptr(f) 1 +#define PerlIO_has_cntptr(f) 1 #define PerlIO_get_ptr(f) ((f)->next) #define PerlIO_get_cnt(f) ((f)->endr - (f)->next) -#define PerlIO_canset_cnt(f) 0 +#define PerlIO_canset_cnt(f) 1 #define PerlIO_fast_gets(f) 1 -#define PerlIO_set_ptrcnt(f,p,c) STMT_START {(f)->next = (unsigned char *)(p); assert(FILE_cnt(f) == (c))} STMT_END -#define PerlIO_set_cnt(f,c) Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system"); +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {(f)->next = (unsigned char *)(p); assert(PerlIO_get_cnt(f) == (c));} STMT_END +#define PerlIO_set_cnt(f,c) STMT_START {(f)->next = (f)->endr - (c);} STMT_END -#define PerlIO_has_base(f) 1 +#define PerlIO_has_base(f) 1 #define PerlIO_get_base(f) ((f)->data) #define PerlIO_get_bufsiz(f) ((f)->endr - (f)->data) |