Clan  0.8.1
relation_list.c
Go to the documentation of this file.
1 
2  /*+------- <| --------------------------------------------------------**
3  ** A Clan **
4  **--- /.\ -----------------------------------------------------**
5  ** <| [""M# relation_list.c **
6  **- A | # -----------------------------------------------------**
7  ** /.\ [""M# First version: 16/04/2011 **
8  **- [""M# | # U"U#U -----------------------------------------------**
9  | # | # \ .:/
10  | # | #___| #
11  ****** | "--' .-" ******************************************************
12  * |"-"-"-"-"-#-#-## Clan : the Chunky Loop Analyzer (experimental) *
13  **** | # ## ###### *****************************************************
14  * \ .::::'/ *
15  * \ ::::'/ Copyright (C) 2008 University Paris-Sud 11 *
16  * :8a| # # ## *
17  * ::88a ### This is free software; you can redistribute it *
18  * ::::888a 8a ##::. and/or modify it under the terms of the GNU Lesser *
19  * ::::::::888a88a[]::: General Public License as published by the Free *
20  *::8:::::::::SUNDOGa8a::. Software Foundation, either version 2.1 of the *
21  *::::::::8::::888:Y8888:: License, or (at your option) any later version. *
22  *::::':::88::::888::Y88a::::::::::::... *
23  *::'::.. . ..... .. ... . *
24  * This software is distributed in the hope that it will be useful, but *
25  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
26  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27  * for more details. *
28  * *
29  * You should have received a copy of the GNU Lesser General Public License *
30  * along with software; if not, write to the Free Software Foundation, Inc., *
31  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
32  * *
33  * Clan, the Chunky Loop Analyzer *
34  * Written by Cedric Bastoul, Cedric.Bastoul@u-psud.fr *
35  * *
36  ******************************************************************************/
37 
38 
39 #include <stdlib.h>
40 #include <stdio.h>
41 #include <string.h>
42 #include <ctype.h>
43 
44 #include <osl/macros.h>
45 #include <osl/relation_list.h>
46 #include <clan/relation.h>
47 #include <clan/relation_list.h>
48 
49 
50 /*+****************************************************************************
51  * Processing functions *
52  ******************************************************************************/
53 
54 
65 void clan_relation_list_compact(osl_relation_list_p list, int nb_parameters) {
66  while (list != NULL) {
67  clan_relation_compact(list->elt, nb_parameters);
68  list = list->next;
69  }
70 }
71 
72 
80 void clan_relation_list_define_type(osl_relation_list_p list, int type) {
81  osl_relation_p relation;
82 
83  while (list != NULL) {
84  if (list->elt != NULL) {
85  relation = list->elt;
86  while (relation != NULL) {
87  if (relation->type == OSL_UNDEFINED)
88  relation->type = type;
89  relation = relation->next;
90  }
91  }
92  list = list->next;
93  }
94 }
95 
96 
103 int clan_relation_list_nb_elements(osl_relation_list_p list) {
104  int nb_elements = 0;
105 
106  while (list != NULL) {
107  nb_elements++;
108  list = list->next;
109  }
110  return nb_elements;
111 }
void clan_relation_list_compact(osl_relation_list_p list, int nb_parameters)
Definition: relation_list.c:65
void clan_relation_list_define_type(osl_relation_list_p list, int type)
Definition: relation_list.c:80
void clan_relation_compact(osl_relation_p relation, int nb_parameters)
Definition: relation.c:253
int clan_relation_list_nb_elements(osl_relation_list_p list)