PIPS
sc_add_variable.c
Go to the documentation of this file.
1 /*
2 
3  $Id: sc_add_variable.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS 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 General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27  /* Package MOVEMENTS
28  *
29  * Corinne Ancourt - juin 1990
30  */
31 
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36 
37 #include "genC.h"
38 #include "linear.h"
39 #include "ri.h"
40 #include "ri-util.h"
41 #include "constants.h"
42 
43 
44 
45 /* This function adds a new variable to the system of constraints ps.
46 */
47 
50 Psysteme ps;
51 {
52  static char name[ 64 ];
53  string name1;
54  int d;
55  entity ent1;
56  string full_name;
57  d = ps->dimension++;
58  name[0] = 'X';
59  (void) sprintf(&name[1],"%d",d);
60  name1 = strdup(name);
61 
64  name1,
65  NULL));
68  free(full_name);
69  }
70  ps->base = vect_add_variable (ps->base,(char *)ent1);
71 
72  return((char *) ent1);
73 
74 }
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Definition: base.c:61
void free(void *)
#define full_name(dir, name)
Definition: compile.c:414
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
static char * module
Definition: pips.c:74
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
entity make_scalar_integer_entity(const char *, const char *)
Create an integer variable of name "name" in module of name "module_name".
Definition: variable.c:1068
#define entity_undefined
Definition: ri.h:2761
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
Variable sc_add_new_variable_name(entity module, Psysteme ps)
Package MOVEMENTS.
char * strdup()
Pbase base
Definition: sc-local.h:75
int dimension
Definition: sc-local.h:74
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60