ARB
|
#include "gb_key.h"
#include "gb_undo.h"
#include "gb_index.h"
#include "gb_hashindex.h"
#include "gb_ts.h"
#include <arb_strbuf.h>
#include <cctype>
Go to the source code of this file.
Macros | |
#define | GB_INDEX_FIND(gbf, ifs, quark) |
#define GB_INDEX_FIND | ( | gbf, | |
ifs, | |||
quark | |||
) |
Definition at line 21 of file adindex.cxx.
Referenced by GB_create_index(), gb_index_find(), GBENTRY::index_check_in(), and GBENTRY::index_check_out().
Definition at line 117 of file adindex.cxx.
References GBDATA::as_container(), gb_index_files::case_sens, error(), GB_find_or_create_quark(), GB_find_sub_by_quark(), GB_GBM_INDEX, GB_INDEX_FIND, GB_read_clients(), GBCONTAINER_IFS(), gbm_get_mem(), gbs_get_a_prime(), gb_index_files::hash_table_size, GBDATA::is_entry(), gb_index_files::key, gb_index_files::nr_of_elements, NULp, RETURN_ERROR, SET_GB_INDEX_FILES_ENTRIES(), SET_GB_INDEX_FILES_NEXT(), and SET_GBCONTAINER_IFS().
Referenced by gb_load_key_data_and_dictionaries(), and GBT_open().
void gb_destroy_indices | ( | GBCONTAINER * | gbc | ) |
Definition at line 166 of file adindex.cxx.
References GB_ENTRIES_ENTRY, GB_GBM_INDEX, GB_IF_ENTRIES_NEXT(), GB_INDEX_FILES_ENTRIES(), GB_INDEX_FILES_NEXT(), GBCONTAINER_IFS(), gbm_free_mem(), and gb_index_files::hash_table_size.
Referenced by gb_delete_entry().
GBDATA* gb_index_find | ( | GBCONTAINER * | gbf, |
gb_index_files * | ifs, | ||
GBQUARK | quark, | ||
const char * | val, | ||
GB_CASE | case_sens, | ||
int | after_index | ||
) |
Definition at line 267 of file adindex.cxx.
References gb_index_files::case_sens, GBCONTAINER::d, GB_CALC_HASH_INDEX, GB_ENTRIES_ENTRY, GB_FATHER(), GB_IF_ENTRIES_GBD(), GB_IF_ENTRIES_NEXT(), GB_INDEX_FILES_ENTRIES(), GB_INDEX_FIND, GB_internal_error(), GB_read_char_pntr(), GBS_string_matches(), gb_index_files::hash_table_size, GBDATA::index, gb_data_list::nheader, NULp, and result.
Referenced by find_sub_sub_by_quark().
|
static |
Definition at line 318 of file adindex.cxx.
References GB_MAIN(), NULp, type, and GB_MAIN_TYPE::undo_type.
Referenced by gb_disable_undo(), and gb_set_undo_sync().
|
static |
Definition at line 324 of file adindex.cxx.
References g_b_undo_entry::father, g_b_undo_list::father, g_b_undo_entry::sizeof_this, g_b_undo_header::sizeof_this, and g_b_undo_list::sizeof_this.
Referenced by gb_check_in_undo_delete(), gb_check_in_undo_modify(), and new_g_b_undo_entry().
|
static |
Definition at line 330 of file adindex.cxx.
References g_b_undo_list::entries, g_b_undo_entry::father, g_b_add_size_to_undo_entry(), gbm_get_mem(), GBM_UNDO, and g_b_undo_entry::next.
Referenced by gb_check_in_undo_create(), gb_check_in_undo_delete(), and gb_check_in_undo_modify().
void gb_init_undo_stack | ( | GB_MAIN_TYPE * | Main | ) |
Definition at line 344 of file adindex.cxx.
References ARB_calloc(), GB_MAX_UNDO_SIZE, g_b_undo_mgr::max_size_of_all_undos, g_b_undo_mgr::r, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by GB_MAIN_TYPE::GB_MAIN_TYPE().
|
static |
Definition at line 353 of file adindex.cxx.
References g_b_undo_entry::d, gb_del_ref_gb_transaction_save(), GB_UNDO_ENTRY_TYPE_MODIFY, GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY, gbm_free_mem(), GBM_UNDO, g_b_undo_entry::ts, and g_b_undo_entry::type.
Referenced by delete_g_b_undo_list(), and g_b_undo().
|
static |
Definition at line 367 of file adindex.cxx.
References delete_g_b_undo_entry(), g_b_undo_list::entries, and g_b_undo_entry::next.
Referenced by delete_g_b_undo_header(), g_b_check_undo_size2(), g_b_undo(), gb_disable_undo(), and gb_free_all_undos().
|
static |
Definition at line 376 of file adindex.cxx.
References delete_g_b_undo_list(), g_b_undo_list::next, NULp, and g_b_undo_header::stack.
Referenced by gb_free_undo_stack().
|
static |
Definition at line 385 of file adindex.cxx.
References delete_g_b_undo_list(), g_b_undo_list::next, NULp, g_b_undo_header::sizeof_this, g_b_undo_list::sizeof_this, and g_b_undo_header::stack.
Referenced by g_b_check_undo_size().
|
static |
Definition at line 409 of file adindex.cxx.
References error(), g_b_check_undo_size2(), GB_MAX_REDO_CNT, GB_MAX_UNDO_CNT, g_b_undo_mgr::max_size_of_all_undos, g_b_undo_mgr::r, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by GB_set_undo_mem(), and gb_set_undo_sync().
void gb_free_undo_stack | ( | GB_MAIN_TYPE * | Main | ) |
Definition at line 417 of file adindex.cxx.
References delete_g_b_undo_header(), g_b_undo_mgr::r, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by GB_MAIN_TYPE::~GB_MAIN_TYPE().
|
static |
Definition at line 426 of file adindex.cxx.
References GBDATA::as_container(), GBDATA::as_entry(), g_b_undo_entry::d, gb_extern_data2::data, error(), gb_data_base_type_union2::ex, gb_data_base_type_union::ex, gb_flag_types2::extern_data, g_b_undo_entry::flag, gb_header_flags::flags, gb_transaction_save::flags, GBDATA::flags, gb_transaction_save::flags2, GBDATA::flags2, GB_ARRAY_FLAGS(), GB_BITS, GB_CREATED, gb_del_ref_and_extern_gb_transaction_save(), GB_delete(), GB_export_error(), GB_FATHER(), GB_internal_error(), gb_make_pre_defined_container(), gb_make_pre_defined_entry(), GB_NORMAL_CHANGE, gb_save_extern_data_in_ts(), gb_touch_entry(), gb_touch_header(), GB_UNDO_ENTRY_TYPE_CREATED, GB_UNDO_ENTRY_TYPE_DELETED, GB_UNDO_ENTRY_TYPE_MODIFY, GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY, g_b_undo_gbd::gbd, g_b_undo_entry::gs, GBENTRY::index_re_check_in(), gb_transaction_save::info, GBENTRY::info, GBDATA::is_container(), GBDATA::is_entry(), g_b_undo_gbd::key, NULp, gb_flag_types::saved_flags, gb_extern_data::set_data(), g_b_undo_entry::source, GBENTRY::stored_external(), g_b_undo_entry::ts, g_b_undo_entry::type, and GBDATA::type().
Referenced by g_b_undo().
|
static |
Definition at line 495 of file adindex.cxx.
References delete_g_b_undo_entry(), delete_g_b_undo_list(), g_b_undo_list::entries, error(), GB_begin_transaction(), GB_end_transaction(), g_b_undo_entry::next, g_b_undo_list::next, NULp, g_b_undo_header::sizeof_this, g_b_undo_list::sizeof_this, g_b_undo_header::stack, and undo_entry().
Referenced by GB_undo().
|
static |
Definition at line 522 of file adindex.cxx.
References g_b_undo_entry::d, g_b_undo_entry::gs, g_b_undo_gbd::key, and quark2key().
Referenced by g_b_undo_info().
|
static |
Definition at line 526 of file adindex.cxx.
References ARB_strdup(), GBS_strstruct::cat(), g_b_undo_list::entries, g_b_read_undo_key_pntr(), gb_read_key_pntr(), GB_UNDO_ENTRY_TYPE_CREATED, GB_UNDO_ENTRY_TYPE_DELETED, GB_UNDO_ENTRY_TYPE_MODIFY, GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY, info, g_b_undo_entry::next, NULp, GBS_strstruct::put(), GBS_strstruct::release(), and g_b_undo_header::stack.
Referenced by GB_undo_info().
Definition at line 559 of file adindex.cxx.
References delete_g_b_undo_list(), GB_MAIN(), g_b_undo_list::next, NULp, g_b_undo_mgr::r, g_b_undo_header::sizeof_this, g_b_undo_header::stack, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by gb_set_undo_sync().
Definition at line 582 of file adindex.cxx.
References error(), FALLTHROUGH, g_b_undo_list::father, g_b_check_undo_size(), gb_free_all_undos(), GB_MAIN(), gb_set_undo_type(), GB_UNDO_KILL, GB_UNDO_REDO, GB_UNDO_UNDO, GB_UNDO_UNDO_REDO, g_b_undo_list::next, NULp, g_b_undo_mgr::r, GB_MAIN_TYPE::requested_undo_type, g_b_undo_header::stack, g_b_undo_mgr::u, GB_MAIN_TYPE::undo, and g_b_undo_mgr::valid_u.
Referenced by GB_MAIN_TYPE::commit_transaction().
Definition at line 610 of file adindex.cxx.
References delete_g_b_undo_list(), g_b_undo_list::entries, g_b_undo_list::father, GB_MAIN(), gb_set_undo_type(), GB_UNDO_NONE, GB_UNDO_UNDO, g_b_undo_list::next, NULp, g_b_undo_mgr::r, GB_MAIN_TYPE::requested_undo_type, g_b_undo_header::sizeof_this, g_b_undo_header::stack, GB_MAIN_TYPE::undo, and g_b_undo_mgr::valid_u.
Referenced by GB_MAIN_TYPE::commit_transaction().
void gb_check_in_undo_create | ( | GB_MAIN_TYPE * | Main, |
GBDATA * | gbd | ||
) |
Definition at line 636 of file adindex.cxx.
References g_b_undo_entry::flag, GB_GBM_INDEX, GB_UNDO_ENTRY_TYPE_CREATED, g_b_undo_entry::gbm_index, new_g_b_undo_entry(), g_b_undo_entry::source, g_b_undo_entry::type, GB_MAIN_TYPE::undo, and g_b_undo_mgr::valid_u.
Referenced by _GB_CHECK_IN_UNDO_CREATE().
void gb_check_in_undo_modify | ( | GB_MAIN_TYPE * | Main, |
GBDATA * | gbd | ||
) |
Definition at line 647 of file adindex.cxx.
References g_b_undo_entry::d, gb_extern_data2::data, gb_data_base_type_union2::ex, g_b_undo_entry::flag, GBDATA::flags, g_b_add_size_to_undo_entry(), gb_add_ref_gb_transaction_save(), GB_BITS, GB_FREE_TRANSACTION_SAVE(), GB_GBM_INDEX, GB_UNDO_ENTRY_TYPE_MODIFY, GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY, g_b_undo_entry::gbm_index, GBDATA::get_oldData(), gb_transaction_save::info, GBDATA::is_entry(), gb_extern_data2::memsize, new_g_b_undo_entry(), gb_flag_types::saved_flags, g_b_undo_entry::source, gb_transaction_save::stored_external(), g_b_undo_entry::ts, g_b_undo_entry::type, GBDATA::type(), GB_MAIN_TYPE::undo, and g_b_undo_mgr::valid_u.
Referenced by _GB_CHECK_IN_UNDO_MODIFY().
void gb_check_in_undo_delete | ( | GB_MAIN_TYPE * | Main, |
GBDATA *& | gbd | ||
) |
Definition at line 674 of file adindex.cxx.
References GBDATA::as_container(), GBDATA::as_entry(), g_b_undo_entry::d, GBCONTAINER::d, g_b_undo_entry::flag, gb_header_flags::flags, GBDATA::flags2, g_b_add_size_to_undo_entry(), gb_abort_entry(), GB_ARRAY_FLAGS(), GB_BITS, gb_check_in_undo_delete(), gb_delete_entry(), GB_FATHER(), GB_GBM_INDEX, GB_KEY_QUARK(), gb_pre_delete_entry(), GB_UNDO_ENTRY_TYPE_DELETED, GBCONTAINER_ELEM(), g_b_undo_gbd::gbd, g_b_undo_entry::gbm_index, g_b_undo_entry::gs, GBENTRY::index_check_out(), GBDATA::is_container(), g_b_undo_gbd::key, GBENTRY::memsize(), new_g_b_undo_entry(), gb_data_list::nheader, gb_flag_types2::should_be_indexed, g_b_undo_entry::source, GBENTRY::stored_external(), g_b_undo_entry::type, GBDATA::type(), GB_MAIN_TYPE::undo, and g_b_undo_mgr::valid_u.
Referenced by _GB_CHECK_IN_UNDO_DELETE(), and gb_check_in_undo_delete().
GB_ERROR GB_request_undo_type | ( | GBDATA * | gb_main, |
GB_UNDO_TYPE | type | ||
) |
Define how to undo DB changes.
This function should be called just before opening a transaction, otherwise its effect will be delayed.
Possible types are: GB_UNDO_UNDO enable undo GB_UNDO_NONE disable undo GB_UNDO_KILL disable undo and remove old undos !!
Note: if GB_request_undo_type returns an error, local undo type remains unchanged
Definition at line 721 of file adindex.cxx.
References _GBCMC_UNDOCOM_REQUEST_NOUNDO, _GBCMC_UNDOCOM_REQUEST_UNDO, error(), GB_MAIN(), GB_UNDO_KILL, GB_UNDO_NONE, gbcmc_send_undo_commands(), GB_MAIN_TYPE::is_client(), NULp, GB_MAIN_TYPE::requested_undo_type, and type.
Referenced by ARB_main(), FINAL_TYPE< SEQTYPE >::ArbWriter(), cleanup_ptserver_database(), GB_optimize(), GB_undo(), gbcms_talking_undo(), GBT_compress_sequence_tree2(), and NT_create_main_window().
GB_UNDO_TYPE GB_get_requested_undo_type | ( | GBDATA * | gb_main | ) |
Definition at line 749 of file adindex.cxx.
References GB_MAIN(), and GB_MAIN_TYPE::requested_undo_type.
Referenced by GB_optimize(), GB_undo(), and GBT_compress_sequence_tree2().
GB_ERROR GB_undo | ( | GBDATA * | gb_main, |
GB_UNDO_TYPE | type | ||
) |
Definition at line 755 of file adindex.cxx.
References _GBCMC_UNDOCOM_REDO, _GBCMC_UNDOCOM_UNDO, ASSERT_NO_ERROR, error(), g_b_undo(), GB_get_requested_undo_type(), GB_internal_error(), GB_MAIN(), GB_request_undo_type(), GB_UNDO_REDO, GB_UNDO_UNDO, GB_UNDO_UNDO_REDO, gbcmc_send_undo_commands(), GB_MAIN_TYPE::is_client(), NULp, g_b_undo_mgr::r, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by ED4_undo_redo(), gbcms_talking_undo(), GEN_undo_cb(), NT_undo_cb(), and SEC_undo_cb().
char* GB_undo_info | ( | GBDATA * | gb_main, |
GB_UNDO_TYPE | type | ||
) |
Definition at line 806 of file adindex.cxx.
References _GBCMC_UNDOCOM_INFO_REDO, _GBCMC_UNDOCOM_INFO_UNDO, g_b_undo_info(), GB_export_error(), GB_MAIN(), GB_UNDO_REDO, GB_UNDO_UNDO, gbcmc_send_undo_info_commands(), GB_MAIN_TYPE::is_client(), NULp, g_b_undo_mgr::r, g_b_undo_mgr::u, and GB_MAIN_TYPE::undo.
Referenced by gbcms_talking_undo().
Definition at line 833 of file adindex.cxx.
References _GBCMC_UNDOCOM_SET_MEM, g_b_check_undo_size(), GB_export_errorf(), GB_MAIN(), gbcmc_send_undo_commands(), GB_MAIN_TYPE::is_client(), g_b_undo_mgr::max_size_of_all_undos, NULp, and GB_MAIN_TYPE::undo.
Referenced by gbcms_talking_undo().