Changeset 530 for trunk/AGRIF/LIB/WriteInFile.c
- Timestamp:
- 2006-10-17T17:36:11+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/WriteInFile.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 /* 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". */ 7 12 /* */ 8 /* This program is free software; you can redistribute it and/or modify */ 9 /* it */ 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. */ 10 18 /* */ 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. */ 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. */ 15 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> … … 24 42 /******************************************************************************/ 25 43 /* This subroutine is used to write the string s into the fileout */ 26 /******************************************************************************/27 /* */28 /* */29 /* */30 44 /******************************************************************************/ 31 45 void tofich_reste (FILE * filout, char *s,int returnlineornot) … … 54 68 if ( !tmp || strlen(tmp) == 60 ) tmp = strrchr(temp, '*'); 55 69 if ( !tmp || strlen(tmp) == 60 ) tmp = strrchr(temp, '%'); 70 if ( !tmp || strlen(tmp) == 60 ) tmp = strrchr(temp, ','); 56 71 if ( !tmp || strlen(tmp) == 60 ) tmp = strrchr(temp, ':'); 57 72 if ( !tmp || strlen(tmp) == 60 ) tmp = strrchr(temp, ')'); … … 79 94 /* This subroutine is used to write the string s into the fileout */ 80 95 /******************************************************************************/ 81 /* */82 /* */83 /* */84 /******************************************************************************/85 96 void tofich (FILE * filout, char *s, int returnlineornot) 86 97 { … … 107 118 if ( !tmp || strlen(tmp) == strlen(temp) ) tmp = strrchr(temp, '*'); 108 119 if ( !tmp || strlen(tmp) == strlen(temp) ) tmp = strrchr(temp, '%'); 120 if ( !tmp || strlen(tmp) == strlen(temp) ) tmp = strrchr(temp, ','); 109 121 if ( !tmp || strlen(tmp) == strlen(temp) ) tmp = strrchr(temp, ':'); 110 122 if ( !tmp || strlen(tmp) == strlen(temp) ) tmp = strrchr(temp, ')'); … … 132 144 /* This subroutine is used to write size blank into the fileout */ 133 145 /******************************************************************************/ 134 /* */135 /* */136 /* */137 /******************************************************************************/138 146 void tofich_blanc (FILE * filout, int size) 139 147 { … … 158 166 159 167 /******************************************************************************/ 160 /* RemoveWord*/168 /* RemoveWordSET_0 */ 161 169 /******************************************************************************/ 162 170 /* This subroutine is used to remove a sentence in the file filout */ 163 171 /******************************************************************************/ 164 /* */ 165 /* */ 166 /* */ 167 /******************************************************************************/ 168 void RemoveWordSET(FILE * filout, long int position, long int sizetoremove) 172 void RemoveWordSET_0(FILE * filout, long int position, long int sizetoremove) 169 173 { 170 fseek(filout,position,SEEK_SET); 171 tofich_blanc(filout,sizetoremove); 174 if ( firstpass == 0 ) 175 { 176 fseek(filout,position,SEEK_SET); 177 tofich_blanc(filout,sizetoremove); 178 } 172 179 } 173 180 174 181 175 182 /******************************************************************************/ 176 /* RemoveWord 183 /* RemoveWordCUR_0 */ 177 184 /******************************************************************************/ 178 185 /* This subroutine is used to remove a sentence in the file filout */ 179 186 /******************************************************************************/ 180 /* */ 181 /* */ 182 /* */ 183 /******************************************************************************/ 184 void RemoveWordCUR(FILE * filout, long int position, long int sizetoremove) 187 void RemoveWordCUR_0(FILE * filout, long int position, long int sizetoremove) 185 188 { 186 fseek(filout,position,SEEK_CUR); 187 tofich_blanc(filout,sizetoremove); 189 if ( firstpass == 0 ) 190 { 191 fseek(filout,position,SEEK_CUR); 192 tofich_blanc(filout,sizetoremove); 193 } 188 194 }
Note: See TracChangeset
for help on using the changeset viewer.