PIPS
plsommet-op.c
Go to the documentation of this file.
1 /*
2 
3  $Id: plsommet-op.c 1641 2016-03-02 08:20:19Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of Linear/C3 Library.
8 
9  Linear/C3 Library is free software: you can redistribute it and/or modify it
10  under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  Linear/C3 Library is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with Linear/C3 Library. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 
25  /* package plint */
26 
27 #ifdef HAVE_CONFIG_H
28  #include "config.h"
29 #endif
30 
31 #include <stdio.h>
32 #include <stdlib.h>
33 
34 #include "boolean.h"
35 #include "arithmetique.h"
36 #include "vecteur.h"
37 #include "contrainte.h"
38 #include "sc.h"
39 
40 #include "sommet.h"
41 
42 #define MALLOC(s,t,f) malloc(s)
43 #define FREE(s,t,f) free(s)
44 
45 /* Psommet sommets_dupc(Psommet som):
46  * copie d'une liste de sommets tout en respectant le meme ordre
47  */
49 Psommet som;
50 {
51 
52  Psommet som1,som2;
53  /* pointeur vers le dernier element de la liste*/
54  Psommet pred;
55  /* pointeur vers le premier element de la liste*/
56  Psommet debut = NULL;
57 
58 
59 #ifdef TRACE
60  printf(" ***** duplication du systeme \n");
61 #endif
62  if (som)
63  {
64  som2 = sommet_dup(som);
65  debut = som2;
66  som2->eq_sat = (int *)MALLOC(sizeof(int),INTEGER,"sommets_dupc");
67  *(som2->eq_sat) = *(som->eq_sat);
68  pred = som2;
69  for (som1 = som->succ; som1 != NULL; som1 = som1->succ)
70  {
71 
72  som2 = sommet_dup(som1);
73  pred->succ = som2;
74  som2->eq_sat =(int *)MALLOC(sizeof(int),INTEGER,
75  "sommets_dupc");
76  *(som2->eq_sat) = *(som1->eq_sat);
77  pred = som2;
78  }
79  }
80  return (debut);
81 }
#define MALLOC(s, t, f)
package plint
Definition: plsommet-op.c:42
Psommet sommets_dupc(Psommet som)
Psommet sommets_dupc(Psommet som): copie d'une liste de sommets tout en respectant le meme ordre.
Definition: plsommet-op.c:48
int printf()
Psommet sommet_dup(Psommet s_in)
Psommet sommet_dup(Psommet s_in): allocation et copie de la valeur d'un sommet.
Definition: sommet.c:82
structure de donnees Sommet
Definition: sommet-local.h:64
struct typ_som * succ
Definition: sommet-local.h:68
int * eq_sat
Definition: sommet-local.h:65