Lines Matching defs:io

522     IO *io;
531 if ((io = GvIOp(gv)))
534 if (io && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar))) {
537 *MARK-- = SvTIED_obj((SV*)io, mg);
570 IO *io;
578 if (gv && (io = GvIO(gv))
579 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
582 XPUSHs(SvTIED_obj((SV*)io, mg));
655 IO *io;
663 if (gv && (io = GvIO(gv))
664 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
667 XPUSHs(SvTIED_obj((SV*)io, mg));
676 if (!gv || !(io = GvIO(gv)) || !(fp = IoIFP(io))) {
680 report_evil_fh(gv, io, PL_op->op_type);
718 IO *io;
731 if (gv && (io = GvIO(gv))
732 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
735 XPUSHs(SvTIED_obj((SV*)io, mg));
747 if (!(io = GvIO(gv)) || !(fp = IoIFP(io))) {
749 report_evil_fh(gv, io, PL_op->op_type);
755 if (PerlIO_binmode(aTHX_ fp,IoTYPE(io),mode_from_discipline(discp),
757 if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
758 if (!PerlIO_binmode(aTHX_ IoOFP(io),IoTYPE(io),
1189 IO *io = NULL;
1197 if (gv && (io = GvIO(gv))
1198 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1202 XPUSHs(SvTIED_obj((SV*)io, mg));
1214 && (!io || (!IoIFP(io) && IoTYPE(io) != IoTYPE_WRONLY)))
1215 report_evil_fh(gv, io, PL_op->op_type);
1263 register IO *io;
1275 io = GvIO(gv);
1276 if (!io) {
1279 if (IoFMT_GV(io))
1280 fgv = IoFMT_GV(io);
1299 IoFLAGS(io) &= ~IOf_DIDTOP;
1307 register IO *io = GvIOp(gv);
1308 PerlIO *ofp = IoOFP(io);
1315 (long)IoLINES_LEFT(io), (long)FmLINES(PL_formtarget)));
1316 if (!io || !ofp)
1318 if (IoLINES_LEFT(io) < FmLINES(PL_formtarget) &&
1323 if (!IoTOP_GV(io)) {
1327 if (!IoTOP_NAME(io)) {
1328 if (!IoFMT_NAME(io))
1329 IoFMT_NAME(io) = savepv(GvNAME(gv));
1334 IoTOP_NAME(io) = savepv(SvPVX(topname));
1336 IoTOP_NAME(io) = savepv("top");
1338 topgv = gv_fetchpv(IoTOP_NAME(io),FALSE, SVt_PVFM);
1340 IoLINES_LEFT(io) = 100000000;
1343 IoTOP_GV(io) = topgv;
1345 if (IoFLAGS(io) & IOf_DIDTOP) { /* Oh dear. It still doesn't fit. */
1346 I32 lines = IoLINES_LEFT(io);
1362 FmLINES(PL_formtarget) -= IoLINES_LEFT(io);
1365 if (IoLINES_LEFT(io) >= 0 && IoPAGE(io) > 0)
1367 IoLINES_LEFT(io) = IoPAGE_LEN(io);
1368 IoPAGE(io)++;
1370 IoFLAGS(io) |= IOf_DIDTOP;
1371 fgv = IoTOP_GV(io);
1399 fp = IoOFP(io);
1402 if (IoIFP(io))
1403 report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
1405 report_evil_fh(gv, io, PL_op->op_type);
1410 if ((IoLINES_LEFT(io) -= FmLINES(PL_formtarget)) < 0) {
1420 if (IoFLAGS(io) & IOf_FLUSH)
1435 IO *io;
1445 if (gv && (io = GvIO(gv))
1446 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1455 *MARK = SvTIED_obj((SV*)io, mg);
1468 if (!(io = GvIO(gv))) {
1470 report_evil_fh(gv, io, PL_op->op_type);
1474 else if (!(fp = IoOFP(io))) {
1476 if (IoIFP(io))
1477 report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
1479 report_evil_fh(gv, io, PL_op->op_type);
1481 SETERRNO(EBADF,IoIFP(io)?RMS_FAC:RMS_IFI);
1489 if (IoFLAGS(io) & IOf_FLUSH)
1540 IO *io;
1557 && gv && (io = GvIO(gv))
1558 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1563 *MARK = SvTIED_obj((SV*)io, mg);
1585 io = GvIO(gv);
1586 if (!io || !IoIFP(io)) {
1588 report_evil_fh(gv, io, PL_op->op_type);
1592 if ((fp_utf8 = PerlIO_isutf8(IoIFP(io))) && !IN_BYTES) {
1622 count = PerlSock_recvfrom(PerlIO_fileno(IoIFP(io)), buffer, length, offset,
1637 if (!(IoFLAGS(io) & IOf_UNTAINT))
1674 if (IoTYPE(io) == IoTYPE_SOCKET) {
1675 count = PerlSock_recv(PerlIO_fileno(IoIFP(io)),
1681 count = PerlLIO_read(PerlIO_fileno(IoIFP(io)),
1687 if (IoTYPE(io) == IoTYPE_SOCKET) {
1694 count = PerlSock_recvfrom(PerlIO_fileno(IoIFP(io)), buffer, length, 0,
1700 count = PerlIO_read(IoIFP(io), buffer, length);
1702 if (count == 0 && PerlIO_error(IoIFP(io)))
1706 if ((IoTYPE(io) == IoTYPE_WRONLY) && ckWARN(WARN_IO))
1707 report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
1750 if (!(IoFLAGS(io) & IOf_UNTAINT))
1779 IO *io;
1789 && gv && (io = GvIO(gv))
1790 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1795 *MARK = SvTIED_obj((SV*)io, mg);
1816 io = GvIO(gv);
1817 if (!io || !IoIFP(io)) {
1820 report_evil_fh(gv, io, PL_op->op_type);
1825 if (PerlIO_isutf8(IoIFP(io))) {
1867 if (IoTYPE(io) == IoTYPE_SOCKET) {
1868 retval = PerlSock_send(PerlIO_fileno(IoIFP(io)),
1875 retval = PerlLIO_write(PerlIO_fileno(IoIFP(io)),
1885 retval = PerlSock_sendto(PerlIO_fileno(IoIFP(io)), buffer, blen,
1890 retval = PerlSock_send(PerlIO_fileno(IoIFP(io)), buffer, blen, length);
1921 IO *io;
1926 IO *io;
1928 io = GvIO(gv);
1929 if (io && !IoIFP(io)) {
1930 if ((IoFLAGS(io) & IOf_START) && av_len(GvAVn(gv)) < 0) {
1931 IoLINES(io) = 0;
1932 IoFLAGS(io) &= ~IOf_START;
1947 if (gv && (io = GvIO(gv))
1948 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1951 XPUSHs(SvTIED_obj((SV*)io, mg));
1968 IO *io;
1976 if (gv && (io = GvIO(gv))
1977 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
1980 XPUSHs(SvTIED_obj((SV*)io, mg));
2006 IO *io;
2017 if (gv && (io = GvIO(gv))
2018 && (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar)))
2021 XPUSHs(SvTIED_obj((SV*)io, mg));
2080 IO *io;
2090 io = GvIOp(tmpgv);
2093 if (!(fp = IoIFP(io))) {
2120 io = (IO*) SvRV(sv); /* *main::FRED{IO} for example */
2169 IO *io = gv ? GvIOn(gv) : 0;
2171 if (!io || !argsv || !IoIFP(io)) {
2173 report_evil_fh(gv, io, PL_op->op_type);
2199 retval = PerlLIO_ioctl(PerlIO_fileno(IoIFP(io)), func, s);
2208 retval = fcntl(PerlIO_fileno(IoIFP(io)), func, (int)s);
2210 retval = fcntl(PerlIO_fileno(IoIFP(io)), func, s);
2242 IO *io = NULL;
2250 if (gv && (io = GvIO(gv)))
2251 fp = IoIFP(io);
2254 io = NULL;
2262 report_evil_fh(gv, io, PL_op->op_type);
2280 register IO *io;
2287 io = gv ? GvIOn(gv) : NULL;
2289 if (!gv || !io) {
2291 report_evil_fh(gv, io, PL_op->op_type);
2292 if (IoIFP(io))
2298 if (IoIFP(io))
2305 IoIFP(io) = PerlIO_fdopen(fd, "r"SOCKET_OPEN_MODE); /* stdio gets confused about sockets */
2306 IoOFP(io) = PerlIO_fdopen(fd, "w"SOCKET_OPEN_MODE);
2307 IoTYPE(io) = IoTYPE_SOCKET;
2308 if (!IoIFP(io) || !IoOFP(io)) {
2309 if (IoIFP(io)) PerlIO_close(IoIFP(io));
2310 if (IoOFP(io)) PerlIO_close(IoOFP(io));
2311 if (!IoIFP(io) && !IoOFP(io)) PerlLIO_close(fd);
2319 setbuf( IoIFP(io), NULL); /* EPOC gets confused about sockets */
2404 register IO *io = GvIOn(gv);
2411 if (!io || !IoIFP(io))
2428 if (PerlSock_bind(PerlIO_fileno(IoIFP(io)),
2444 report_evil_fh(gv, io, PL_op->op_type);
2459 register IO *io = GvIOn(gv);
2462 if (!io || !IoIFP(io))
2467 if (PerlSock_connect(PerlIO_fileno(IoIFP(io)), (struct sockaddr *)addr, len) >= 0)
2474 report_evil_fh(gv, io, PL_op->op_type);
2488 register IO *io = gv ? GvIOn(gv) : NULL;
2490 if (!gv || !io || !IoIFP(io))
2493 if (PerlSock_listen(PerlIO_fileno(IoIFP(io)), backlog) >= 0)
2500 report_evil_fh(gv, io, PL_op->op_type);
2585 register IO *io = GvIOn(gv);
2587 if (!io || !IoIFP(io))
2590 PUSHi( PerlSock_shutdown(PerlIO_fileno(IoIFP(io)), how) >= 0 );
2595 report_evil_fh(gv, io, PL_op->op_type);
2622 register IO *io;
2633 io = GvIOn(gv);
2634 if (!io || !IoIFP(io))
2637 fd = PerlIO_fileno(IoIFP(io));
2674 report_evil_fh(gv, io, optype);
2701 register IO *io = GvIOn(gv);
2704 if (!io || !IoIFP(io))
2712 fd = PerlIO_fileno(IoIFP(io));
2747 report_evil_fh(gv, io, optype);
3293 register IO *io;
3312 io = GvIO(PL_statgv);
3322 io = GvIO(PL_statgv);
3324 if (io && IoIFP(io)) {
3325 if (! PerlIO_has_base(IoIFP(io)))
3327 PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache);
3336 if (PerlIO_get_cnt(IoIFP(io)) <= 0) {
3337 i = PerlIO_getc(IoIFP(io));
3339 (void)PerlIO_ungetc(IoIFP(io),i);
3341 if (PerlIO_get_cnt(IoIFP(io)) <= 0) /* null file is anything */
3343 len = PerlIO_get_bufsiz(IoIFP(io));
3344 s = (STDCHAR *) PerlIO_get_base(IoIFP(io));
3796 register IO *io = GvIOn(gv);
3798 if (!io)
3801 if (IoDIRP(io))
3802 PerlDir_close(IoDIRP(io));
3803 if (!(IoDIRP(io) = PerlDir_open(dirname)))
3830 register IO *io = GvIOn(gv);
3832 if (!io || !IoDIRP(io))
3836 dp = (Direntry_t *)PerlDir_read(IoDIRP(io));
3845 if (!(IoFLAGS(io) & IOf_UNTAINT))
3879 register IO *io = GvIOn(gv);
3881 if (!io || !IoDIRP(io))
3884 PUSHi( PerlDir_tell(IoDIRP(io)) );
3901 register IO *io = GvIOn(gv);
3903 if (!io || !IoDIRP(io))
3906 (void)PerlDir_seek(IoDIRP(io), along);
3923 register IO *io = GvIOn(gv);
3925 if (!io || !IoDIRP(io))
3928 (void)PerlDir_rewind(IoDIRP(io));
3944 register IO *io = GvIOn(gv);
3946 if (!io || !IoDIRP(io))
3950 PerlDir_close(IoDIRP(io));
3952 if (PerlDir_close(IoDIRP(io)) < 0) {
3953 IoDIRP(io) = 0; /* Don't try to close again--coredumps on SysV */
3957 IoDIRP(io) = 0;