Lines Matching defs:io
83 register IO *io = GvIOn(gv);
112 if (IoIFP(io)) {
113 fd = PerlIO_fileno(IoIFP(io));
114 if (IoTYPE(io) == IoTYPE_STD) {
120 saveifp = IoIFP(io);
121 saveofp = IoOFP(io);
122 savetype = IoTYPE(io);
126 else if (IoTYPE(io) == IoTYPE_PIPE)
127 result = PerlProc_pclose(IoIFP(io));
128 else if (IoIFP(io) != IoOFP(io)) {
129 if (IoOFP(io)) {
130 result = PerlIO_close(IoOFP(io));
131 PerlIO_close(IoIFP(io)); /* clear stdio, fd already closed */
134 result = PerlIO_close(IoIFP(io));
137 result = PerlIO_close(IoIFP(io));
144 IoOFP(io) = IoIFP(io) = Nullfp;
194 IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
241 IoTYPE(io) = *type;
304 mode[0] = IoTYPE(io) = IoTYPE_APPEND;
331 Perl_croak(aTHX_ "More than one argument to '%c&' open",IoTYPE(io));
381 IoTYPE(io) = IoTYPE_WRONLY;
383 IoTYPE(io) = IoTYPE_RDONLY;
387 IoTYPE(io) = IoTYPE_SOCKET;
416 IoTYPE(io) = IoTYPE_STD;
450 IoTYPE(io) = IoTYPE_STD;
503 IoTYPE(io) = IoTYPE_PIPE;
517 IoTYPE(io) = IoTYPE_RDONLY;
527 IoTYPE(io) = IoTYPE_STD;
541 if (ckWARN(WARN_NEWLINE) && IoTYPE(io) == IoTYPE_RDONLY && strchr(name, '\n'))
547 if ((IoTYPE(io) == IoTYPE_RDONLY) &&
554 else if ((IoTYPE(io) == IoTYPE_WRONLY) && fp == PerlIO_stdin()) {
566 if (IoTYPE(io) && IoTYPE(io) != IoTYPE_PIPE && IoTYPE(io) != IoTYPE_STD && fd >= 0) {
574 IoTYPE(io) = IoTYPE_SOCKET; /* in case a socket was passed in to us */
582 && IoTYPE(io) != IoTYPE_WRONLY /* Dups of STD* filehandles already have */
583 && IoTYPE(io) != IoTYPE_RDONLY /* type so they aren't marked as sockets */
589 IoTYPE(io) = IoTYPE_SOCKET; /* some OS's return 0 on fstat()ed socket */
681 IoIFP(io) = fp;
683 IoFLAGS(io) &= ~IOf_NOLINE;
685 if (IoTYPE(io) == IoTYPE_SOCKET
686 || (IoTYPE(io) == IoTYPE_WRONLY && fd >= 0 && S_ISCHR(PL_statbuf.st_mode)) ) {
691 if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,s,fd,0,0,NULL,0,svp))) {
693 IoIFP(io) = Nullfp;
698 IoOFP(io) = fp;
703 IoIFP(io) = saveifp;
704 IoOFP(io) = saveofp;
705 IoTYPE(io) = savetype;
719 IO *io = GvIOp(gv);
723 if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) {
724 IoFLAGS(io) &= ~IOf_START;
908 if (io && (IoFLAGS(io) & IOf_ARGV))
909 IoFLAGS(io) |= IOf_START;
912 if (io && (IoFLAGS(io) & IOf_ARGV)
976 IO *io;
985 io = GvIO(gv);
986 if (!io) { /* never opened */
989 report_evil_fh(gv, io, PL_op->op_type);
994 retval = io_close(io, not_implicit);
996 IoLINES(io) = 0;
997 IoPAGE(io) = 0;
998 IoLINES_LEFT(io) = IoPAGE_LEN(io);
1000 IoTYPE(io) = IoTYPE_CLOSED;
1005 Perl_io_close(pTHX_ IO *io, bool not_implicit)
1010 if (IoIFP(io)) {
1011 if (IoTYPE(io) == IoTYPE_PIPE) {
1012 status = PerlProc_pclose(IoIFP(io));
1021 else if (IoTYPE(io) == IoTYPE_STD)
1024 if (IoOFP(io) && IoOFP(io) != IoIFP(io)) { /* a socket */
1025 retval = (PerlIO_close(IoOFP(io)) != EOF);
1026 PerlIO_close(IoIFP(io)); /* clear stdio, fd already closed */
1029 retval = (PerlIO_close(IoIFP(io)) != EOF);
1031 IoOFP(io) = IoIFP(io) = Nullfp;
1043 register IO *io;
1046 io = GvIO(gv);
1048 if (!io)
1050 else if (ckWARN(WARN_IO) && (IoTYPE(io) == IoTYPE_WRONLY))
1051 report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
1053 while (IoIFP(io)) {
1056 if (PerlIO_has_cntptr(IoIFP(io))) { /* (the code works without this) */
1057 if (PerlIO_get_cnt(IoIFP(io)) > 0) /* cheat a little, since */
1062 ch = PerlIO_getc(IoIFP(io));
1064 (void)PerlIO_ungetc(IoIFP(io),ch);
1070 if (PerlIO_has_cntptr(IoIFP(io)) && PerlIO_canset_cnt(IoIFP(io))) {
1071 if (PerlIO_get_cnt(IoIFP(io)) < -1)
1072 PerlIO_set_cnt(IoIFP(io),-1);
1087 register IO *io = 0;
1090 if (gv && (io = GvIO(gv)) && (fp = IoIFP(io))) {
1098 report_evil_fh(gv, io, PL_op->op_type);
1106 register IO *io = 0;
1109 if (gv && (io = GvIO(gv)) && (fp = IoIFP(io))) {
1117 report_evil_fh(gv, io, PL_op->op_type);
1125 register IO *io = 0;
1128 if (gv && (io = GvIO(gv)) && (fp = IoIFP(io)))
1131 report_evil_fh(gv, io, PL_op->op_type);
1315 * io the write failure can be delayed until the flush/close. --jhi */
1325 IO *io;
1332 io = GvIO(gv);
1333 if (io && IoIFP(io)) {
1337 return (PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache));
1343 report_evil_fh(gv, io, PL_op->op_type);
2253 Perl_start_glob (pTHX_ SV *tmpglob, IO *io)
2337 IoTYPE(io) = IoTYPE_RDONLY;
2338 IoIFP(io) = fp = tmpfp;
2339 IoFLAGS(io) &= ~IOf_UNTAINT; /* maybe redundant */
2383 fp = IoIFP(io);