]> gcc.gnu.org Git - gcc.git/blobdiff - libgfortran/io/transfer.c
re PR fortran/15750 (IOLENGTH form of INQUIRE statement not implemented)
[gcc.git] / libgfortran / io / transfer.c
index 04b7c5a7ac23c3c7cddd9e19d5c12309085e2734..b20f860bcefdbbd9107a025a65a79ada10f67a47 100644 (file)
@@ -1361,6 +1361,57 @@ finalize_transfer (void)
 }
 
 
+/* Transfer function for IOLENGTH. It doesn't actually do any
+   data transfer, it just updates the length counter.  */
+
+static void
+iolength_transfer (bt type, void *dest, int len)
+{
+  if (ioparm.iolength != NULL)
+    *ioparm.iolength += len;
+}
+
+
+/* Initialize the IOLENGTH data transfer. This function is in essence
+   a very much simplified version of data_transfer_init(), because it
+   doesn't have to deal with units at all.  */
+
+static void
+iolength_transfer_init (void)
+{
+
+  if (ioparm.iolength != NULL)
+    *ioparm.iolength = 0;
+
+  g.item_count = 0;
+
+  /* Set up the subroutine that will handle the transfers.  */
+
+  transfer = iolength_transfer;
+
+}
+
+
+/* Library entry point for the IOLENGTH form of the INQUIRE
+   statement. The IOLENGTH form requires no I/O to be performed, but
+   it must still be a runtime library call so that we can determine
+   the iolength for dynamic arrays and such.  */
+
+void
+st_iolength (void)
+{
+  library_start ();
+
+  iolength_transfer_init ();
+}
+
+void
+st_iolength_done (void)
+{
+  library_end ();
+}
+
+
 /* The READ statement */
 
 void
This page took 0.029494 seconds and 5 git commands to generate.