Changeset 663 for trunk/AGRIF/LIB/WorkWithAllocatelist.c
- Timestamp:
- 2007-05-25T18:00:33+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/WorkWithAllocatelist.c
r530 r663 3 3 /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ 4 4 /* */ 5 /* Copyright or ©or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */6 /* Cyril Mazauric (Cyril .Mazauric@imag.fr)*/5 /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ 6 /* Cyril Mazauric (Cyril_Mazauric@yahoo.fr) */ 7 7 /* This software is governed by the CeCILL-C license under French law and */ 8 8 /* abiding by the rules of distribution of free software. You can use, */ … … 31 31 /* knowledge of the CeCILL-C license and that you accept its terms. */ 32 32 /******************************************************************************/ 33 /* version 1. 0*/33 /* version 1.6 */ 34 34 /******************************************************************************/ 35 35 #include <stdio.h> … … 38 38 #include "decl.h" 39 39 40 41 40 /******************************************************************************/ 42 /* AddIdentToTheAllocateList_1*/41 /* Add_Allocate_Var_1 */ 43 42 /******************************************************************************/ 44 43 /* Firstpass 1 */ … … 46 45 /* */ 47 46 /******************************************************************************/ 48 void Add IdentToTheAllocateList_1(char *nom)47 void Add_Allocate_Var_1(char *nom,char *nommodule) 49 48 { 50 49 listallocate *newvar; … … 52 51 int out; 53 52 54 if ( firstpass == 1 ) 53 if ( firstpass == 1 ) 55 54 { 56 if ( ! AllocateList)55 if ( !List_Allocate_Var ) 57 56 { 58 57 newvar = (listallocate *)malloc(sizeof(listallocate)); 59 strcpy(newvar-> nomvar,nom);60 strcpy(newvar-> subroutine,subroutinename);61 strcpy(newvar-> module,curmodulename);58 strcpy(newvar->a_nomvar,nom); 59 strcpy(newvar->a_subroutine,subroutinename); 60 strcpy(newvar->a_module,nommodule); 62 61 newvar->suiv = NULL; 63 AllocateList= newvar;62 List_Allocate_Var = newvar; 64 63 } 65 64 else 66 65 { 67 parcours = AllocateList;68 out = 0 ; 66 parcours = List_Allocate_Var; 67 out = 0 ; 69 68 while ( parcours->suiv && out == 0 ) 70 69 { 71 if ( !strcasecmp(parcours-> nomvar,nom) &&72 !strcasecmp(parcours-> subroutine,subroutinename) &&73 !strcasecmp(parcours-> module,curmodulename) ) out = 1;70 if ( !strcasecmp(parcours->a_nomvar,nom) && 71 !strcasecmp(parcours->a_subroutine,subroutinename) && 72 !strcasecmp(parcours->a_module,nommodule) ) out = 1; 74 73 else 75 parcours=parcours->suiv; 74 parcours=parcours->suiv; 76 75 } 77 if ( out == 0 ) 76 if ( out == 0 ) 78 77 { 79 if ( !strcasecmp(parcours-> nomvar,nom) &&80 !strcasecmp(parcours-> subroutine,subroutinename) &&81 !strcasecmp(parcours-> module,curmodulename) ) out = 1;78 if ( !strcasecmp(parcours->a_nomvar,nom) && 79 !strcasecmp(parcours->a_subroutine,subroutinename) && 80 !strcasecmp(parcours->a_module,nommodule) ) out = 1; 82 81 else 83 82 { 84 83 /* add the record */ 85 84 newvar = (listallocate *)malloc(sizeof(listallocate)); 86 strcpy(newvar-> nomvar,nom);87 strcpy(newvar-> subroutine,subroutinename);88 strcpy(newvar-> module,curmodulename);85 strcpy(newvar->a_nomvar,nom); 86 strcpy(newvar->a_subroutine,subroutinename); 87 strcpy(newvar->a_module,nommodule); 89 88 newvar->suiv = NULL; 90 89 parcours->suiv = newvar; … … 95 94 } 96 95 97 /******************************************************************************/98 /* IsAllocateInThisSubroutine_0 */99 /******************************************************************************/100 /* Firstpass 0 */101 /******************************************************************************/102 /* */103 /******************************************************************************/104 int IsAllocateInThisSubroutine_0()105 {106 listallocate *parcours;107 int out;108 109 out = 0 ;110 if ( firstpass == 0 )111 {112 parcours = AllocateList;113 while ( parcours && out == 0 )114 {115 if ( !strcasecmp(parcours->subroutine,subroutinename) )116 {117 out = 1 ;118 }119 else parcours=parcours->suiv;120 }121 }122 return out;123 }124 96 125 97 /******************************************************************************/ … … 135 107 int out; 136 108 137 out = 0 ; 138 if ( firstpass == 0 ) 109 out = 0 ; 110 if ( firstpass == 0 ) 139 111 { 140 parcours = AllocateList;112 parcours = List_Allocate_Var; 141 113 while ( parcours && out == 0 ) 142 114 { 143 if ( !strcasecmp(parcours-> nomvar,ident) ) out = 1 ;144 else parcours=parcours->suiv; 115 if ( !strcasecmp(parcours->a_nomvar,ident) ) out = 1 ; 116 else parcours=parcours->suiv; 145 117 } 146 118 } … … 158 130 int varisallocatable_0(char *ident) 159 131 { 160 listvar *newvar;161 132 listallocate *newvaralloc; 162 133 int out; … … 165 136 if (firstpass == 0 ) 166 137 { 167 newvar = globalvarofusefile; 168 while ( newvar && out == 0 ) 169 { 170 if ( !strcasecmp(ident,newvar->var->nomvar) && 171 newvar->var->allocatable == 1 ) out = 1; 172 else newvar = newvar->suiv; 173 } 174 if ( out == 0 ) 175 { 176 newvar = globliste; 177 while ( newvar && out == 0 ) 138 newvaralloc = List_Allocate_Var; 139 while ( newvaralloc && out == 0 ) 178 140 { 179 if ( !strcasecmp(ident,newvar->var->nomvar) && 180 newvar->var->allocatable == 1 ) out = 1; 181 else newvar = newvar->suiv; 182 } 183 } 184 if ( out == 0 ) 185 { 186 newvaralloc = AllocateList; 187 while ( newvar && out == 0 ) 188 { 189 if ( !strcasecmp(ident,newvaralloc->nomvar) && 190 !strcasecmp(newvaralloc->subroutine,subroutinename) 191 ) out = 1; 141 if ( !strcasecmp(ident,newvaralloc->a_nomvar) ) out = 1; 192 142 else newvaralloc = newvaralloc->suiv; 193 } 194 } 143 } 195 144 } 196 145 return out;
Note: See TracChangeset
for help on using the changeset viewer.