Lines Matching defs:stdio

18  * is Perl's private replacement for the C stdio library. This is used
20 * PERLIO=:stdio (but don't do this unless you know what you're doing)
2052 * PERLIO_FLUSH_ALL = (PerlIO*)-1;)? Yes, stdio does similar
3283 * stdio as a layer
3296 FILE *stdio; /* The stream */
3305 FILE * const s = PerlIOSelf(f, PerlIOStdio)->stdio;
3336 /* Top is already stdio - pop self (duplicate) and use original */
3342 FILE *stdio;
3343 if (fd >= 0 && (stdio = PerlSIO_fdopen(fd,
3345 PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
3360 PerlIO_importFILE(FILE *stdio, const char *mode)
3369 if (stdio) {
3371 int fd0 = fileno(stdio);
3374 rc = fldata(stdio,filename,&fileinfo);
3392 varies between stdio implementations.
3415 s->stdio = stdio;
3416 fd0 = fileno(stdio);
3423 rc = fldata(stdio,filename,&fileinfo);
3448 FILE *stdio;
3451 PerlIOUnix_refcnt_dec(fileno(s->stdio));
3452 stdio = PerlSIO_freopen(path, PerlIOStdio_mode(mode, tmode),
3453 s->stdio);
3454 if (!s->stdio)
3456 s->stdio = stdio;
3457 fd = fileno(stdio);
3473 FILE *stdio;
3480 stdio = PerlSIO_fopen(path, mode);
3481 if (stdio) {
3489 PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
3490 fd = fileno(stdio);
3494 PerlSIO_fclose(stdio);
3504 FILE *stdio = NULL;
3513 stdio = PerlSIO_stdin;
3516 stdio = PerlSIO_stdout;
3519 stdio = PerlSIO_stderr;
3524 stdio = PerlSIO_fdopen(fd, mode =
3527 if (stdio) {
3532 PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
3533 fd = fileno(stdio);
3552 FILE *stdio = PerlIOSelf(o, PerlIOStdio)->stdio;
3553 const int fd = fileno(stdio);
3556 const int dfd = PerlLIO_dup_cloexec(fileno(stdio));
3558 stdio = PerlSIO_fdopen(dfd, PerlIO_modestr(o,mode));
3564 re-use the existing stdio as though flag was not set
3568 stdio = PerlSIO_fdopen(fd, PerlIO_modestr(o,mode));
3570 PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
3571 if(stdio) {
3572 int fd = fileno(stdio);
3658 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3659 if (!stdio) {
3664 const int fd = fileno(stdio);
3670 /* Socks lib overrides close() but stdio isn't linked to
3672 on sockets on stdio's behalf.
3679 /* Test for -1, as *BSD stdio (at least) on fclose sets the FILE* such
3689 /* For STD* handles, don't close stdio, since we shared the FILE *, too. */
3690 if (stdio == stdin) /* Some stdios are buggy fflush-ing inputs */
3692 if (stdio == stdout || stdio == stderr)
3714 /* Tricky - must fclose(stdio) to free memory but not close(fd)
3720 invalidate = PerlIOStdio_invalidate_fileno(aTHX_ stdio);
3734 result = PerlSIO_fclose(stdio);
3735 /* We treat error from stdio as success if we invalidated
3763 s = PerlIOSelf(f, PerlIOStdio)->stdio;
3769 * stdio does not do that for fread()
3788 /* Under some circumstances IRIX stdio fgetc() and fread()
3800 FILE * const s = PerlIOSelf(f, PerlIOStdio)->stdio;
3862 PerlIOSelf(f, PerlIOStdio)->stdio);
3875 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3878 return PerlSIO_fseek(stdio, offset, whence);
3884 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3887 return PerlSIO_ftell(stdio);
3893 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3897 return PerlSIO_fflush(stdio);
3912 if (PerlSIO_fseek(stdio, (Off_t) 0, SEEK_CUR) != 0)
3924 return PerlSIO_feof(PerlIOSelf(f, PerlIOStdio)->stdio);
3932 return PerlSIO_ferror(PerlIOSelf(f, PerlIOStdio)->stdio);
3940 PerlSIO_clearerr(PerlIOSelf(f, PerlIOStdio)->stdio);
3949 PerlSIO_setlinebuf(PerlIOSelf(f, PerlIOStdio)->stdio);
3951 PerlSIO_setvbuf(PerlIOSelf(f, PerlIOStdio)->stdio, NULL, _IOLBF, 0);
3959 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3961 return (STDCHAR*)PerlSIO_get_base(stdio);
3967 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3969 return PerlSIO_get_bufsiz(stdio);
3977 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3979 return (STDCHAR*)PerlSIO_get_ptr(stdio);
3985 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
3987 return PerlSIO_get_cnt(stdio);
3993 FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
4009 PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */
4012 assert(PerlSIO_get_cnt(stdio) == (cnt));
4028 PerlSIO_set_cnt(stdio, cnt);
4030 PerlSIO_set_ptr(stdio,
4031 PerlSIO_get_ptr(stdio) + (PerlSIO_get_cnt(stdio) -
4044 FILE * stdio;
4049 stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
4052 * fflush()ing read-only streams can cause trouble on some stdio-s
4055 if (PerlSIO_fflush(stdio) != 0)
4059 c = PerlSIO_fgetc(stdio);
4062 if (! PerlSIO_ferror(stdio) || errno != EINTR)
4076 STDCHAR *base = (STDCHAR*)PerlSIO_get_base(stdio);
4077 SSize_t cnt = PerlSIO_get_cnt(stdio);
4078 STDCHAR *ptr = (STDCHAR*)PerlSIO_get_ptr(stdio);
4082 if (PerlSIO_feof(stdio))
4083 PerlSIO_clearerr(stdio);
4100 if (PerlSIO_ungetc(c, stdio) != c)
4110 "stdio",
4160 FILE *stdio = NULL;
4171 stdio = PerlSIO_fdopen(PerlIO_fileno(f), mode);
4172 if (stdio) {
4175 /* De-link any lower layers so new :stdio sticks */
4179 s->stdio = stdio;
4180 PerlIOUnix_refcnt_inc(fileno(stdio));
4190 return stdio;
4198 FILE *stdio;
4202 return s->stdio;
4213 stdio = PerlIO_exportFILE(f, NULL);
4214 if (stdio) {
4215 const int fd = fileno(stdio);
4219 return stdio;
4230 if (s->stdio == f) { /* not in a loop */
4542 * In simple stdio-like ungetc() case chars will be already
5296 FILE *stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
5297 if (!stdio) {
5298 stdio = PerlIO_exportFILE(f,0);
5301 if (stdio) {
5302 name = fgetname(stdio, buf);
5303 if (exported) PerlIO_releaseFILE(f,stdio);
5506 #else /* !HAS_MKSTEMP, fallback to stdio tmpfile(). */
5507 FILE * const stdio = PerlSIO_tmpfile();
5509 if (stdio)
5510 f = PerlIO_fdopen(fileno(stdio), "w+");