PIPS
movement_main.c
Go to the documentation of this file.
1 /*
2 
3  $Id: movement_main.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 
28 #include <stdio.h>
29 #include <string.h>
30 #include <setjmp.h>
31 
32 #include "genC.h" /* chunk is defined there, chunk was used by ri.h */
33 #include "linear.h"
34 #include "ri.h" /* used by ri-util.h */
35 #include "complexity_ri.h" /* useful, because PPOLYNOME is defined there */
36 #include "resources.h" /* useful, because make is called directly by main */
37 #include "ri-util.h" /* useful, because polynome_gen_write is called */
38 #include "constants.h" /* useful, because DBR_ is called directly by main */
39 
41 
42 main(argc, argv)
43 int argc;
44 char *argv[];
45 {
46  entity mod;
47  char *program_name;
48  char *module_name;
49  char *entities_filename;
50  char *ppf_filename;
51  FILE *fd;
52  int i;
53  bool prettyprint_it = false;
54  statement s,stat;
55  cons *copy_in = NIL;
56  cons *copy_out=NIL;
57 text t;
58 
59 
60  /* get NewGen data type description */
61  gen_read_spec(ALL_SPECS, (char*) NULL);
68 
69 
70  module_name = argv[2];
71 
72  fprintf(stderr, "----------------------in main-----------------------\n");
73 
74  db_open_workspace(argv[1]);
75  if(setjmp(pips_top_level)) {
76  /* case you come back from a user_error */
78  exit(1);
79  }
80  else {
81  db_open_module(module_name);
82 
83  make(DBR_CODE, module_name);
84 
85  s = (statement) db_get_memory_resource(DBR_CODE, module_name, false);
86 
88  search_array_from_statement2(module_name,s,&copy_in,&copy_out);
89 
90 
92  user_log("I have done this: ...\n");
93  }
95  fprintf(stderr, "----------------------out of main-----------------------\n");
96 }
void user_log(const char *format,...)
Definition: message.c:234
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
void gen_init_external(int which, void *(*read)(FILE *, int(*)(void)), void(*write)(FILE *, void *), void(*free)(void *), void *(*copy)(void *), int(*allocated_memory)(void *))
GEN_INIT_EXTERNAL defines entry points for free, read and write functions of external types.
Definition: genClib.c:2276
void gen_read_spec(char *spec,...)
Definition: genClib.c:2218
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define exit(code)
Definition: misc-local.h:54
main(int argc, argv)
Definition: movement_main.c:42
jmp_buf pips_top_level
chunk is defined there, chunk was used by ri.h
Definition: movement_main.c:40
Pvecteur vect_gen_copy_tree(Pvecteur)
Definition: Pvecteur.c:163
void vect_gen_write(FILE *, Pvecteur)
Pvecteur.c.
Definition: Pvecteur.c:108
Pvecteur vect_gen_read(FILE *, int(*)(void))
void sc_gen_free(Psysteme)
Definition: Psc.c:198
void vect_gen_free(Pvecteur)
Definition: Pvecteur.c:158
void polynome_gen_free(Ppolynome)
Definition: Ppolynome.c:148
void polynome_gen_write(FILE *, Ppolynome)
Definition: Ppolynome.c:97
Ppolynome polynome_gen_read(FILE *, int(*)(void))
Ppolynome polynome_gen_copy_tree(Ppolynome)
Definition: Ppolynome.c:154
Psysteme sc_gen_copy_tree(Psysteme)
Definition: Psc.c:203
void sc_gen_write(FILE *, Psysteme)
Psc.c.
Definition: Psc.c:82
Psysteme sc_gen_read(FILE *, int(*)(void))
bool db_close_workspace(bool)
Definition: workspace.c:367
bool db_open_workspace(const char *)
Definition: workspace.c:380
static bool make(const char *rname, const char *oname)
Definition: pipsmake.c:893
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ALL_SPECS
Definition: specs.h:1
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
static void db_close_module(string what, string oname, bool do_free)
stores all resources of module oname.
Definition: workspace.c:318