1 /* Thread/recursion locking
2 Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Paul Brook <paul@nowt.org> and Andy Vaught
5 This file is part of the GNU Fortran 95 runtime library (libgfortran).
7 Libgfortran is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 In addition to the permissions in the GNU General Public License, the
13 Free Software Foundation gives you unlimited permission to link the
14 compiled version of this file into combinations with other programs,
15 and to distribute those combinations without any restriction coming
16 from the use of this file. (The General Public License restrictions
17 do apply in other respects; for example, they cover modification of
18 the file, and distribution when not linked into a combine
21 Libgfortran is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
26 You should have received a copy of the GNU General Public
27 License along with libgfortran; see the file COPYING. If not,
28 write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29 Boston, MA 02110-1301, USA. */
33 #include "libgfortran.h"
43 /* library_start()-- Called with a library call is entered. */
49 internal_error ("Recursive library calls not allowed");
51 /* The in_library flag indicates whether we're currently processing a
52 library call. Some calls leave immediately, but READ and WRITE
53 processing return control to the caller but are still considered to
54 stay within the library. */
57 if (ioparm
.iostat
!= NULL
&& ioparm
.library_return
== LIBRARY_OK
)
58 *ioparm
.iostat
= ERROR_OK
;
60 ioparm
.library_return
= LIBRARY_OK
;
64 /* library_end()-- Called when a library call is complete in order to
65 clean up for the next call. */
71 namelist_info
* t1
, *t2
;
76 t
= ioparm
.library_return
;
78 /* Delete the namelist, if it exists. */
87 free_mem (t2
->var_name
);
98 memset (&ioparm
, '\0', sizeof (ioparm
));
99 ioparm
.library_return
= t
;