aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/lock.c')
-rw-r--r--libgfortran/io/lock.c44
1 files changed, 8 insertions, 36 deletions
diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c
index 7dc08e1..c39188f 100644
--- a/libgfortran/io/lock.c
+++ b/libgfortran/io/lock.c
@@ -33,53 +33,28 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
#include "io.h"
-st_parameter ioparm;
-iexport_data(ioparm);
-
-namelist_info *ionml;
-global_t g;
-
-
/* library_start()-- Called with a library call is entered. */
void
-library_start (void)
+library_start (st_parameter_common *cmp)
{
- if (g.in_library)
- internal_error ("Recursive library calls not allowed");
-
- /* The in_library flag indicates whether we're currently processing a
- library call. Some calls leave immediately, but READ and WRITE
- processing return control to the caller but are still considered to
- stay within the library. */
- g.in_library = 1;
+ if ((cmp->flags & IOPARM_HAS_IOSTAT) != 0)
+ *cmp->iostat = ERROR_OK;
- if (ioparm.iostat != NULL)
- *ioparm.iostat = ERROR_OK;
-
- ioparm.library_return = LIBRARY_OK;
+ cmp->flags &= ~IOPARM_LIBRETURN_MASK;
}
-/* library_end()-- Called when a library call is complete in order to
- clean up for the next call. */
-
void
-library_end (void)
+free_ionml (st_parameter_dt *dtp)
{
- int t;
namelist_info * t1, *t2;
- g.in_library = 0;
- filename = NULL;
- line = 0;
- t = ioparm.library_return;
-
/* Delete the namelist, if it exists. */
- if (ionml != NULL)
+ if (dtp->u.p.ionml != NULL)
{
- t1 = ionml;
+ t1 = dtp->u.p.ionml;
while (t1 != NULL)
{
t2 = t1;
@@ -93,8 +68,5 @@ library_end (void)
free_mem (t2);
}
}
- ionml = NULL;
-
- memset (&ioparm, '\0', sizeof (ioparm));
- ioparm.library_return = t;
+ dtp->u.p.ionml = NULL;
}