WorkWithlistofcoupled.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. /******************************************************************************/
  40. /* variscoupled_0 */
  41. /******************************************************************************/
  42. /* Firstpass 0 */
  43. /******************************************************************************/
  44. /* */
  45. /******************************************************************************/
  46. int variscoupled_0(const char *ident)
  47. {
  48. listvarpointtovar *pointtmplist;
  49. listcouple *coupletmp;
  50. int out = 0;
  51. if (firstpass == 0 )
  52. {
  53. pointtmplist = List_CouplePointed_Var;
  54. while ( pointtmplist && out == 0)
  55. {
  56. coupletmp = pointtmplist->t_couple;
  57. while ( coupletmp && out == 0)
  58. {
  59. /* we should find the same variable name in the same subroutine */
  60. if ( !strcasecmp(ident, coupletmp->c_namevar) &&
  61. !strcasecmp(subroutinename, pointtmplist->t_cursubroutine) &&
  62. strcasecmp(coupletmp->c_namepointedvar, "") )
  63. {
  64. out = 1;
  65. }
  66. coupletmp = coupletmp->suiv;
  67. }
  68. pointtmplist = pointtmplist->suiv;
  69. }
  70. }
  71. return out;
  72. }
  73. const char * getcoupledname_0(const char *ident)
  74. {
  75. listvarpointtovar *pointtmplist;
  76. listcouple *coupletmp;
  77. int out = 0;
  78. if (firstpass == 0 )
  79. {
  80. pointtmplist = List_CouplePointed_Var;
  81. while ( pointtmplist && out == 0)
  82. {
  83. coupletmp = pointtmplist->t_couple;
  84. while ( coupletmp && out == 0)
  85. {
  86. /* we should find the same variable name in the same subroutine */
  87. if ( !strcasecmp(coupletmp->c_namevar,ident) &&
  88. !strcasecmp(pointtmplist->t_cursubroutine,subroutinename) &&
  89. strcasecmp(coupletmp->c_namepointedvar,"") )
  90. {
  91. return coupletmp->c_namepointedvar;
  92. }
  93. coupletmp = coupletmp->suiv;
  94. }
  95. pointtmplist = pointtmplist->suiv;
  96. }
  97. }
  98. printf("end of getcoupledname_0 -- you should not be there !!! \n");
  99. return NULL;
  100. }