Home | History | Annotate | Download | only in io

Lines Matching refs:iqp

40 inquire_via_unit (st_parameter_inquire *iqp, gfc_unit *u)
43 GFC_INTEGER_4 cf = iqp->common.flags;
45 if (iqp->common.unit == GFC_INTERNAL_UNIT ||
46 iqp->common.unit == GFC_INTERNAL_UNIT4 ||
48 generate_error (&iqp->common, LIBERROR_INQUIRE_INTERNAL_UNIT, NULL);
51 *iqp->exist = (u != NULL &&
52 iqp->common.unit != GFC_INTERNAL_UNIT &&
53 iqp->common.unit != GFC_INTERNAL_UNIT4)
54 || (iqp->common.unit >= 0);
57 *iqp->opened = (u != NULL);
60 *iqp->number = (u != NULL) ? u->unit_number : -1;
63 *iqp->named = (u != NULL && u->flags.status != STATUS_SCRATCH);
73 int err = stream_ttyname (u->s, iqp->name, iqp->name_len);
76 gfc_charlen_type tmplen = strlen (iqp->name);
77 if (iqp->name_len > tmplen)
78 memset (&iqp->name[tmplen], ' ', iqp->name_len - tmplen);
81 cf_strcpy (iqp->name, iqp->name_len, u->filename);
84 cf_strcpy (iqp->name, iqp->name_len, u->filename);
87 fstrcpy (iqp->name, iqp->name_len, "CONIN$", sizeof("CONIN$"));
89 fstrcpy (iqp->name, iqp->name_len, "CONOUT$", sizeof("CONOUT$"));
91 fstrcpy (iqp->name, iqp->name_len, "CONERR$", sizeof("CONERR$"));
93 cf_strcpy (iqp->name, iqp->name_len, u->filename);
95 cf_strcpy (iqp->name, iqp->name_len, u->filename);
116 internal_error (&iqp->common, "inquire_via_unit(): Bad access");
119 cf_strcpy (iqp->access, iqp->access_len, p);
137 internal_error (&iqp->common, "inquire_via_unit(): Bad access");
140 cf_strcpy (iqp->sequential, iqp->sequential_len, p);
158 internal_error (&iqp->common, "inquire_via_unit(): Bad access");
161 cf_strcpy (iqp->direct, iqp->direct_len, p);
178 internal_error (&iqp->common, "inquire_via_unit(): Bad form");
181 cf_strcpy (iqp->form, iqp->form_len, p);
198 internal_error (&iqp->common, "inquire_via_unit(): Bad form");
201 cf_strcpy (iqp->formatted, iqp->formatted_len, p);
218 internal_error (&iqp->common, "inquire_via_unit(): Bad form");
221 cf_strcpy (iqp->unformatted, iqp->unformatted_len, p);
227 *iqp->recl_out = (u != NULL) ? u->recl : -1;
230 *iqp->strm_pos_out = (u != NULL) ? u->strm_pos : 0;
236 *iqp->nextrec = u->last_record + 1;
238 *iqp->nextrec = 0;
255 internal_error (&iqp->common, "inquire_via_unit(): Bad blank");
258 cf_strcpy (iqp->blank, iqp->blank_len, p);
275 internal_error (&iqp->common, "inquire_via_unit(): Bad pad");
278 cf_strcpy (iqp->pad, iqp->pad_len, p);
283 GFC_INTEGER_4 cf2 = iqp->flags2;
299 internal_error (&iqp->common, "inquire_via_unit(): Bad encoding");
302 cf_strcpy (iqp->encoding, iqp->encoding_len, p);
319 internal_error (&iqp->common, "inquire_via_unit(): Bad comma");
322 cf_strcpy (iqp->decimal, iqp->decimal_len, p);
340 internal_error (&iqp->common, "inquire_via_unit(): Bad async");
343 cf_strcpy (iqp->asynchronous, iqp->asynchronous_len, p);
349 *(iqp->pending) = 0;
356 id = *(iqp->id);
357 *(iqp->pending) = id > u->au->id.low;
361 *(iqp->pending) = ! u->au->empty;
384 internal_error (&iqp->common, "inquire_via_unit(): Bad sign");
387 cf_strcpy (iqp->sign, iqp->sign_len, p);
416 internal_error (&iqp->common, "inquire_via_unit(): Bad round");
419 cf_strcpy (iqp->round, iqp->round_len, p);
425 *iqp->size = -1;
429 *iqp->size = ssize (u->s);
448 internal_error (&iqp->common, "inquire_via_unit(): Bad pad");
451 cf_strcpy (iqp->iqstream, iqp->iqstream_len, p);
471 internal_error (&iqp->common,
476 cf_strcpy (iqp->share, iqp->share_len, p);
499 internal_error (&iqp->common, "inquire_via_unit(): Bad cc");
503 cf_strcpy (iqp->cc, iqp->cc_len, p);
542 cf_strcpy (iqp->position, iqp->position_len, p);
562 internal_error (&iqp->common, "inquire_via_unit(): Bad action");
565 cf_strcpy (iqp->action, iqp->action_len, p);
571 cf_strcpy (iqp->read, iqp->read_len, p);
577 cf_strcpy (iqp->write, iqp->write_len, p);
583 cf_strcpy (iqp->readwrite, iqp->readwrite_len, p);
604 internal_error (&iqp->common, "inquire_via_unit(): Bad delim");
607 cf_strcpy (iqp->delim, iqp->delim_len, p);
624 internal_error (&iqp->common, "inquire_via_unit(): Bad pad");
627 cf_strcpy (iqp->pad, iqp->pad_len, p);
664 internal_error (&iqp->common, "inquire_via_unit(): Bad convert");
667 cf_strcpy (iqp->convert, iqp->convert_len, p);
676 inquire_via_filename (st_parameter_inquire *iqp)
679 GFC_INTEGER_4 cf = iqp->common.flags;
682 *iqp->exist = file_exists (iqp->file, iqp->file_len);
685 *iqp->opened = 0;
688 *iqp->number = -1;
691 *iqp->named = 1;
694 fstrcpy (iqp->name, iqp->name_len, iqp->file, iqp->file_len);
697 cf_strcpy (iqp->access, iqp->access_len, undefined);
702 iqp->sequential, iqp->sequential_len, p);
708 cf_strcpy (iqp->direct, iqp->direct_len, p);
712 cf_strcpy (iqp->form, iqp->form_len, undefined);
717 cf_strcpy (iqp->formatted, iqp->formatted_len, p);
723 cf_strcpy (iqp->unformatted, iqp->unformatted_len, p);
729 *iqp->recl_out = -1;
732 *iqp->nextrec = 0;
735 cf_strcpy (iqp->blank, iqp->blank_len, undefined);
738 cf_strcpy (iqp->pad, iqp->pad_len, undefined);
742 GFC_INTEGER_4 cf2 = iqp->flags2;
745 cf_strcpy (iqp->encoding, iqp->encoding_len, undefined);
748 cf_strcpy (iqp->delim, iqp->delim_len, undefined);
751 cf_strcpy (iqp->decimal, iqp->decimal_len, undefined);
754 cf_strcpy (iqp->delim, iqp->delim_len, undefined);
757 cf_strcpy (iqp->pad, iqp->pad_len, undefined);
760 cf_strcpy (iqp->encoding, iqp->encoding_len, undefined);
763 *iqp->size = file_size (iqp->file, iqp->file_len);
766 cf_strcpy (iqp->iqstream, iqp->iqstream_len, "UNKNOWN");
769 cf_strcpy (iqp->share, iqp->share_len, "UNKNOWN");
772 cf_strcpy (iqp->cc, iqp->cc_len, "UNKNOWN");
776 cf_strcpy (iqp->position, iqp->position_len, undefined);
779 cf_strcpy (iqp->access, iqp->access_len, undefined);
783 p = inquire_read (iqp->file, iqp->file_len);
784 cf_strcpy (iqp->read, iqp->read_len, p);
789 p = inquire_write (iqp->file, iqp->file_len);
790 cf_strcpy (iqp->write, iqp->write_len, p);
795 p = inquire_read (iqp->file, iqp->file_len);
796 cf_strcpy (iqp->readwrite, iqp->readwrite_len, p);
808 st_inquire (st_parameter_inquire *iqp)
812 library_start (&iqp->common);
814 if ((iqp->common.flags & IOPARM_INQUIRE_HAS_FILE) == 0)
816 u = find_unit (iqp->common.unit);
817 inquire_via_unit (iqp, u);
821 u = find_file (iqp->file, iqp->file_len);
823 inquire_via_filename (iqp);
825 inquire_via_unit (iqp, u);