Changeset 530 for trunk/AGRIF/LIB/DiversListe.c
- Timestamp:
- 2006-10-17T17:36:11+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/DiversListe.c
r396 r530 3 3 /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ 4 4 /* */ 5 /* Copyright (C) 2005 Laurent Debreu (Laurent.Debreu@imag.fr)*/5 /* Copyright or © or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ 6 6 /* Cyril Mazauric (Cyril.Mazauric@imag.fr) */ 7 /* */ 8 /* This program is free software; you can redistribute it and/or modify */ 9 /* it */ 10 /* */ 11 /* This program is distributed in the hope that it will be useful, */ 12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 /* GNU General Public License for more details. */ 15 /* */ 7 /* This software is governed by the CeCILL-C license under French law and */ 8 /* abiding by the rules of distribution of free software. You can use, */ 9 /* modify and/ or redistribute the software under the terms of the CeCILL-C */ 10 /* license as circulated by CEA, CNRS and INRIA at the following URL */ 11 /* "http://www.cecill.info". */ 12 /* */ 13 /* As a counterpart to the access to the source code and rights to copy, */ 14 /* modify and redistribute granted by the license, users are provided only */ 15 /* with a limited warranty and the software's author, the holder of the */ 16 /* economic rights, and the successive licensors have only limited */ 17 /* liability. */ 18 /* */ 19 /* In this respect, the user's attention is drawn to the risks associated */ 20 /* with loading, using, modifying and/or developing or reproducing the */ 21 /* software by the user in light of its specific status of free software, */ 22 /* that may mean that it is complicated to manipulate, and that also */ 23 /* therefore means that it is reserved for developers and experienced */ 24 /* professionals having in-depth computer knowledge. Users are therefore */ 25 /* encouraged to load and test the software's suitability as regards their */ 26 /* requirements in conditions enabling the security of their systems and/or */ 27 /* data to be ensured and, more generally, to use and operate it in the */ 28 /* same conditions as regards security. */ 29 /* */ 30 /* The fact that you are presently reading this means that you have had */ 31 /* knowledge of the CeCILL-C license and that you accept its terms. */ 32 /******************************************************************************/ 33 /* version 1.0 */ 16 34 /******************************************************************************/ 17 35 #include <stdio.h> … … 21 39 22 40 /******************************************************************************/ 23 /* COM_1_AddCommonvartolist*/41 /* Addtolistvarcommon */ 24 42 /******************************************************************************/ 25 43 /* This subroutines is used to add the variable defined in common in the */ … … 28 46 /* */ 29 47 /******************************************************************************/ 30 void COM_1_AddCommonvartolist()48 void Addtolistvarcommon() 31 49 { 32 50 listvarcommon *newvar; … … 37 55 strcpy(newvar->subroutinename,subroutinename); 38 56 newvar->positioninblock= positioninblock; 39 40 57 newvar->suiv = NULL; 41 58 … … 52 69 53 70 /******************************************************************************/ 54 /* Addtolistnom*/71 /* Addtolistnom */ 55 72 /******************************************************************************/ 56 73 /* This subroutine is used to add a variable to the list */ … … 64 81 int out; 65 82 66 if ( !listin ) 67 { 68 newnom=(listnom *) malloc (sizeof (listnom)); 69 strcpy(newnom->nom,nom); 70 newnom->suiv = NULL; 71 listin = newnom; 72 } 83 newnom=(listnom *) malloc (sizeof (listnom)); 84 strcpy(newnom->nom,nom); 85 newnom->suiv = NULL; 86 87 if ( !listin ) listin = newnom; 73 88 else 74 89 { … … 82 97 if ( out == 0 ) 83 98 { 84 newnom=(listnom *) malloc (sizeof (listnom));85 strcpy(newnom->nom,nom);86 99 newnom->suiv = listin; 87 100 listin = newnom; 88 101 } 102 else 103 { 104 free(newnom); 105 } 89 106 } 90 107 return listin; … … 92 109 93 110 /******************************************************************************/ 94 /* Add _listname */111 /* Addtolistname */ 95 112 /******************************************************************************/ 96 113 /* This subroutine is used to add a variable to the list */ … … 104 121 /* */ 105 122 /******************************************************************************/ 106 listname *Add _listname(char *nom,listname *input)123 listname *Addtolistname(char *nom,listname *input) 107 124 { 108 125 listname *newnom; … … 135 152 } 136 153 return input; 137 }138 139 /******************************************************************************/140 /* Add_ModuleTo_listofmodules */141 /******************************************************************************/142 /* This subroutine is used to add a variable to the list */143 /******************************************************************************/144 /* _______ _______ _______ _______ _______ */145 /* + + + + + + + + + + */146 /* + NEW +--->+ glob +--->+ glob +--->+ glob +--->+ glob + */147 /* +______+ +______+ +______+ +______+ +______+ */148 /* */149 /* */150 /* */151 /******************************************************************************/152 void Add_ModuleTo_listofmodules(char *nom)153 {154 listnom *newnom;155 156 newnom=(listnom *) malloc (sizeof (listnom));157 strcpy(newnom->nom,nom);158 newnom->suiv = listofmodules;159 listofmodules = newnom;160 154 } 161 155 … … 187 181 188 182 /******************************************************************************/ 189 /* AddNameToListNamelist*/183 /* AddNameToListNamelist_1 */ 190 184 /******************************************************************************/ 191 185 /* This subroutine is used to add a listvar l at the end of a listvar */ … … 199 193 /* */ 200 194 /******************************************************************************/ 201 void AddNameToListNamelist (char * name)195 void AddNameToListNamelist_1(char * name) 202 196 { 203 197 listnamelist *newvar; 204 205 if ( strcasecmp(name,"") ) 206 { 207 newvar =(listnamelist*)malloc(sizeof(listnamelist)); 208 strcpy(newvar->name,name); 209 newvar->suiv = listenamelist; 210 listenamelist = newvar; 198 199 if ( firstpass == 1 ) 200 { 201 if ( strcasecmp(name,"") ) 202 { 203 newvar =(listnamelist*)malloc(sizeof(listnamelist)); 204 strcpy(newvar->name,name); 205 newvar->suiv = listenamelist; 206 listenamelist = newvar; 207 } 211 208 } 212 209 } … … 263 260 264 261 /******************************************************************************/ 265 /* Add_ModuleTo_Modulelist*/262 /* Add_ModuleTo_Modulelist_1 */ 266 263 /******************************************************************************/ 267 264 /* This subroutine is used to add a variable to the list */ … … 275 272 /* */ 276 273 /******************************************************************************/ 277 void Add_ModuleTo_Modulelist (char *nom)274 void Add_ModuleTo_Modulelist_1(char *nom) 278 275 { 279 276 listnom *newnom; 280 277 281 newnom=(listnom *) malloc (sizeof (listnom)); 282 strcpy(newnom->nom,nom); 283 newnom->suiv = modulelist; 284 modulelist = newnom; 285 } 286 287 /******************************************************************************/ 288 /* OPTI_1_completelistvarpointtovar */ 278 if ( firstpass == 1 ) 279 { 280 newnom=(listnom *) malloc (sizeof (listnom)); 281 strcpy(newnom->nom,nom); 282 newnom->suiv = modulelist; 283 modulelist = newnom; 284 } 285 } 286 287 /******************************************************************************/ 288 /* completelistvarpointtovar_1 */ 289 289 /******************************************************************************/ 290 290 /* Firstpass 1 */ … … 293 293 /* */ 294 294 /******************************************************************************/ 295 void OPTI_1_completelistvarpointtovar(char *namemodule,listcouple *couple)295 void completelistvarpointtovar_1(char *namemodule,listcouple *couple) 296 296 { 297 297 listvarpointtovar *pointtmp; … … 318 318 319 319 /******************************************************************************/ 320 /* Addincludetothelist*/320 /* Addincludetothelist_1 */ 321 321 /******************************************************************************/ 322 322 /* This subroutine is used to add a record to a list of struct */ … … 333 333 /* */ 334 334 /******************************************************************************/ 335 void Addincludetothelist (char *name)335 void Addincludetothelist_1(char *name) 336 336 { 337 337 listusemodule *newinclude; 338 338 339 if ( firstpass == 1 ) 340 { 339 341 newinclude =(listusemodule *)malloc(sizeof(listusemodule)); 340 342 strcpy(newinclude->usemodule,name); … … 350 352 newinclude->suiv = listofincludebysubroutine; 351 353 listofincludebysubroutine = newinclude; 354 } 352 355 } 353 356 }
Note: See TracChangeset
for help on using the changeset viewer.