2 #define PERLIO_NOT_STDIO 1
15 typedef PerlIO * InputStream;
16 typedef PerlIO * OutputStream;
18 #define PERLIO_IS_STDIO 1
20 typedef FILE * InputStream;
21 typedef FILE * OutputStream;
28 croak("%s not implemented on this architecture", s);
39 if (strEQ(name, "_IOFBF"))
41 { *pval = _IOFBF; return TRUE; }
45 if (strEQ(name, "_IOLBF"))
47 { *pval = _IOLBF; return TRUE; }
51 if (strEQ(name, "_IONBF"))
53 { *pval = _IONBF; return TRUE; }
59 if (strEQ(name, "SEEK_SET"))
61 { *pval = SEEK_SET; return TRUE; }
65 if (strEQ(name, "SEEK_CUR"))
67 { *pval = SEEK_CUR; return TRUE; }
71 if (strEQ(name, "SEEK_END"))
73 { *pval = SEEK_END; return TRUE; }
84 MODULE = IO PACKAGE = IO::Seekable PREFIX = f
93 PerlIO_getpos(handle, &pos);
95 fgetpos(handle, &pos);
97 ST(0) = sv_2mortal(newSVpv((char*)&pos, sizeof(Fpos_t)));
111 RETVAL = PerlIO_setpos(handle, (Fpos_t*)SvPVX(pos));
113 RETVAL = fsetpos(handle, (Fpos_t*)SvPVX(pos));
122 MODULE = IO PACKAGE = IO::File PREFIX = f
125 new_tmpfile(packname = "IO::File")
132 fp = PerlIO_tmpfile();
136 gv = (GV*)SvREFCNT_inc(newGVgen(packname));
137 hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
138 if (do_open(gv, "+>&", 3, FALSE, 0, 0, fp)) {
139 ST(0) = sv_2mortal(newRV((SV*)gv));
140 sv_bless(ST(0), gv_stashpv(packname, TRUE));
141 SvREFCNT_dec(gv); /* undo increment in newRV() */
148 MODULE = IO PACKAGE = IO::Handle PREFIX = f
155 if (constant(name, &i))
156 ST(0) = sv_2mortal(newSViv(i));
167 RETVAL = PerlIO_ungetc(handle, c);
169 RETVAL = ungetc(c, handle);
184 RETVAL = PerlIO_error(handle);
186 RETVAL = ferror(handle);
201 PerlIO_clearerr(handle);
222 IoFLAGS(io) |= IOf_UNTAINT;
241 RETVAL = PerlIO_flush(handle);
243 RETVAL = Fflush(handle);
255 char * buf = SvPOK(ST(1)) ? sv_grow(ST(1), BUFSIZ) : 0;
258 #ifdef PERLIO_IS_STDIO
261 not_here("IO::Handle::setbuf");
265 setvbuf(handle, buf, type, size)
267 char * buf = SvPOK(ST(1)) ? sv_grow(ST(1), SvIV(ST(3))) : 0;
271 /* Should check HAS_SETVBUF once Configure tests for that */
272 #if defined(PERLIO_IS_STDIO) && defined(_IOFBF)
274 RETVAL = setvbuf(handle, buf, type, size);
280 RETVAL = (SysRet) not_here("IO::Handle::setvbuf");