Imported Upstream version 0.15.10
[platform/upstream/cloog-isl.git] / include / cloog / names.h
1
2    /**-------------------------------------------------------------------**
3     **                              CLooG                                **
4     **-------------------------------------------------------------------**
5     **                             names.h                               **
6     **-------------------------------------------------------------------**
7     **                  First version: august 1st 2002                   **
8     **-------------------------------------------------------------------**/
9
10
11 /******************************************************************************
12  *               CLooG : the Chunky Loop Generator (experimental)             *
13  ******************************************************************************
14  *                                                                            *
15  * Copyright (C) 2001-2005 Cedric Bastoul                                     *
16  *                                                                            *
17  * This is free software; you can redistribute it and/or modify it under the  *
18  * terms of the GNU General Public License as published by the Free Software  *
19  * Foundation; either version 2 of the License, or (at your option) any later *
20  * version.                                                                   *
21  *                                                                            *
22  * This software is distributed in the hope that it will be useful, but       *
23  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
24  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   *
25  * for more details.                                                          *
26  *                                                                            *
27  * You should have received a copy of the GNU General Public License along    *
28  * with software; if not, write to the Free Software Foundation, Inc.,        *
29  * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA                     *
30  *                                                                            *
31  * CLooG, the Chunky Loop Generator                                           *
32  * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                         *
33  *                                                                            *
34  ******************************************************************************/
35
36
37 #ifndef CLOOG_NAMES_H
38 #define CLOOG_NAMES_H
39 #if defined(__cplusplus)
40 extern "C" 
41   {
42 #endif 
43
44
45 # define MAX_NAME 50
46 # define FIRST_PARAMETER 'M'
47 # define FIRST_ITERATOR  'i'
48
49
50 /**
51  * CloogNames structure:
52  * this structure contains all the informations about parameter and iterator
53  * names (as strings).
54  */
55 struct cloognames
56 { int _nb_scalars ;         /**< Scalar dimension number. */
57   int _nb_scattering ;      /**< Scattering iterator number. */
58   int _nb_iterators ;       /**< Iterator number. */
59   int _nb_parameters ;      /**< Parameter number. */
60   char ** _scalars ;        /**< The scalar names     (an array of strings). */
61   char ** _scattering ;     /**< The scattering names (an array of strings). */
62   char ** _iterators ;      /**< The iterator names   (an array of strings). */
63   char ** _parameters ;     /**< The parameter names  (an array of strings). */
64   int _references;          /**< Number of references to this structure. */
65 } ;
66 typedef struct cloognames CloogNames ;
67
68
69 static inline int cloog_names_nb_scalars (CloogNames *n)
70 {
71   return n->_nb_scalars;
72 }
73
74 static inline void cloog_names_set_nb_scalars (CloogNames *n, int nb)
75 {
76   n->_nb_scalars = nb;
77 }
78
79 static inline int cloog_names_nb_scattering (CloogNames *n)
80 {
81   return n->_nb_scattering;
82 }
83
84 static inline void cloog_names_set_nb_scattering (CloogNames *n, int nb)
85 {
86   n->_nb_scattering = nb;
87 }
88
89 static inline int cloog_names_nb_iterators (CloogNames *n)
90 {
91   return n->_nb_iterators;
92 }
93
94 static inline void cloog_names_set_nb_iterators (CloogNames *n, int nb)
95 {
96   n->_nb_iterators = nb;
97 }
98
99 static inline int cloog_names_nb_parameters (CloogNames *n)
100 {
101   return n->_nb_parameters;
102 }
103
104 static inline void cloog_names_set_nb_parameters (CloogNames *n, int nb)
105 {
106   n->_nb_parameters = nb;
107 }
108
109 static inline char **cloog_names_scalars (CloogNames *n)
110 {
111   return n->_scalars;
112 }
113
114 static inline void cloog_names_set_scalars (CloogNames *n, char **s)
115 {
116   n->_scalars = s;
117 }
118
119 static inline char *cloog_names_scalar_elt (CloogNames *n, int i)
120 {
121   return n->_scalars[i];
122 }
123
124 static inline void cloog_names_set_scalar_elt (CloogNames *n, int i, char *s)
125 {
126   n->_scalars[i] = s;
127 }
128
129 static inline char **cloog_names_scattering (CloogNames *n)
130 {
131   return n->_scattering;
132 }
133
134 static inline void cloog_names_set_scattering (CloogNames *n, char **s)
135 {
136   n->_scattering = s;
137 }
138
139 static inline char *cloog_names_scattering_elt (CloogNames *n, int i)
140 {
141   return n->_scattering[i];
142 }
143
144 static inline void cloog_names_set_scattering_elt (CloogNames *n, int i, char *s)
145 {
146   n->_scattering[i] = s;
147 }
148
149 static inline char **cloog_names_iterators (CloogNames *n)
150 {
151   return n->_iterators;
152 }
153
154 static inline void cloog_names_set_iterators (CloogNames *n, char **s)
155 {
156   n->_iterators = s;
157 }
158
159 static inline char *cloog_names_iterator_elt (CloogNames *n, int i)
160 {
161   return n->_iterators[i];
162 }
163
164 static inline void cloog_names_set_iterator_elt (CloogNames *n, int i, char *s)
165 {
166   n->_iterators[i] = s;
167 }
168
169 static inline char **cloog_names_parameters (CloogNames *n)
170 {
171   return n->_parameters;
172 }
173
174 static inline void cloog_names_set_parameters (CloogNames *n, char **s)
175 {
176   n->_parameters = s;
177 }
178
179 static inline char *cloog_names_parameter_elt (CloogNames *n, int i)
180 {
181   return n->_parameters[i];
182 }
183
184 static inline void cloog_names_set_parameter_elt (CloogNames *n, int i, char *s)
185 {
186   n->_parameters[i] = s;
187 }
188
189
190 /******************************************************************************
191  *                          Structure display function                        *
192  ******************************************************************************/
193 void cloog_names_print_structure(FILE *, CloogNames *, int) ;
194 void cloog_names_print(FILE *, CloogNames *) ;
195
196
197 /******************************************************************************
198  *                         Memory deallocation function                       *
199  ******************************************************************************/
200 void cloog_names_free(CloogNames *) ;
201
202
203 /******************************************************************************
204  *                              Reading functions                             *
205  ******************************************************************************/
206 char ** cloog_names_read_strings(FILE *, int, char *, char) ;
207
208
209 /******************************************************************************
210  *                            Processing functions                            *
211  ******************************************************************************/
212 CloogNames * cloog_names_malloc(void);
213 CloogNames * cloog_names_copy(CloogNames *names);
214 CloogNames * cloog_names_alloc(int,int,int,int,char **,char **,char **,char **);
215 char ** cloog_names_generate_items(int, char *, char) ;
216 CloogNames * cloog_names_generate(int, int, int, int, char, char, char, char) ;
217 void cloog_names_scalarize(CloogNames *, int, int *) ;
218
219 #if defined(__cplusplus)
220   }
221 #endif 
222 #endif /* define _H */