2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: august 1st 2002 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
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 *
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 *
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 *
31 * CLooG, the Chunky Loop Generator *
32 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 ******************************************************************************/
39 #if defined(__cplusplus)
46 # define FIRST_PARAMETER 'M'
47 # define FIRST_ITERATOR 'i'
51 * CloogNames structure:
52 * this structure contains all the informations about parameter and iterator
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. */
66 typedef struct cloognames CloogNames
;
69 static inline int cloog_names_nb_scalars (CloogNames
*n
)
71 return n
->_nb_scalars
;
74 static inline void cloog_names_set_nb_scalars (CloogNames
*n
, int nb
)
79 static inline int cloog_names_nb_scattering (CloogNames
*n
)
81 return n
->_nb_scattering
;
84 static inline void cloog_names_set_nb_scattering (CloogNames
*n
, int nb
)
86 n
->_nb_scattering
= nb
;
89 static inline int cloog_names_nb_iterators (CloogNames
*n
)
91 return n
->_nb_iterators
;
94 static inline void cloog_names_set_nb_iterators (CloogNames
*n
, int nb
)
96 n
->_nb_iterators
= nb
;
99 static inline int cloog_names_nb_parameters (CloogNames
*n
)
101 return n
->_nb_parameters
;
104 static inline void cloog_names_set_nb_parameters (CloogNames
*n
, int nb
)
106 n
->_nb_parameters
= nb
;
109 static inline char **cloog_names_scattering (CloogNames
*n
)
111 return n
->_scattering
;
114 static inline void cloog_names_set_scattering (CloogNames
*n
, char **s
)
119 static inline char *cloog_names_scattering_elt (CloogNames
*n
, int i
)
121 return n
->_scattering
[i
];
124 static inline void cloog_names_set_scattering_elt (CloogNames
*n
, int i
, char *s
)
126 n
->_scattering
[i
] = s
;
130 /******************************************************************************
131 * Structure display function *
132 ******************************************************************************/
133 void cloog_names_print_structure(FILE *, CloogNames
*, int) ;
134 void cloog_names_print(FILE *, CloogNames
*) ;
137 /******************************************************************************
138 * Memory deallocation function *
139 ******************************************************************************/
140 void cloog_names_free(CloogNames
*) ;
143 /******************************************************************************
144 * Reading functions *
145 ******************************************************************************/
146 char ** cloog_names_read_strings(FILE *, int, char *, char) ;
149 /******************************************************************************
150 * Processing functions *
151 ******************************************************************************/
152 CloogNames
* cloog_names_malloc(void);
153 CloogNames
* cloog_names_copy(CloogNames
*names
);
154 CloogNames
* cloog_names_alloc(int,int,int,int,char **,char **,char **,char **);
155 char ** cloog_names_generate_items(int, char *, char) ;
156 CloogNames
* cloog_names_generate(int, int, int, int, char, char, char, char) ;
157 void cloog_names_scalarize(CloogNames
*, int, int *) ;
159 #if defined(__cplusplus)
162 #endif /* define _H */