From: Perl 5 Porters Date: Sat, 7 Sep 1996 03:11:14 +0000 (+0000) Subject: perl 5.003_05: perlsdio.h X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c7ae39e52c720f8479971d43d75d9d3689d93064;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_05: perlsdio.h Don't supply redundant parameters for PerlIO_open and PerlIO_fdopen. Include PerlIO_reopen and PerlIO_getname. s/FILE_(CNT|PTR)_LVALUE/STDIO_(CNT|PTR)_LVALUE to fix a typo. This had prevented SV_FAST_FGETS from working anywhere. Include PerlIO_canset_cnt. I'm not sure how this is supposed to differ from STDIO_CNT_LVALUE. --- diff --git a/perlsdio.h b/perlsdio.h index 082d96d..ff32cdd 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -18,14 +18,16 @@ #define PerlIO_vprintf(f,fmt,a) vfprintf(f,fmt,a) #define PerlIO_read(f,buf,count) fread(buf,1,count,f) #define PerlIO_write(f,buf,count) fwrite1(buf,1,count,f) -#define PerlIO_open(path,mode) fopen(path,mode) -#define PerlIO_fdopen(fd,mode) fdopen(fd,mode) +#define PerlIO_open fopen +#define PerlIO_fdopen fdopen +#define PerlIO_reopen freopen #define PerlIO_close(f) fclose(f) #define PerlIO_puts(f,s) fputs(s,f) #define PerlIO_putc(f,c) fputc(c,f) #define PerlIO_ungetc(f,c) ungetc(c,f) #define PerlIO_getc(f) getc(f) #define PerlIO_eof(f) feof(f) +#define PerlIO_getname(f,b) fgetname(f,b) #define PerlIO_error(f) ferror(f) #define PerlIO_fileno(f) fileno(f) #define PerlIO_clearerr(f) clearerr(f) @@ -60,9 +62,9 @@ #define PerlIO_get_ptr(f) FILE_ptr(f) #define PerlIO_get_cnt(f) FILE_cnt(f) -#ifdef FILE_CNT_LVALUE +#ifdef STDIO_CNT_LVALUE #define PerlIO_canset_cnt(f) 1 -#ifdef FILE_PTR_LVALUE +#ifdef STDIO_PTR_LVALUE #define PerlIO_fast_gets(f) 1 #endif #define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) @@ -71,7 +73,7 @@ #define PerlIO_set_cnt(f,c) abort() #endif -#ifdef FILE_PTR_LVALUE +#ifdef STDIO_PTR_LVALUE #define PerlIO_set_ptrcnt(f,p,c) (FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)) #else #define PerlIO_set_ptrcnt(f,p,c) abort() @@ -80,6 +82,7 @@ #else /* USE_STDIO_PTR */ #define PerlIO_has_cntptr(f) 0 +#define PerlIO_canset_cnt(f) 0 #define PerlIO_get_cnt(f) (abort(),0) #define PerlIO_get_ptr(f) (abort(),0) #define PerlIO_set_cnt(f,c) abort()