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)));
110 if (handle && (p = SvPVx(pos, na)) && na == sizeof(Fpos_t))
112 RETVAL = PerlIO_setpos(handle, (Fpos_t*)p);
114 RETVAL = fsetpos(handle, (Fpos_t*)p);
123 MODULE = IO PACKAGE = IO::File PREFIX = f
126 new_tmpfile(packname = "IO::File")
133 fp = PerlIO_tmpfile();
137 gv = (GV*)SvREFCNT_inc(newGVgen(packname));
138 hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
139 if (do_open(gv, "+>&", 3, FALSE, 0, 0, fp)) {
140 ST(0) = sv_2mortal(newRV((SV*)gv));
141 sv_bless(ST(0), gv_stashpv(packname, TRUE));
142 SvREFCNT_dec(gv); /* undo increment in newRV() */
149 MODULE = IO PACKAGE = IO::Handle PREFIX = f
156 if (constant(name, &i))
157 ST(0) = sv_2mortal(newSViv(i));
168 RETVAL = PerlIO_ungetc(handle, c);
170 RETVAL = ungetc(c, handle);
185 RETVAL = PerlIO_error(handle);
187 RETVAL = ferror(handle);
202 PerlIO_clearerr(handle);
223 IoFLAGS(io) |= IOf_UNTAINT;
242 RETVAL = PerlIO_flush(handle);
244 RETVAL = Fflush(handle);
256 char * buf = SvPOK(ST(1)) ? sv_grow(ST(1), BUFSIZ) : 0;
259 #ifdef PERLIO_IS_STDIO
262 not_here("IO::Handle::setbuf");
266 setvbuf(handle, buf, type, size)
268 char * buf = SvPOK(ST(1)) ? sv_grow(ST(1), SvIV(ST(3))) : 0;
272 /* Should check HAS_SETVBUF once Configure tests for that */
273 #if defined(PERLIO_IS_STDIO) && defined(_IOFBF)
274 if (!handle) /* Try input stream. */
275 handle = IoIFP(sv_2io(ST(0)));
277 RETVAL = setvbuf(handle, buf, type, size);
283 RETVAL = (SysRet) not_here("IO::Handle::setvbuf");