25 #include "pips_config.h"
43 #define WORKSPACE_NAME_CHARS \
44 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
88 #define MD_DATABASE "database"
132 #define METADATA "Metadata"
134 #define DATABASE_STATUS "STATUS"
135 #define DATABASE_SYMBOLS "SYMBOLS"
136 #define DATABASE_MISC "MISC"
137 #define DATABASE_NEWGEN "NEWGEN"
148 free(dir_name);
return res;
195 pips_debug(2,
"saving newgen type translation data\n");
205 #define ONERROR(cond, what) \
206 if (cond) { what; return false; }
218 pips_debug(2,
"loading newgen type translation data\n");
226 pips_debug(2,
"loading database misc data\n");
230 ONERROR(fscanf(file,
"%d\n", &time)!=1,
290 pips_debug(1,
"workspace %s in directory %s\n", name, dir_name);
324 user_log(
" %s module %s.\n", what, oname);
337 user_log(
"%s all modules.\n", what);
385 pips_debug(1,
"Opening workspace %s\n", name);
void user_log(const char *format,...)
void read_tabulated_db_symbol(FILE *f)
void write_tabulated_db_symbol(FILE *f)
void dump_all_db_resource_status(FILE *file, string where)
bool db_resource_p(const char *rname, const char *oname)
true if exists and in loaded or stored state.
void db_save_pips_database(FILE *fd)
bool db_open_pips_database(FILE *fd)
void db_create_pips_database(void)
exported interface is minimal.
void db_reset_pips_database_if_necessary(void)
void db_save_and_free_memory_resource_if_any(const char *rname, const char *oname, bool do_free)
void db_close_pips_database(void)
void gen_array_full_free(gen_array_t a)
bool create_directory(char *name)
FILE * safe_fopen(const char *filename, const char *what)
bool file_exists_p(const char *name)
int safe_fclose(FILE *stream, const char *filename)
bool file_readable_p(char *name)
bool directory_exists_p(const char *name)
char * safe_readline(FILE *file)
returns the allocated line read, whatever its length.
FILE * check_fopen(const char *file, const char *mode)
file.c
bool purge_directory(char *name)
void gen_type_translation_write(string filename)
int gen_free_tabulated(int domain)
free tabulated elements of this domain.
void gen_type_translation_read(string filename)
set current type translation table according to file
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
gen_array_t db_get_module_list(void)
Get an array of all the modules (functions, procedures and compilation units) of a workspace.
#define full_name(dir, name)
int dbll_number_of_resources(void)
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
string dbll_get_ith_resource_name(int i)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define GEN_ARRAY_FOREACH(type, s, array)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
#define PIPSDBM_DEBUG_LEVEL
#define db_symbol_domain
newgen_db_status_domain_defined
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
bool db_close_workspace(bool is_quit)
static void db_reset_logical_time(void)
bool db_open_workspace(const char *name)
static bool load_meta_data(void)
load metadata from workspace.
int db_inc_logical_time(void)
0 means not set...
static void db_reset_current_workspace_name(void)
bool workspace_exists_p(const char *name)
static void reset_meta_data(void)
reset all meta data on failures.
static bool save_meta_data(bool do_free)
save (and maybe free) metadata.
static void db_set_current_workspace_name(const char *name)
static void db_close_module(string what, string oname, bool do_free)
stores all resources of module oname.
int db_get_logical_time(void)
string db_get_current_workspace_directory(void)
static void db_save_workspace(string what, bool do_free)
string db_get_meta_data_directory()
The syntax of a property list.
bool workspace_name_p(const char *name)
workspace.c
void db_checkpoint_workspace(void)
static string current_workspace_name
the workspace has a name.
static void db_set_logical_time(int time)
bool workspace_ok_p(const char *name)
#define ONERROR(cond, what)
static void db_reset_current_workspace_name_if_necessary(void)
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...
#define WORKSPACE_NAME_CHARS
the workspace name must be composed of the following characters.
string db_get_workspace_directory_name(const char *name)
returns an allocated string.
static string meta_data_db_file_name(string data)
bool db_create_workspace(const char *name)