38 if ((
cb->spec.get_type() &
type) &&
cb->triggered_by(gbd)) {
45 if (
cb->spec.get_type() &
type) {
58 if (cbl || deleteCBs.hierarchy_cbs) {
92 if (!gbc_father)
break;
116 int index,
start, end;
134 for (index = start; index < end; index++) {
165 for (
int index = 0; index < gbc->
d.
nheader; index++) {
180 if (size <= gbc->d.headermemsize)
return;
182 if (size > 10) size++;
183 if (size > 30) size = size*3/2;
190 for (idx=0; idx<maxidx; idx++) {
218 if (index_pos >= father->
d.
nheader) {
236 fprintf(stderr,
"Warning: index_pos %li of father(%p) contains just-deleted entry -> using next index_pos..\n", index_pos, father);
242 gbd->
index = index_pos;
255 hls->flags.key_quark = 0;
263 : transaction_level(0),
264 aborted_transaction(0),
269 root_container(
NULp),
271 path(nulldup(db_path)),
274 allow_corrupt_file_recovery(0),
275 compression_mask(-1),
285 last_saved_transaction(0),
286 last_main_saved_transaction(0),
293 close_callbacks(
NULp),
478 for (
long index = 0; index < gbc->
d.
nheader; index++) {
527 for (
int pass = 1; pass <= 2; pass++) {
528 for (
int index = 0; index < gb_main->
d.
nheader; index++) {
546 for (
int index = 0; index < gbc->
d.
nheader; index++) {
684 if (ifs->
key == new_index)
break;
701 for (
int i = Main->
keycnt; i < Main->sizeofkeys; i++) {
721 if (test_index != index) {
722 if (test_index == 0) {
726 GBK_terminatef(
"Database corrupt (allocating quark '%s' in server failed)", key);
754 for (
long index = 1; index <
keycnt; index++) {
755 if (
keys[index].key) {
757 freenull(
keys[index].key);
762 freenull(
keys[0].key);
808 for (
int index = 0; index < gbc->
d.
nheader; index++) {
847 if (mode == 2)
return NULp;
860 if (gbd->
server_id)
goto gb_changed_label;
868 if (error)
return error;
870 if (mode == 2)
return NULp;
882 goto gb_commit_do_callbacks;
890 if (error)
return error;
921 for (
int index = start; index < end; index++) {
924 if (!hls[index].
flags.changed)
continue;
926 if (error)
return error;
932 gb_commit_do_callbacks :
void gb_init_undo_stack(GB_MAIN_TYPE *Main)
void SET_GB_DATA_LIST_HEADER(gb_data_list &dl, gb_header_list *head)
void GBK_terminate_on_error(const char *error)
#define GB_GBM_INDEX(gbd)
listtype::iterator itertype
#define implicated(hypothesis, conclusion)
char * dates[ALLOWED_DATES]
void gb_check_in_undo_create(GB_MAIN_TYPE *Main, GBDATA *gbd)
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
__ATTR__USERESULT GB_ERROR send_update_to_server(GBDATA *gbd) __ATTR__USERESULT
void gb_touch_header(GBCONTAINER *gbc)
static void gb_unlink_entry(GBDATA *gbd)
gb_data_base_type_union info
void _GB_CHECK_IN_UNDO_DELETE(GB_MAIN_TYPE *Main, GBDATA *&gbd)
GB_MAIN_TYPE * GB_MAIN(GBDATA *gbd)
void insert_data(const char *Data, long Size, long Memsize)
gb_user * users[GB_MAX_USERS]
void gb_del_ref_and_extern_gb_transaction_save(gb_transaction_save *ts)
long gb_create_key(GB_MAIN_TYPE *Main, const char *key, bool create_gb_key)
static void gb_set_update_in_server_flags(GBCONTAINER *gbc)
static gb_transaction_save * gb_new_gb_transaction_save(GBENTRY *gbe)
long GBS_write_numhash(GB_NUMHASH *hs, long key, long val)
static void gb_delete_main_entry(GBCONTAINER *&gb_main)
char * ARB_strdup(const char *str)
void touch_update(long udate)
GBDATA * gb_make_pre_defined_entry(GBCONTAINER *father, GBDATA *gbd, long index_pos, GBQUARK keyq)
void GBK_terminatef(const char *templat,...)
static void gb_abortdata(GBENTRY *gbe)
void gb_write_index_key(GBCONTAINER *father, long index, GBQUARK new_index)
CONSTEXPR_INLINE gb_header_list * GB_DATA_LIST_HEADER(gb_data_list &dl)
void gb_add_ref_gb_transaction_save(gb_transaction_save *ts)
GB_ERROR gb_commit_transaction_local_rek(GBDATA *&gbd, long mode, int *pson_created)
void GBS_free_hash(GB_HASH *hs)
GBQUARK gb_find_or_create_quark(GB_MAIN_TYPE *Main, const char *key)
gb_index_files * GB_INDEX_FILES_NEXT(gb_index_files *ixf)
GB_MAIN_TYPE * GBCONTAINER_MAIN(GBCONTAINER *gbc)
GBCONTAINER * root_container
void _GB_CHECK_IN_UNDO_MODIFY(GB_MAIN_TYPE *Main, GBDATA *gbd)
static void gb_delete_entry(GBCONTAINER *&gbc)
void gb_check_in_undo_delete(GB_MAIN_TYPE *Main, GBDATA *&gbd)
GB_ERROR gbcmc_sendupdate_update(GBDATA *gbd, int send_headera)
void _GB_CHECK_IN_UNDO_CREATE(GB_MAIN_TYPE *Main, GBDATA *gbd)
GB_MAIN_TYPE(const char *db_path)
static HelixNrInfo * start
GB_ERROR GB_await_error()
GB_MAIN_TYPE * GB_MAIN_NO_FATHER(GBDATA *gbd)
void gb_untouch_children_and_me(GBCONTAINER *gbc)
bool is_indexable() const
GB_HASH * key_2_index_hash
char * quick_save_disabled
void gb_pre_delete_entry(GBDATA *gbd)
void GBK_terminate(const char *error) __ATTR__NORETURN
gb_data_base_type_union2 info
GBCONTAINER * gb_key_data
GB_ERROR gbcmc_sendupdate_create(GBDATA *gbd)
void gb_abort_transaction_local_rek(GBDATA *&gbd)
GBQUARK key2quark(GB_MAIN_TYPE *Main, const char *key)
bool is_container() const
void announce_db_close(GB_MAIN_TYPE *Main)
GBCONTAINER * gb_make_pre_defined_container(GBCONTAINER *father, GBCONTAINER *gbc, long index_pos, GBQUARK keyq)
static void gb_write_key(GBDATA *gbd, const char *s)
static void error(const char *msg)
static void gb_link_entry(GBCONTAINER *father, GBDATA *gbd, long index_pos)
void set_touched_idx(int idx)
size_t GBS_hash_elements(const GB_HASH *hs)
void gb_free_cache(GB_MAIN_TYPE *Main, GBENTRY *gbe)
unsigned int update_in_server
GB_ERROR gbcms_add_to_delete_list(GBDATA *gbd)
void gb_untouch_me(GBENTRY *gbe)
long GB_read_clients(GBDATA *gbd)
static void gb_uncache(GBCONTAINER *gbc)
GBCONTAINER * as_container() const
unsigned int should_be_indexed
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
void ARB_recalloc(TYPE *&tgt, size_t oelem, size_t nelem)
gb_transaction_save * get_oldData() const
void * gbm_get_mem(size_t size, long index)
void gb_create_header_array(GBCONTAINER *gbc, int size)
long index_of_touched_one_son
CONSTEXPR_INLINE GBCONTAINER * GB_FATHER(GBDATA *gbd)
void gb_destroy_indices(GBCONTAINER *gbc)
gb_index_files * GBCONTAINER_IFS(GBCONTAINER *gbc)
void GBS_free_numhash(GB_NUMHASH *hs)
bool stored_external() const
void gb_untouch_children(GBCONTAINER *gbc)
GB_ERROR gbcmc_sendupdate_delete(GBDATA *gbd)
GBENTRY * gb_make_entry(GBCONTAINER *father, const char *key, long index_pos, GBQUARK keyq, GB_TYPES type)
GBQUARK gb_find_or_create_NULL_quark(GB_MAIN_TYPE *Main, const char *key)
gb_callback_list * callback
void touch_creation(long cdate)
void GB_internal_error(const char *message)
CONSTEXPR_INLINE_Cxx14 void SET_GB_FATHER(GBDATA *gbd, GBCONTAINER *father)
GBQUARK GB_KEY_QUARK(GBDATA *gbd)
GBCONTAINER * gb_make_container(GBCONTAINER *father, const char *key, long index_pos, GBQUARK keyq)
#define GBTUM_MAGIC_NUMBER
bool stored_external() const
char * gb_abort_entry(GBDATA *gbd)
void trigger_change_callbacks(GBDATA *gbd, GB_CB_TYPE type)
void gb_save_extern_data_in_ts(GBENTRY *gbe)
long quark2gbmindex(GB_MAIN_TYPE *Main, GBQUARK key_quark)
gb_transaction_save * old
#define GB_PUT_SECURITY_DELETE(gb, i)
void announce_db_open(GB_MAIN_TYPE *Main)
GBENTRY * as_entry() const
long gbcmc_key_alloc(GBDATA *gbd, const char *key)
void gb_free_undo_stack(GB_MAIN_TYPE *Main)
void gb_check_in_undo_modify(GB_MAIN_TYPE *Main, GBDATA *gbd)
void gb_del_ref_gb_transaction_save(gb_transaction_save *ts)
void gbm_free_mem(void *block, size_t size, long index)
void GB_FREE_TRANSACTION_SAVE(GBDATA *gbd)
void gb_load_single_key_data(GBDATA *gb_main, GBQUARK q)
void gb_touch_entry(GBDATA *gbd, GB_CHANGE val)
void gb_create_key_array(GB_MAIN_TYPE *Main, int index)
void trigger_delete_callbacks(GBDATA *gbd)
unsigned int header_changed
long GBS_read_hash(const GB_HASH *hs, const char *key)
gb_callback_list * get_callbacks() const
GBCONTAINER * dummy_father
GB_HASH * GBS_create_hash(long estimated_elements, GB_CASE case_sens)
void set_data(char *data)
void gb_delete_dummy_father(GBCONTAINER *&gbc)
GB_write_int const char s