X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlio.h;h=adea6b74fe3046f282bd61d31d6eb35767916b83;hb=edf815fd8adfc467da9836baf8369da56521c606;hp=4b7ec88752b2c9f6751a65ae360c39cbf382f017;hpb=14a5cf38cb6bde23aa6e81a63d9807561599a360;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlio.h b/perlio.h index 4b7ec88..adea6b7 100644 --- a/perlio.h +++ b/perlio.h @@ -1,8 +1,18 @@ +/* perlio.h + * + * Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, + * by Larry Wall and others + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ + #ifndef _PERLIO_H #define _PERLIO_H /* Interface for perl to IO functions. - There is a hierachy of Configure determined #define controls: + There is a hierarchy of Configure determined #define controls: USE_STDIO - forces PerlIO_xxx() to be #define-d onto stdio functions. This is used for x2p subdirectory and for conservative builds - "just like perl5.00X used to be". @@ -31,7 +41,7 @@ #if defined(PERL_IMPLICIT_SYS) #ifndef USE_PERLIO #ifndef NETWARE -# define USE_PERLIO +/* # define USE_PERLIO */ #endif #endif #endif @@ -54,6 +64,11 @@ */ #include +#ifdef __BEOS__ +int fseeko(FILE *stream, off_t offset, int whence); +off_t ftello(FILE *stream); +#endif + #if defined(USE_64_BIT_STDIO) && defined(HAS_FTELLO) && !defined(USE_FTELL64) #define ftell ftello #endif @@ -93,6 +108,8 @@ extern PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name, STRLEN len, extern PerlIO *PerlIO_push(pTHX_ PerlIO *f, PerlIO_funcs *tab, const char *mode, SV *arg); extern void PerlIO_pop(pTHX_ PerlIO *f); +extern AV* PerlIO_get_layers(pTHX_ PerlIO *f); +extern void PerlIO_clone(pTHX_ PerlInterpreter *proto, CLONE_PARAMS *param); #endif /* PerlIO */ @@ -143,7 +160,7 @@ extern void PerlIO_pop(pTHX_ PerlIO *f); #endif /* ifndef PERLIO_NOT_STDIO */ #endif /* PERLIO_IS_STDIO */ -#define specialCopIO(sv) ((sv) != Nullsv) +#define specialCopIO(sv) ((sv) == Nullsv) /* ----------- fill in things that have not got #define'd ---------- */ @@ -172,9 +189,19 @@ extern void PerlIO_pop(pTHX_ PerlIO *f); #define SEEK_END 2 #endif +#define PERLIO_DUP_CLONE 1 +#define PERLIO_DUP_FD 2 + /* --------------------- Now prototypes for functions --------------- */ START_EXTERN_C +#ifndef __attribute__format__ +#ifdef CHECK_FORMAT +#define __attribute__format__(x,y,z) __attribute__((__format__(x,y,z))) +#else +#define __attribute__format__(x,y,z) +#endif +#endif #ifndef NEXT30_NO_ATTRIBUTE #ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */ #ifdef __attribute__ /* Avoid possible redefinition errors */ @@ -184,11 +211,11 @@ START_EXTERN_C #endif #endif #ifndef PerlIO_init -extern void PerlIO_init(void); +extern void PerlIO_init(pTHX); #endif #ifndef PerlIO_stdoutf extern int PerlIO_stdoutf(const char *, ...) - __attribute__ ((__format__(__printf__, 1, 2))); + __attribute__format__(__printf__, 1, 2); #endif #ifndef PerlIO_puts extern int PerlIO_puts(PerlIO *, const char *); @@ -201,9 +228,6 @@ extern PerlIO *PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd, int imode, int perm, PerlIO *old, int narg, SV **arg); #endif -#ifndef PerlIO_close -extern int PerlIO_close(PerlIO *); -#endif #ifndef PerlIO_eof extern int PerlIO_eof(PerlIO *); #endif @@ -219,23 +243,17 @@ extern int PerlIO_getc(PerlIO *); #ifndef PerlIO_putc extern int PerlIO_putc(PerlIO *, int); #endif -#ifndef PerlIO_flush -extern int PerlIO_flush(PerlIO *); -#endif #ifndef PerlIO_ungetc extern int PerlIO_ungetc(PerlIO *, int); #endif -#ifndef PerlIO_fileno -extern int PerlIO_fileno(PerlIO *); -#endif #ifndef PerlIO_fdopen extern PerlIO *PerlIO_fdopen(int, const char *); #endif #ifndef PerlIO_importFILE -extern PerlIO *PerlIO_importFILE(FILE *, int); +extern PerlIO *PerlIO_importFILE(FILE *, const char *); #endif #ifndef PerlIO_exportFILE -extern FILE *PerlIO_exportFILE(PerlIO *, int); +extern FILE *PerlIO_exportFILE(PerlIO *, const char *); #endif #ifndef PerlIO_findFILE extern FILE *PerlIO_findFILE(PerlIO *); @@ -257,11 +275,11 @@ extern void PerlIO_setlinebuf(PerlIO *); #endif #ifndef PerlIO_printf extern int PerlIO_printf(PerlIO *, const char *, ...) - __attribute__ ((__format__(__printf__, 2, 3))); + __attribute__format__(__printf__, 2, 3); #endif #ifndef PerlIO_sprintf extern int PerlIO_sprintf(char *, int, const char *, ...) - __attribute__ ((__format__(__printf__, 3, 4))); + __attribute__format__(__printf__, 3, 4); #endif #ifndef PerlIO_vprintf extern int PerlIO_vprintf(PerlIO *, const char *, va_list); @@ -324,7 +342,7 @@ extern int PerlIO_getpos(PerlIO *, SV *); extern int PerlIO_setpos(PerlIO *, SV *); #endif #ifndef PerlIO_fdupopen -extern PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *); +extern PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); #endif #if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO) extern char *PerlIO_modestr(PerlIO *, char *buf); @@ -346,11 +364,14 @@ extern char *PerlIO_getname(PerlIO *, char *); extern void PerlIO_destruct(pTHX); -#ifndef PERLIO_IS_STDIO +extern int PerlIO_intmode2str(int rawmode, char *mode, int *writing); -extern void PerlIO_cleanup(void); +#ifdef PERLIO_LAYERS +extern void PerlIO_cleanup(pTHX); extern void PerlIO_debug(const char *fmt, ...); +typedef struct PerlIO_list_s PerlIO_list_t; + #endif