PIPS
|
Go to the source code of this file.
Macros | |
#define | WORKSPACE_NAME_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" |
the workspace name must be composed of the following characters. More... | |
#define | MD_DATABASE "database" |
#define | METADATA "Metadata" |
#define | DATABASE_STATUS "STATUS" |
#define | DATABASE_SYMBOLS "SYMBOLS" |
#define | DATABASE_MISC "MISC" |
#define | DATABASE_NEWGEN "NEWGEN" /**newgen type translation data... */ |
#define | ONERROR(cond, what) if (cond) { what; return false; } |
Functions | |
bool | workspace_name_p (const char *name) |
workspace.c More... | |
static void | db_set_current_workspace_name (const char *name) |
static void | db_reset_current_workspace_name (void) |
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... More... | |
string | db_get_workspace_directory_name (const char *name) |
returns an allocated string. More... | |
string | db_get_current_workspace_directory (void) |
int | db_inc_logical_time (void) |
0 means not set... More... | |
int | db_get_logical_time (void) |
static void | db_set_logical_time (int time) |
static void | db_reset_logical_time (void) |
string | db_get_meta_data_directory () |
The syntax of a property list. More... | |
static string | meta_data_db_file_name (string data) |
static void | reset_meta_data (void) |
reset all meta data on failures. More... | |
static bool | save_meta_data (bool do_free) |
save (and maybe free) metadata. More... | |
static bool | load_meta_data (void) |
load metadata from workspace. More... | |
bool | workspace_exists_p (const char *name) |
bool | workspace_ok_p (const char *name) |
bool | db_create_workspace (const char *name) |
static void | db_close_module (string what, string oname, bool do_free) |
stores all resources of module oname. More... | |
static void | db_save_workspace (string what, bool do_free) |
void | db_checkpoint_workspace (void) |
bool | db_close_workspace (bool is_quit) |
bool | db_open_workspace (const char *name) |
Variables | |
static string | current_workspace_name = NULL |
the workspace has a name. More... | |
static int | logical_time = 1 |
#define DATABASE_MISC "MISC" |
Definition at line 136 of file workspace.c.
#define DATABASE_NEWGEN "NEWGEN" /**newgen type translation data... */ |
Definition at line 137 of file workspace.c.
#define DATABASE_STATUS "STATUS" |
Definition at line 134 of file workspace.c.
#define DATABASE_SYMBOLS "SYMBOLS" |
Definition at line 135 of file workspace.c.
#define MD_DATABASE "database" |
Definition at line 88 of file workspace.c.
#define METADATA "Metadata" |
Definition at line 132 of file workspace.c.
Definition at line 205 of file workspace.c.
#define WORKSPACE_NAME_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" |
the workspace name must be composed of the following characters.
Definition at line 43 of file workspace.c.
void db_checkpoint_workspace | ( | void | ) |
load ENTITIES (since no one ask for them as they should...)
Definition at line 350 of file workspace.c.
References db_get_current_workspace_name(), db_get_memory_resource(), db_resource_p(), db_save_workspace(), debug_off, debug_on, dump_all_db_resource_status(), ifdebug, pips_debug, and PIPSDBM_DEBUG_LEVEL.
Referenced by checkpoint_workspace().
stores all resources of module oname.
log if necessary.
Definition at line 318 of file workspace.c.
References db_save_and_free_memory_resource_if_any(), dbll_get_ith_resource_name(), dbll_number_of_resources(), same_string_p, and user_log().
Referenced by db_save_workspace(), and main().
free?
is_quit | s_quit |
Definition at line 367 of file workspace.c.
References db_get_current_workspace_name(), db_reset_current_workspace_name(), db_save_workspace(), debug_off, debug_on, pips_debug, and PIPSDBM_DEBUG_LEVEL.
Referenced by create(), main(), make_close_workspace(), make_open_workspace(), old_reductions(), tpips_internal_error(), and tpips_user_error().
bool db_create_workspace | ( | const char * | name | ) |
name | ame |
Definition at line 282 of file workspace.c.
References create_directory(), db_create_pips_database(), db_get_workspace_directory_name(), db_set_current_workspace_name(), debug_off, debug_on, free(), ok, pips_debug, pips_user_warning, PIPSDBM_DEBUG_LEVEL, and purge_directory().
Referenced by create(), end_create_workspace_notify(), execute_workspace_creation_and_so_on_given_with_options(), and pips_main().
string db_get_current_workspace_directory | ( | void | ) |
Definition at line 96 of file workspace.c.
string db_get_current_workspace_name | ( | void | ) |
the function is used to check that there is some current workspace...
Definition at line 82 of file workspace.c.
References current_workspace_name.
Referenced by activate_phase(), check_delete_workspace(), checkpoint_workspace(), close_workspace(), close_workspace_if_opened(), create(), create_workspace(), db_checkpoint_workspace(), db_close_workspace(), db_get_current_workspace_directory(), edit_notify(), end_create_workspace_notify(), end_delete_workspace_notify(), epips_select_module(), generate_a_directory_menu(), generate_module_menu(), get_module_names(), get_view_file(), hpfc_get_file_list(), hpfc_install(), info(), lazy_open_module(), load_meta_data(), make_close_workspace(), make_open_workspace(), old_reductions(), open_module(), open_module_if_unique(), open_or_create_workspace(), open_workspace(), open_workspace_notify(), options_select(), perform(), quit_notify(), save_meta_data(), send_the_names_of_the_available_modules_to_emacs(), show_workspace(), start_create_workspace_notify(), start_delete_workspace_notify(), start_directory_notify(), tp_close_the_workspace(), tp_some_info(), and tpips_user_error().
int db_get_logical_time | ( | void | ) |
Definition at line 112 of file workspace.c.
References logical_time.
Referenced by db_check_time(), db_put_or_update_memory_resource(), db_set_resource_as_required(), db_touch_resource(), db_update_time(), and save_meta_data().
string db_get_meta_data_directory | ( | void | ) |
The syntax of a property list.
FC 2015-07-19 include "pipsdbm.h" avoid include cycle pipsdbm -> properties -> pipsdbm there is still a link cycle.
Definition at line 139 of file workspace.c.
Referenced by meta_data_db_file_name().
string db_get_workspace_directory_name | ( | const char * | name | ) |
returns an allocated string.
name | ame |
Definition at line 91 of file workspace.c.
References concatenate(), MD_DATABASE, and strdup().
Referenced by db_create_workspace(), db_get_current_workspace_directory(), db_open_workspace(), workspace_exists_p(), and workspace_ok_p().
int db_inc_logical_time | ( | void | ) |
0 means not set...
Definition at line 107 of file workspace.c.
References logical_time.
Referenced by db_check_time(), and update_preserved_resources().
bool db_open_workspace | ( | const char * | name | ) |
failure!
load ENTITIES (since no one ask for them as they should;-)
should touch them somehow to force latter saving?
name | ame |
Definition at line 380 of file workspace.c.
References db_get_memory_resource(), db_get_workspace_directory_name(), db_resource_p(), db_set_current_workspace_name(), debug_off, debug_on, directory_exists_p(), free(), load_meta_data(), ok, pips_debug, pips_user_warning, PIPSDBM_DEBUG_LEVEL, and reset_meta_data().
Referenced by main(), make_open_workspace(), and old_reductions().
|
static |
Definition at line 69 of file workspace.c.
References current_workspace_name, free(), and pips_assert.
Referenced by db_close_workspace(), and db_reset_current_workspace_name_if_necessary().
|
static |
Definition at line 75 of file workspace.c.
References current_workspace_name, and db_reset_current_workspace_name().
Referenced by reset_meta_data().
|
static |
Definition at line 123 of file workspace.c.
References logical_time.
Referenced by reset_meta_data().
ENTITIES are saved here...
Definition at line 333 of file workspace.c.
References db_close_module(), db_get_module_list(), GEN_ARRAY_FOREACH, gen_array_full_free(), module, save_meta_data(), and user_log().
Referenced by db_checkpoint_workspace(), and db_close_workspace().
|
static |
Definition at line 60 of file workspace.c.
References current_workspace_name, pips_assert, pips_internal_error, strdup(), and workspace_name_p().
Referenced by db_create_workspace(), and db_open_workspace().
|
static |
Definition at line 117 of file workspace.c.
References logical_time, and pips_assert.
Referenced by load_meta_data().
|
static |
load metadata from workspace.
Definition at line 211 of file workspace.c.
References check_fopen(), DATABASE_MISC, DATABASE_NEWGEN, DATABASE_STATUS, DATABASE_SYMBOLS, db_get_current_workspace_name(), db_open_pips_database(), db_set_logical_time(), file_exists_p(), file_name, free(), gen_type_translation_read(), meta_data_db_file_name(), ok, ONERROR, pips_debug, pips_internal_error, pips_user_error, pips_user_warning, read_tabulated_db_symbol(), safe_fclose(), safe_readline(), and same_string_p.
Referenced by db_open_workspace().
Definition at line 144 of file workspace.c.
References concatenate(), db_get_meta_data_directory(), free(), MD_DATABASE, and strdup().
Referenced by load_meta_data(), and save_meta_data().
|
static |
reset all meta data on failures.
what about db_symbols?
Definition at line 153 of file workspace.c.
References db_reset_current_workspace_name_if_necessary(), db_reset_logical_time(), and db_reset_pips_database_if_necessary().
Referenced by db_open_workspace().
save (and maybe free) metadata.
Definition at line 164 of file workspace.c.
References DATABASE_MISC, DATABASE_NEWGEN, DATABASE_STATUS, DATABASE_SYMBOLS, db_close_pips_database(), db_get_current_workspace_name(), db_get_logical_time(), db_save_pips_database(), db_symbol_domain, file_name, fprintf(), free(), gen_free_tabulated(), gen_type_translation_write(), meta_data_db_file_name(), pips_debug, safe_fclose(), safe_fopen(), and write_tabulated_db_symbol().
Referenced by db_save_workspace().
bool workspace_exists_p | ( | const char * | name | ) |
name | ame |
Definition at line 266 of file workspace.c.
References db_get_workspace_directory_name(), directory_exists_p(), free(), and full_name.
Referenced by continue_create_workspace_notify(), create(), and open_workspace().
bool workspace_name_p | ( | const char * | name | ) |
name | ame |
Definition at line 46 of file workspace.c.
References WORKSPACE_NAME_CHARS.
Referenced by continue_create_workspace_notify(), db_set_current_workspace_name(), end_create_workspace_notify(), and open_or_create_workspace().
bool workspace_ok_p | ( | const char * | name | ) |
name | ame |
Definition at line 274 of file workspace.c.
References db_get_workspace_directory_name(), file_readable_p(), free(), and full_name.
Referenced by open_workspace().
|
static |
the workspace has a name.
{set,reset,get}_workspace
Definition at line 58 of file workspace.c.
Referenced by db_get_current_workspace_name(), db_reset_current_workspace_name(), db_reset_current_workspace_name_if_necessary(), and db_set_current_workspace_name().
|
static |
Definition at line 105 of file workspace.c.
Referenced by db_get_logical_time(), db_inc_logical_time(), db_reset_logical_time(), and db_set_logical_time().