25 #include "pips_config.h"
43 typedef char * (* READER)(FILE *);
44 typedef void (*
WRITER)(FILE *,
void *);
45 typedef void (*
FREER) (
void *);
57 #define no_read (READER) abort
58 #define no_write (WRITER) abort
73 #if defined(__GNUC__) && __GNUC__ >= 8
74 #pragma GCC diagnostic push
75 #pragma GCC diagnostic ignored "-Wcast-function-type"
82 #if defined(__GNUC__) && __GNUC__ >= 8
83 #pragma GCC diagnostic pop
146 #define DEFAULT_OWNER_NAME WORKSPACE_PROGRAM_SPACE
152 string dir_name, ws_dir_name;
160 (
"cannot create directory %s\n", dir_name);
180 pips_debug(8,
"file name for %s[%s] with suffix '%s' is '%s'\n",
181 rname, oname, suffix, result);
216 #include <sys/stat.h>
222 if (unlink(
full_name) && erroriffailed) {
244 }
else time = (
int)
buf.st_mtime;
279 pips_debug(7,
"saving resource %s[%s] (0x%p)\n", rname, oname, p);
299 pips_debug(7,
"loading resource %s[%s]\n", rname, oname);
316 pips_debug(7,
"freeing resource %s[%s] (%p)\n", rname, oname, p);
328 pips_debug(9,
"checking Newgen resource consistency %s[%s] (0x%p)\n",
335 pips_debug(9,
"checking Newgen resource consistency %s[%s] (0x%p): %s\n",
351 void * p,
bool do_free)
378 return name[0]!=
'.' && name[0]!=
'/';
#define error(fun, msg)
NewGen interface with C3 type Psysteme for PIPS project.
void const char const char const int
bool create_directory(char *name)
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
bool directory_exists_p(const char *name)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
#define full_name(dir, name)
bool dbll_database_managed_file_p(const char *name)
returns whether the file is managed within the database.
bool dbll_very_special_resource_p(const char *rname, const char *oname)
string db_build_file_resource_name(const char *rname, const char *oname, const char *suffix)
returns an allocated file name for a file resource.
int dbll_stat_local_file(const char *file_name, bool okifnotthere)
It is impportant that the workspace directory does not appear in the file name so as to allow workspa...
static void close_resource_file(FILE *file, const char *rname, const char *oname)
static char * current_builder
static void writeln_string(FILE *f, void *p)
void pipsdbm_write_statement_mapping(FILE *, statement_mapping)
Write a statement mapping.
void(* WRITER)(FILE *, void *)
static methods * get_methods(const char *name)
gcc version
void free_static_control_mapping(statement_mapping)
Modification Dec 11 1995: ne pas utiliser free_static_control car il libere des champs qui appartienn...
bool displayable_file_p(const char *name)
rather approximated.
string db_get_current_builder_name(void)
#define DEFAULT_OWNER_NAME
void pipsdbm_free_statement_mapping(statement_mapping)
void dbll_free_resource(const char *rname, const char *oname, void *p)
int dbll_number_of_resources(void)
hash_table pipsdbm_read_statement_mapping(FILE *)
Read a statement mapping.
void db_reset_current_builder_name(void)
static FILE * open_resource_file(const char *rname, const char *oname, const char *what)
int dbll_stat_resource_file(const char *rname, const char *oname, bool okifnotthere)
void dbll_save_resource(const char *rname, const char *oname, void *p)
save rname of oname p.
void dbll_unlink_resource_file(const char *rname, const char *oname, bool erroriffailed)
string get_resource_file_name(const char *rname, const char *oname)
allocate a full file name for the given resource.
static methods all_methods[]
sigh...
void db_set_current_builder_name(const char *name)
bool dbll_check_resource(const char *rname, const char *oname, void *p)
Internal consistency of the resource, not the global consistency wrt other resources and pipsmake rul...
bool dbll_storable_p(const char *rname)
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
static void unexpected(void)
string dbll_get_ith_resource_name(int i)
static int dbll_stat_file(const char *file_name, bool okifnotthere)
returns 0 on errors (say no file).
void * dbll_load_resource(const char *rname, const char *oname)
bool pipsdbm_check_statement_mapping(statement_mapping)
a little bit partial, because domain are not checked.
static void no_free(void *p)
void dbll_save_and_free_resource(const char *rname, const char *oname, void *p, bool do_free)
const char * dbll_current_module
the current module is expected by some load/save functions...
#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 pips_user_irrecoverable_error
string find_suffix(const string, const string)
Find if a string s end with a suffix.
string bool_to_string(bool)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_table_undefined_p(h)
#define hash_table_undefined
Value of an undefined hash_table.
#define same_string_p(s1, s2)
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
string db_get_current_workspace_directory(void)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...