WorkWithlistmoduleinfile.c 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /******************************************************************************/
  2. /* */
  3. /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */
  4. /* */
  5. /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */
  6. /* Cyril Mazauric (Cyril_Mazauric@yahoo.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". */
  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.7 */
  34. /******************************************************************************/
  35. #include <stdio.h>
  36. #include <stdlib.h>
  37. #include <string.h>
  38. #include "decl.h"
  39. void Save_Length(const char *nom, int whichone)
  40. {
  41. size_t len_nom = strlen(nom);
  42. if ( whichone == 1 && len_nom > length_last )
  43. {
  44. length_last = len_nom;
  45. if ( length_last > LONG_M )
  46. printf("WARNING 1 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_last+100);
  47. }
  48. if ( whichone == 2 && len_nom > length_first )
  49. {
  50. length_first = len_nom;
  51. if ( length_first > LONG_M )
  52. printf("WARNING 2 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_first+100);
  53. }
  54. if ( whichone == 8 && len_nom > length_v_vallengspec )
  55. {
  56. length_v_vallengspec = len_nom;
  57. if ( length_v_vallengspec > LONG_M )
  58. printf("WARNING 8 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_vallengspec+100);
  59. }
  60. if ( whichone == 12 && len_nom > length_v_precision )
  61. {
  62. length_v_precision = len_nom;
  63. if ( length_v_precision > LONG_M )
  64. printf("WARNING 12 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_precision+100);
  65. }
  66. if ( whichone == 13 && len_nom > length_v_IntentSpec )
  67. {
  68. length_v_IntentSpec = len_nom;
  69. if ( length_v_IntentSpec > LONG_M )
  70. printf("WARNING 13 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_IntentSpec+100);
  71. }
  72. if ( whichone == 14 && len_nom > length_v_initialvalue )
  73. {
  74. length_v_initialvalue = len_nom;
  75. if ( length_v_initialvalue > LONG_M )
  76. printf("WARNING 14 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_initialvalue+100);
  77. }
  78. if ( whichone == 15 && len_nom > length_v_readedlistdimension )
  79. {
  80. length_v_readedlistdimension = len_nom;
  81. if ( length_v_readedlistdimension > LONG_M )
  82. printf("WARNING 15 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_readedlistdimension+100);
  83. }
  84. if ( whichone == 25 && len_nom > length_a_nomvar )
  85. {
  86. length_a_nomvar = len_nom;
  87. if ( length_a_nomvar > LONG_C )
  88. printf("WARNING 25 : The value of LONG_C (defined in decl.h) should be upgrated to %lu\n", length_a_nomvar+100);
  89. }
  90. if ( whichone == 39 && len_nom > length_toprintglob )
  91. {
  92. length_toprintglob = len_nom;
  93. if ( length_toprintglob > LONG_M )
  94. printf("WARNING 39 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprintglob+100);
  95. }
  96. if ( whichone == 40 && len_nom > length_tmpvargridname )
  97. {
  98. length_tmpvargridname = len_nom;
  99. if ( length_tmpvargridname > LONG_M )
  100. printf("WARNING 40 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_tmpvargridname+100);
  101. }
  102. if ( whichone == 41 && len_nom > length_ligne_Subloop )
  103. {
  104. length_ligne_Subloop = len_nom;
  105. if ( length_ligne_Subloop > LONG_M )
  106. printf("WARNING 41 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n",length_ligne_Subloop+100);
  107. }
  108. if ( whichone == 43 && len_nom > length_toprint_utilagrif )
  109. {
  110. length_toprint_utilagrif = len_nom;
  111. if ( length_toprint_utilagrif > LONG_M )
  112. printf("WARNING 43 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprint_utilagrif+100);
  113. }
  114. if ( whichone == 44 && len_nom > length_toprinttmp_utilchar )
  115. {
  116. length_toprinttmp_utilchar = len_nom;
  117. if ( length_toprinttmp_utilchar > LONG_M)
  118. printf("WARNING 44 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprinttmp_utilchar+100);
  119. }
  120. if ( whichone == 45 && len_nom > length_ligne_writedecl )
  121. {
  122. length_ligne_writedecl = len_nom;
  123. if ( length_ligne_writedecl > LONG_M )
  124. printf("WARNING 45 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_ligne_writedecl+100);
  125. }
  126. if ( whichone == 46 && len_nom > length_newname_toamr )
  127. {
  128. length_newname_toamr = len_nom;
  129. if ( length_newname_toamr > LONG_C )
  130. printf("WARNING 46 : The value of LONG_C (defined in decl.h) should be upgrated to %lu\n", length_newname_toamr+100);
  131. }
  132. if ( whichone == 47 && len_nom > length_newname_writedecl )
  133. {
  134. length_newname_writedecl = len_nom;
  135. if ( length_newname_writedecl > LONG_M )
  136. printf("WARNING 47 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_newname_writedecl +100);
  137. }
  138. if ( whichone == 48 && len_nom > length_ligne_toamr )
  139. {
  140. length_ligne_toamr = len_nom;
  141. if ( length_ligne_toamr > LONG_M )
  142. printf("WARNING 48 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_ligne_toamr +100);
  143. }
  144. if ( whichone == 49 && len_nom > length_tmpligne_writedecl )
  145. {
  146. length_tmpligne_writedecl = len_nom;
  147. if ( length_tmpligne_writedecl > LONG_M )
  148. printf("WARNING 49 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_tmpligne_writedecl+100);
  149. }
  150. }
  151. void Save_Length_int(int val, int whichone)
  152. {
  153. if ( whichone == 1 && val > value_char_size ) value_char_size = val;
  154. if ( whichone == 2 && val > value_char_size1 ) value_char_size1 = val;
  155. if ( whichone == 3 && val > value_char_size2 ) value_char_size2 = val;
  156. if ( whichone == 4 && val > value_char_size3 ) value_char_size3 = val;
  157. }