Lines Matching refs:mode

108 perlsio_binmode(FILE *fp, int iotype, int mode)
116 if (mode & O_BINARY)
126 if (PerlLIO_setmode(fp, mode) != -1) {
128 if (PerlLIO_setmode(fileno(fp), mode) != -1) {
132 * The translation mode of the stream is maintained independent of
133 * the translation mode of the fd in the Borland RTL (heavy
135 * the mode explicitly for the stream (though they don't document
139 if (mode & O_BINARY)
152 if (my_binmode(fp, iotype, mode) != FALSE)
167 PerlIO_intmode2str(int rawmode, char *mode, int *writing)
188 mode[ix++] = 'r';
192 mode[ix++] = 'a';
194 mode[ix++] = '+';
199 mode[ix++] = 'w';
201 mode[ix++] = 'r';
202 mode[ix++] = '+';
206 mode[ix++] = 'b';
207 mode[ix] = '\0';
213 PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names)
235 PerlIO_binmode(pTHX_ PerlIO *fp, int iotype, int mode, const char *names)
240 return perlsio_binmode(fp, iotype, mode);
259 char mode[8];
264 PerlIO_intmode2str(omode,mode,NULL);
266 return PerlIO_fdopen(fd, mode);
285 PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
296 if (*mode == IoTYPE_NUMERIC) {
299 return PerlIO_fdopen(fd, (char *) mode + 1);
302 return PerlIO_reopen(name, mode, old);
305 return PerlIO_open(name, mode);
310 return PerlIO_fdopen(fd, (char *) mode);
396 PerlIO_importFILE(FILE *stdio, const char *mode)
399 if (!mode || !*mode) {
400 mode = "r+";
402 return PerlIO_fdopen(fd, mode);
1031 PerlIOPop_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
1145 PerlIO_push(pTHX_ PerlIO *f, PerlIO_funcs *tab, const char *mode, SV *arg)
1164 (mode) ? mode : "(Null)", (void*)arg);
1166 (*l->tab->Pushed) (aTHX_ f, mode, arg, tab) != 0) {
1175 (mode) ? mode : "(Null)", (void*)arg);
1177 (*tab->Pushed) (aTHX_ f, mode, arg, tab) != 0) {
1203 PerlIORaw_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
1241 PerlIO_apply_layera(pTHX_ PerlIO *f, const char *mode,
1248 if (!PerlIO_push(aTHX_ f, tab, mode, PerlIOArg)) {
1259 PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names)
1266 code = PerlIO_apply_layera(aTHX_ f, mode, layers, 0, layers->cur);
1280 PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int mode, const char *names)
1283 (void*)f, PerlIOBase(f)->tab->name, iotype, mode,
1297 O_BINARY so we can look for it in mode.
1299 if (!(mode & O_BINARY)) {
1300 /* Text mode */
1311 /* Not in text mode - flush any pending stuff and flip it */
1367 PerlIO_context_layers(pTHX_ const char *mode)
1378 if (type && mode[0] != 'r') {
1419 const char *mode, int narg, SV **args)
1446 layers = PerlIO_context_layers(aTHX_ mode);
1476 PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd,
1482 layers = PerlIO_context_layers(aTHX_ mode);
1484 PerlIO_apply_layers(aTHX_ f, mode, layers);
1507 layera = PerlIO_resolve_layers(aTHX_ layers, mode, narg, args);
1532 tab->name, layers, mode, fd, imode, perm,
1535 f = (*tab->Open) (aTHX_ tab, layera, n, mode, fd, imode, perm,
1547 if (PerlIO_apply_layera(aTHX_ f, mode, layera, n + 1, layera->cur) != 0) {
1799 PerlIOUtf8_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
1871 IV n, const char *mode, int fd, int imode, int perm,
1876 return (*tab->Open) (aTHX_ tab, layers, n - 1, mode, fd, imode, perm,
1956 PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
1960 const char *omode = mode;
1967 if (mode) {
1968 if (*mode == IoTYPE_NUMERIC || *mode == IoTYPE_IMPLICIT)
1969 mode++;
1970 switch (*mode++) {
1984 while (*mode) {
1985 switch (*mode++) {
2281 PerlIOUnix_oflags(const char *mode)
2284 if (*mode == IoTYPE_IMPLICIT || *mode == IoTYPE_NUMERIC)
2285 mode++;
2286 switch (*mode) {
2289 if (*++mode == '+') {
2291 mode++;
2297 if (*++mode == '+') {
2299 mode++;
2307 if (*++mode == '+') {
2309 mode++;
2315 if (*mode == 'b') {
2318 mode++;
2320 else if (*mode == 't') {
2323 mode++;
2326 * Always open in binary mode
2329 if (*mode || oflags == -1) {
2364 PerlIOUnix_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
2366 IV code = PerlIOBase_pushed(aTHX_ f, mode, arg, tab);
2372 * handle rather than believing the "mode" we are passed in? XXX
2373 * Should the value on NULL mode be 0 or -1?
2376 mode ? PerlIOUnix_oflags(mode) : -1);
2407 IV n, const char *mode, int fd, int imode,
2416 if (*mode == IoTYPE_NUMERIC)
2417 mode++;
2419 imode = PerlIOUnix_oflags(mode);
2427 if (*mode == IoTYPE_IMPLICIT)
2428 mode++;
2433 if (!(f = PerlIO_push(aTHX_ f, self, mode, PerlIOArg))) {
2439 if (*mode == IoTYPE_APPEND)
2613 PerlIOStdio_mode(const char *mode, char *tmode)
2616 if (mode) {
2617 while (*mode) {
2618 *tmode++ = *mode++;
2629 PerlIOStdio_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
2643 mode = PerlIOStdio_mode(mode, tmode)))) {
2653 return PerlIOBase_pushed(aTHX_ f, mode, arg, tab);
2658 PerlIO_importFILE(FILE *stdio, const char *mode)
2664 if (!mode || !*mode) {
2673 FILE *f2 = PerlSIO_fdopen(fd, (mode = "r+"));
2675 f2 = PerlSIO_fdopen(fd, (mode = "w"));
2678 f2 = PerlSIO_fdopen(fd, (mode = "r"));
2687 if ((f = PerlIO_push(aTHX_(f = PerlIO_allocate(aTHX)), &PerlIO_stdio, mode, Nullsv))) {
2697 IV n, const char *mode, int fd, int imode,
2706 stdio = PerlSIO_freopen(path, (mode = PerlIOStdio_mode(mode, tmode)),
2717 if (*mode == IoTYPE_NUMERIC) {
2718 mode++;
2727 mode = PerlIOStdio_mode(mode, tmode);
2729 stdio = PerlSIO_fopen(path, mode);
2736 mode = PerlIOStdio_mode(mode, tmode);
2737 f = PerlIO_push(aTHX_ f, self, mode, PerlIOArg);
2753 if (*mode == IoTYPE_IMPLICIT) {
2755 mode++;
2771 stdio = PerlSIO_fdopen(fd, mode =
2772 PerlIOStdio_mode(mode, tmode));
2779 if ((f = PerlIO_push(aTHX_ f, self, mode, PerlIOArg))) {
2800 char mode[8];
2804 stdio = PerlSIO_fdopen(dfd, PerlIO_modestr(o,mode));
2813 stdio = PerlSIO_fdopen(fd, PerlIO_modestr(o,mode));
3315 PerlIO_exportFILE(PerlIO * f, const char *mode)
3322 if (!mode || !*mode) {
3323 mode = PerlIO_modestr(f, buf);
3325 stdio = PerlSIO_fdopen(PerlIO_fileno(f), mode);
3358 /* Uses fallback "mode" via PerlIO_modestr() in PerlIO_exportFILE */
3387 PerlIOBuf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
3400 return PerlIOBase_pushed(aTHX_ f, mode, arg, tab);
3405 IV n, const char *mode, int fd, int imode, int perm,
3414 (*tab->Open)(aTHX_ tab, layers, n - 1, mode, fd, imode, perm,
3416 if (!next || (*PerlIOBase(f)->tab->Pushed) (aTHX_ f, mode, PerlIOArg, self) != 0) {
3423 if (*mode == IoTYPE_IMPLICIT) {
3426 * mode++;
3430 f = (*tab->Open)(aTHX_ tab, layers, n - 1, mode, fd, imode, perm,
3435 if (PerlIO_push(aTHX_ f, self, mode, PerlIOArg) == 0) {
3944 PerlIOPending_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
3946 IV code = PerlIOBase_pushed(aTHX_ f, mode, arg, tab);
4023 PerlIOCrlf_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
4027 code = PerlIOBuf_pushed(aTHX_ f, mode, arg, tab);
4030 f, PerlIOBase(f)->tab->name, (mode) ? mode : "(Null)",
4295 /* In text mode - flush any pending stuff and flip it */
4717 PerlIO_fdopen(int fd, const char *mode)
4720 return PerlIO_openn(aTHX_ Nullch, mode, fd, 0, 0, NULL, 0, NULL);
4725 PerlIO_open(const char *path, const char *mode)
4729 return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, NULL, 1, &name);
4734 PerlIO_reopen(const char *path, const char *mode, PerlIO *f)
4738 return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, f, 1, &name);
4893 * not in true PerlIO mode