X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlsfio.h;h=a736371a32a38e5efd6abf4222d3a0831feeae10;hb=a6c71b5b9462db13c7bb2cd263cee5995315784c;hp=8c9387fbd0c9cdda30808732ad2ba51866c94b10;hpb=760ac839baf413929cd31cc32ffd6dba6b781a81;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlsfio.h b/perlsfio.h index 8c9387f..a736371 100644 --- a/perlsfio.h +++ b/perlsfio.h @@ -3,6 +3,11 @@ #include #endif +/* sfio 2000 changed _stdopen to _stdfdopen */ +#if SFIO_VERSION >= 20000101L +#define _stdopen _stdfdopen +#endif + extern Sfio_t* _stdopen _ARG_((int, const char*)); extern int _stdprintf _ARG_((const char*, ...)); @@ -18,6 +23,7 @@ extern int _stdprintf _ARG_((const char*, ...)); #define PerlIO_write(f,buf,count) sfwrite(f,buf,count) #define PerlIO_open(path,mode) sfopen(NULL,path,mode) #define PerlIO_fdopen(fd,mode) _stdopen(fd,mode) +#define PerlIO_reopen(path,mode,f) sfopen(f,path,mode) #define PerlIO_close(f) sfclose(f) #define PerlIO_puts(f,s) sfputr(f,s,-1) #define PerlIO_putc(f,c) sfputc(f,c) @@ -34,10 +40,10 @@ extern int _stdprintf _ARG_((const char*, ...)); #define PerlIO_rewind(f) (void) sfseek((f),0L,0) #define PerlIO_tmpfile() sftmp(0) -#define PerlIO_importFILE(f,fl) croak("Import from FILE * unimplemeted") -#define PerlIO_exportFILE(f,fl) croak("Export to FILE * unimplemeted") +#define PerlIO_importFILE(f,fl) Perl_croak(aTHX_ "Import from FILE * unimplemeted") +#define PerlIO_exportFILE(f,fl) Perl_croak(aTHX_ "Export to FILE * unimplemeted") #define PerlIO_findFILE(f) NULL -#define PerlIO_releaseFILE(p,f) croak("Release of FILE * unimplemeted") +#define PerlIO_releaseFILE(p,f) Perl_croak(aTHX_ "Release of FILE * unimplemeted") #define PerlIO_setlinebuf(f) sfset(f,SF_LINE,1) @@ -46,10 +52,10 @@ extern int _stdprintf _ARG_((const char*, ...)); #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) 1 -#define PerlIO_fast_gets(f) 1 -#define PerlIO_set_ptrcnt(f,p,c) ((f)->next = (p)) -#define PerlIO_set_cnt(f,c) 1 +#define PerlIO_canset_cnt(f) 0 +#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_has_base(f) 1 #define PerlIO_get_base(f) ((f)->data)