Changeset 530 for trunk/AGRIF/LIB/dependfile.c
- Timestamp:
- 2006-10-17T17:36:11+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/dependfile.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> … … 331 349 { 332 350 /* */ 333 if ( strcmp(curname,"") &&334 !strc mp(curname,parcours->var->nomvar) ) out = 1 ;335 if ( !strc mp(curname,"") ) strcpy(curname,parcours->var->nomvar);351 if ( strcasecmp(curname,"") && 352 !strcasecmp(curname,parcours->var->nomvar) ) out = 1 ; 353 if ( !strcasecmp(curname,"") ) strcpy(curname,parcours->var->nomvar); 336 354 /* */ 337 355 if ( out == 0 ) … … 415 433 416 434 /******************************************************************************/ 417 /* Recordtmplocallist */ 418 /******************************************************************************/ 419 /* This subroutine is used to read the .depend<name> if the */ 420 /* filetoparse has been read before */ 421 /* if it is the case we record the .depend<name> in the tmplocallist */ 422 /******************************************************************************/ 423 /* */ 424 /* .depend<name> --------> tmplocallist = list of var */ 425 /* */ 426 /* not.depend<name> --------> tmplocallist = NULL */ 427 /* */ 428 /******************************************************************************/ 429 void Recordtmplocallist( char *NameTampon) 430 { 431 FILE *dependfileoutput; 432 listvar *parcours; 433 listvar *parcoursprec; 434 char ligne[LONGNOM]; 435 char nothing[LONGNOM]; 436 437 parcoursprec = (listvar *)NULL; 438 sprintf(ligne,".depend%s",NameTampon); 439 if ((dependfileoutput = fopen(ligne,"r"))==NULL) 440 { 441 /* if the file doesn't exist it means that it is the first time */ 442 /* we tried to parse this file */ 443 } 444 else 445 { 446 /* if the file exist we should verify that this file has changed */ 447 while (!feof(dependfileoutput)) 448 { 449 parcours=(listvar *)malloc(sizeof(listvar)); 450 parcours->var=(variable *)malloc(sizeof(variable)); 451 fscanf(dependfileoutput,"%s\n",parcours->var->typevar); 452 fscanf(dependfileoutput,"%s\n",parcours->var->nomvar); 453 fscanf(dependfileoutput,"%s\n",parcours->var->dimchar); 454 if ( !strcasecmp(parcours->var->dimchar,"T") ) 455 { 456 strcpy(parcours->var->dimchar,""); 457 } 458 fscanf(dependfileoutput,"%s\n",parcours->var->commoninfile); 459 if ( !strcasecmp(parcours->var->commoninfile,"T") ) 460 { 461 strcpy(parcours->var->commoninfile,""); 462 } 463 fscanf(dependfileoutput,"%s\n",parcours->var->commonname); 464 if ( !strcasecmp(parcours->var->commonname,"T") ) 465 { 466 strcpy(parcours->var->commonname,""); 467 } 468 fscanf(dependfileoutput,"%d\n",&parcours->var->nbdim); 469 fscanf(dependfileoutput,"%d\n",&parcours->var->dimensiongiven); 470 fscanf(dependfileoutput,"%d\n",&parcours->var->typegiven); 471 fscanf(dependfileoutput,"%d\n",&parcours->var->allocatable); 472 fscanf(dependfileoutput,"%d\n",&parcours->var->pointerdeclare); 473 fscanf(dependfileoutput,"%[^\n] \n",parcours->var->precision); 474 if ( !strcasecmp(parcours->var->precision,"T") ) 475 { 476 strcpy(parcours->var->precision,""); 477 } 478 fscanf(dependfileoutput,"%[^\n] \n",parcours->var->initialvalue); 479 if ( !strcasecmp(parcours->var->initialvalue,"T") ) 480 { 481 strcpy(parcours->var->initialvalue,""); 482 } 483 fscanf(dependfileoutput,"%d\n",&parcours->var->indicetabvars); 484 fscanf(dependfileoutput,"%s\n",parcours->var->readedlistdimension); 485 if ( !strcasecmp(parcours->var->readedlistdimension,"T") ) 486 { 487 strcpy(parcours->var->readedlistdimension,""); 488 } 489 fscanf(dependfileoutput,"%s\n",nothing); 490 parcours->suiv = NULL; 491 if ( !tmplocallist ) 492 { 493 tmplocallist = parcours; 494 parcoursprec = parcours; 495 } 496 else 497 { 498 parcoursprec->suiv = parcours; 499 parcoursprec = parcours; 500 } 501 parcours = NULL; 502 } 503 fclose(dependfileoutput); 504 } 505 } 506 507 508 /******************************************************************************/ 509 /* Recordglobalvarofusefile */ 435 /* Readthedependfile */ 510 436 /******************************************************************************/ 511 437 /* This subroutine is used to read the .dependfile<name> and to insert new */ … … 518 444 /* */ 519 445 /******************************************************************************/ 520 listvar *Re cordglobalvarofusefile( char *NameTampon , listvar *listout)446 listvar *Readthedependfile( char *NameTampon , listvar *listout) 521 447 { 522 448 char ligne[LONGNOM];
Note: See TracChangeset
for help on using the changeset viewer.