X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perliol.h;h=04c7071fa4d9d1bedd9a590a24f6cc22fdaaa7f2;hb=ce08f86c8b1d404b3d9fec75a102b8cd65f8766a;hp=58fad634d646521aaa9cf2bb87483c76d95938f0;hpb=76ced9add7b621dfc9d4ecb534aeea8e131a418a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perliol.h b/perliol.h index 58fad63..04c7071 100644 --- a/perliol.h +++ b/perliol.h @@ -10,7 +10,7 @@ struct _PerlIO_funcs PerlIO * (*Fdopen)(PerlIO_funcs *tab, int fd, const char *mode); PerlIO * (*Open)(PerlIO_funcs *tab, const char *path, const char *mode); int (*Reopen)(const char *path, const char *mode, PerlIO *f); - IV (*Pushed)(PerlIO *f,const char *mode); + IV (*Pushed)(PerlIO *f,const char *mode,const char *arg,STRLEN len); IV (*Popped)(PerlIO *f); /* Unix-like functions - cf sfio line disciplines */ SSize_t (*Read)(PerlIO *f, void *vbuf, Size_t count); @@ -34,6 +34,14 @@ struct _PerlIO_funcs void (*Set_ptrcnt)(PerlIO *f,STDCHAR *ptr,SSize_t cnt); }; +/*--------------------------------------------------------------------------------------*/ +/* Kind values */ +#define PERLIO_K_RAW 0x00000001 +#define PERLIO_K_BUFFERED 0x00000002 +#define PERLIO_K_CANCRLF 0x00000004 +#define PERLIO_K_FASTGETS 0x00000008 + +/*--------------------------------------------------------------------------------------*/ struct _PerlIO { PerlIOl * next; /* Lower layer */ @@ -44,19 +52,21 @@ struct _PerlIO /*--------------------------------------------------------------------------------------*/ /* Flag values */ -#define PERLIO_F_EOF 0x00010000 -#define PERLIO_F_CANWRITE 0x00020000 -#define PERLIO_F_CANREAD 0x00040000 -#define PERLIO_F_ERROR 0x00080000 -#define PERLIO_F_TRUNCATE 0x00100000 -#define PERLIO_F_APPEND 0x00200000 -#define PERLIO_F_BINARY 0x00400000 -#define PERLIO_F_UTF8 0x00800000 -#define PERLIO_F_LINEBUF 0x01000000 -#define PERLIO_F_WRBUF 0x02000000 -#define PERLIO_F_RDBUF 0x04000000 -#define PERLIO_F_TEMP 0x08000000 -#define PERLIO_F_OPEN 0x10000000 +#define PERLIO_F_EOF 0x00000100 +#define PERLIO_F_CANWRITE 0x00000200 +#define PERLIO_F_CANREAD 0x00000400 +#define PERLIO_F_ERROR 0x00000800 +#define PERLIO_F_TRUNCATE 0x00001000 +#define PERLIO_F_APPEND 0x00002000 +#define PERLIO_F_CRLF 0x00004000 +#define PERLIO_F_UTF8 0x00008000 +#define PERLIO_F_UNBUF 0x00010000 +#define PERLIO_F_WRBUF 0x00020000 +#define PERLIO_F_RDBUF 0x00040000 +#define PERLIO_F_LINEBUF 0x00080000 +#define PERLIO_F_TEMP 0x00100000 +#define PERLIO_F_OPEN 0x00200000 +#define PERLIO_F_FASTGETS 0x00400000 #define PerlIOBase(f) (*(f)) #define PerlIOSelf(f,type) ((type *)PerlIOBase(f)) @@ -67,17 +77,26 @@ struct _PerlIO extern PerlIO_funcs PerlIO_unix; extern PerlIO_funcs PerlIO_perlio; extern PerlIO_funcs PerlIO_stdio; +extern PerlIO_funcs PerlIO_crlf; +/* The EXT is need for Cygwin -- but why only for _pending? --jhi */ +EXT PerlIO_funcs PerlIO_pending; #ifdef HAS_MMAP extern PerlIO_funcs PerlIO_mmap; #endif -extern PerlIO *PerlIO_allocate(void); +extern PerlIO *PerlIO_allocate(pTHX); + +#if O_BINARY != O_TEXT +#define PERLIO_STDTEXT "t" +#else +#define PERLIO_STDTEXT "" +#endif /*--------------------------------------------------------------------------------------*/ /* Generic, or stub layer functions */ extern IV PerlIOBase_fileno (PerlIO *f); -extern IV PerlIOBase_pushed (PerlIO *f, const char *mode); +extern IV PerlIOBase_pushed (PerlIO *f, const char *mode,const char *arg,STRLEN len); extern IV PerlIOBase_popped (PerlIO *f); extern SSize_t PerlIOBase_unread (PerlIO *f, const void *vbuf, Size_t count); extern IV PerlIOBase_eof (PerlIO *f);