| 1 |
/* Thread/recursion locking |
| 2 |
Copyright (C) 2002-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Paul Brook <[email protected]> and Andy Vaught |
| 4 |
|
| 5 |
This file is part of the GNU Fortran runtime library (libgfortran). |
| 6 |
|
| 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 3 of the License, or (at your option) any later version. |
| 11 |
|
| 12 |
Libgfortran is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
Under Section 7 of GPL version 3, you are granted additional |
| 18 |
permissions described in the GCC Runtime Library Exception, version |
| 19 |
3.1, as published by the Free Software Foundation. |
| 20 |
|
| 21 |
You should have received a copy of the GNU General Public License and |
| 22 |
a copy of the GCC Runtime Library Exception along with this program; |
| 23 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 24 |
<http://www.gnu.org/licenses/>. */ |
| 25 |
|
| 26 |
#include "io.h" |
| 27 |
#include <string.h> |
| 28 |
|
| 29 |
/* library_start()-- Called with a library call is entered. */ |
| 30 |
|
| 31 |
void |
| 32 |
library_start (st_parameter_common *cmp) |
| 33 |
{ |
| 34 |
if ((cmp->flags & IOPARM_LIBRETURN_ERROR) != 0) |
| 35 |
return; |
| 36 |
|
| 37 |
cmp->flags &= ~IOPARM_LIBRETURN_MASK; |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
void |
| 42 |
free_ionml (st_parameter_dt *dtp) |
| 43 |
{ |
| 44 |
namelist_info *t1, *t2; |
| 45 |
|
| 46 |
/* Delete the namelist, if it exists. */ |
| 47 |
|
| 48 |
if (dtp->u.p.ionml != NULL) |
| 49 |
{ |
| 50 |
t1 = dtp->u.p.ionml; |
| 51 |
while (t1 != NULL) |
| 52 |
{ |
| 53 |
t2 = t1; |
| 54 |
t1 = t1->next; |
| 55 |
free (t2->var_name); |
| 56 |
if (t2->var_rank) |
| 57 |
{ |
| 58 |
free (t2->dim); |
| 59 |
free (t2->ls); |
| 60 |
} |
| 61 |
free (t2); |
| 62 |
} |
| 63 |
} |
| 64 |
dtp->u.p.ionml = NULL; |
| 65 |
} |