ARB
|
#include <cctype>
#include <ctime>
#include <netinet/in.h>
#include <sys/stat.h>
#include <arbdbt.h>
#include <arb_str.h>
#include <arb_file.h>
#include <arb_defs.h>
#include <arb_progress.h>
#include <arb_zfile.h>
#include <BufferedFileReader.h>
#include "gb_key.h"
#include "gb_localdata.h"
#include "gb_map.h"
#include "gb_load.h"
#include "ad_io_inline.h"
Go to the source code of this file.
Classes | |
struct | BufferedPipeReader |
Macros | |
#define | FILESIZE_GRANULARITY 1024 |
#define | DEBUG_DUMP_INDENTED(d, s) |
Functions | |
void | GB_set_verbose () |
static const char * | getToken (char **line) |
static GB_ERROR | set_protection_level (GB_MAIN_TYPE *Main, GBDATA *gbd, const char *p) |
static GB_ERROR | gb_parse_ascii_rek (LineReader &r, GBCONTAINER *gb_parent, const char *parent_name) |
static GB_ERROR | gb_parse_ascii (LineReader &r, GBCONTAINER *gb_parent) |
static GB_ERROR | gb_read_ascii_beyond_header (FILE *in, const char *path, GBCONTAINER *gbc) |
static long | gb_recover_corrupt_file (GBCONTAINER *gbc, FILE *in, GB_ERROR recovery_reason, bool loading_quick_save) |
static long | gb_read_bin_rek_V2 (FILE *in, GBCONTAINER *gbc_dest, long nitems, long version, long reversed, long deep, arb_progress &progress) |
static GBDATA * | gb_search_system_folder_rek (GBDATA *gbd) |
static void | gb_search_system_folder (GBDATA *gb_main) |
bool | read_keyword (const char *expected_keyword, FILE *in, GBCONTAINER *gbc) |
static long | gb_read_bin (FILE *in, GBCONTAINER *gbc, bool allowed_to_load_diff, arb_progress &progress) |
void | GB_set_next_main_idx (long idx) |
GB_MAIN_IDX | gb_make_main_idx (GB_MAIN_TYPE *Main) |
bool | is_binary_db_id (int id) |
bool | has_ascii_db_id (uint32_t bin_id, FILE *in) |
static GB_ERROR | init_tmp_branch (GBDATA *gb_main) |
static GBDATA * | GB_login (const char *cpath, const char *opent, const char *user) |
GBDATA * | GB_open (const char *path, const char *opent) |
GB_ERROR | GBT_check_arb_file (const char *name) |
Variables | |
static int | gb_verbose_mode = 0 |
static long | gb_next_main_idx_for_mapfile = 0 |
#define FILESIZE_GRANULARITY 1024 |
Definition at line 35 of file ad_load.cxx.
Referenced by GB_login(), and gb_read_bin_rek_V2().
#define DEBUG_DUMP_INDENTED | ( | d, | |
s | |||
) |
Definition at line 376 of file ad_load.cxx.
Referenced by gb_read_bin_rek_V2().
void GB_set_verbose | ( | void | ) |
Definition at line 31 of file ad_load.cxx.
Referenced by ARB_main(), and probe_read_data_base().
|
static |
Definition at line 61 of file ad_load.cxx.
References A_TO_I, ALLOWED_DATES, ARB_strdup(), GB_MAIN_TYPE::dates, error(), GBDATA::flags, GBDATA::flags2, gb_assert, GBS_global_string(), gb_flag_types2::last_updated, GB_MAIN_TYPE::last_updated, NULp, gb_flag_types::security_delete, gb_flag_types::security_read, and gb_flag_types::security_write.
Referenced by gb_parse_ascii_rek().
|
static |
Definition at line 98 of file ad_load.cxx.
References ARB_strdup(), error(), fputs(), gb_ascii_2_bin(), gb_assert, GB_atof(), GB_await_error(), GB_BITS, GB_BYTE, GB_BYTES, GB_FLOAT, GB_FLOATS, GB_INT, GB_INTS, gb_make_container(), gb_make_entry(), GB_NONE, GB_OBSOLETE, GB_STRING, GB_write_bits(), GB_write_byte(), GB_write_flag(), GB_write_float(), GB_write_int(), GB_write_string(), GBCONTAINER_MAIN(), GBS_fconvert_string(), GBS_global_string(), LineReader::getLine(), getToken(), line, NULp, set_protection_level(), and type.
Referenced by gb_parse_ascii().
|
static |
Definition at line 269 of file ad_load.cxx.
References error(), gb_parse_ascii_rek(), GBS_global_string(), LineReader::getLineNumber(), and NULp.
Referenced by gb_read_ascii_beyond_header().
|
static |
Definition at line 299 of file ad_load.cxx.
References BufferedPipeReader::dont_close(), error(), GB_CREATE_CONTAINER, gb_parse_ascii(), GB_search(), GB_SYSTEM_FOLDER, and NULp.
Referenced by GB_login().
|
static |
Definition at line 314 of file ad_load.cxx.
References ARB_strdup(), GB_await_error(), GB_export_error(), GB_export_errorf(), GB_get_db_path(), GB_is_fifo(), gb_local, GB_map_FILE(), GB_size_of_FILE(), GB_STRING_SHRT, GBCONTAINER_MAIN(), GBS_global_string(), NULp, s, and gb_local_data::search_system_folder.
Referenced by gb_read_bin_rek_V2().
|
static |
Definition at line 380 of file ad_load.cxx.
References arb_progress::aborted(), GB_MAIN_TYPE::allow_corrupt_file_recovery, GBDATA::as_container(), GBDATA::as_entry(), buffer, GB_MAIN_TYPE::clock, gb_flag_types::compressed_data, GBDATA::create_extended(), GBCONTAINER::d, DEBUG_DUMP_INDENTED, arb_progress::error_if_aborted(), gb_header_flags::ever_changed, FILESIZE_GRANULARITY, gb_header_flags::flags, gb_header_list::flags, GBDATA::flags, GBDATA::flags2, GBENTRY::free_data(), gb_assert, GB_BITS, GB_BYTE, GB_BYTES, gb_create_header_array(), GB_DATA_LIST_HEADER(), GB_DB, gb_delete_entry(), GB_DELETED, GB_export_error(), GB_FLOAT, GB_FLOATS, gb_get_number(), GB_give_buffer(), GB_give_buffer_size(), GB_HEADER_LIST_GBD(), GB_increase_buffer(), GB_INT, GB_internal_error(), GB_INTS, GB_MAIN(), gb_make_container(), gb_make_entry(), GB_OBSOLETE, gb_read_bin_error(), gb_recover_corrupt_file(), GB_STRING, GB_STRING_SHRT, GB_warning(), GBCONTAINER_MAIN(), GBS_global_string(), GBTUM_SHORT_STRING_SIZE, gb_data_base_type_union::i, implicated, arb_progress::inc_to(), GBDATA::index, GBENTRY::index_check_out(), GBENTRY::info, GBENTRY::insert_data(), GB_MAIN_TYPE::keycnt, GB_MAIN_TYPE::keys, gb_flag_types2::last_updated, gb_data_list::nheader, gb_Key::nref_last_saved, NULp, quark2key(), gb_flag_types::security_delete, gb_flag_types::security_read, gb_flag_types::security_write, gb_header_flags::set_change(), SET_GB_HEADER_LIST_GBD(), GBDATA::touch_creation_and_update(), type, GBDATA::type(), and gb_flag_types::unused.
Referenced by gb_read_bin().
Definition at line 603 of file ad_load.cxx.
References GB_child(), GB_DB, GB_nextChild(), GB_read_key_pntr(), GB_read_type(), GB_SYSTEM_FOLDER, NULp, and type.
Referenced by gb_search_system_folder().
|
static |
Definition at line 618 of file ad_load.cxx.
References error(), GB_copy_dropProtectMarksAndTempstate(), GB_CREATE_CONTAINER, GB_delete(), GB_entry(), GB_search(), gb_search_system_folder_rek(), GB_SYSTEM_FOLDER, and GB_warning().
Referenced by gb_read_bin().
|
inline |
Definition at line 640 of file ad_load.cxx.
References gb_assert, gb_read_bin_error(), gb_read_in_uint32(), and GBS_global_string().
Referenced by gb_read_bin().
|
static |
Definition at line 652 of file ad_load.cxx.
References ALLOWED_DATES, ALLOWED_KEYS, buffer, GB_MAIN_TYPE::clock, GB_MAIN_TYPE::dates, diff(), error(), father, GB_MAIN_TYPE::first_free_key, GB_MAIN_TYPE::free_all_keys(), gb_assert, GB_await_error(), GB_begin_transaction(), GB_commit_transaction(), gb_create_key(), GB_export_error(), GB_FATHER(), GB_follow_unix_link(), gb_get_number(), GB_give_buffer(), GB_informationf(), GB_internal_errorf(), gb_is_valid_mapfile(), GB_KEY_LEN_MAX, gb_local, gb_main_array, GB_MAIN_ARRAY_SIZE, gb_map_mapfile(), gb_mapfile_name(), GB_MIND_CASE, GB_mode_of_link(), gb_read_bin_error(), gb_read_bin_rek_V2(), gb_read_in_uint32(), gb_search_system_folder(), GB_time_of_file(), GBCONTAINER_MAIN(), gbm_free_mem(), GBS_create_hash(), GBS_global_string(), GBDATA::index, gb_Key::key, GB_MAIN_TYPE::key_2_index_hash, GB_MAIN_TYPE::keycnt, GB_MAIN_TYPE::keys, GB_MAIN_TYPE::last_updated, gb_map_header::main_idx, GBCONTAINER::main_idx, GB_MAIN_TYPE::mapped, gb_Key::next_free_key, gb_Key::nref, gb_Key::nref_last_saved, NULp, GB_MAIN_TYPE::path, quark2gbmindex(), read_keyword(), GB_MAIN_TYPE::root_container, gb_local_data::search_system_folder, SET_GB_FATHER(), and SET_GBCONTAINER_ELEM().
Referenced by GB_login().
void GB_set_next_main_idx | ( | long | idx | ) |
Definition at line 918 of file ad_load.cxx.
Referenced by ARB_main().
GB_MAIN_IDX gb_make_main_idx | ( | GB_MAIN_TYPE * | Main | ) |
Definition at line 922 of file ad_load.cxx.
References gb_assert, gb_main_array, GB_MAIN_ARRAY_SIZE, GB_random(), initialized, NULp, and short.
Referenced by GB_login(), and gb_save_mapfile().
|
inline |
Definition at line 982 of file ad_load.cxx.
References GBTUM_MAGIC_NUMBER, and GBTUM_MAGIC_REVERSED.
Referenced by GB_login(), and GBT_check_arb_file().
|
inline |
Definition at line 987 of file ad_load.cxx.
References buffer, and reverse_byteorder().
Referenced by GB_login(), and GBT_check_arb_file().
Definition at line 1010 of file ad_load.cxx.
References error(), GB_await_error(), GB_CREATE_CONTAINER, GB_search(), GB_set_temporary(), and NULp.
Referenced by GB_login().
open an ARB database
cpath | arb database. May be
|
opent | contains one or more of the following characters:
|
user | username |
Definition at line 1022 of file ad_load.cxx.
References GB_MAIN_TYPE::allow_corrupt_file_recovery, ARB_strBeginsWith(), ARB_strdup(), ARB_zfclose(), ARB_zfopen(), ASSERT_RESULT, GB_MAIN_TYPE::clock, arb_progress::done(), GB_MAIN_TYPE::dummy_father, error(), FILESIZE_GRANULARITY, gb_assert, GB_await_error(), GB_begin_transaction(), GB_clear_error(), GB_commit_transaction(), gb_convert_V2_to_V3(), gb_create_key(), gb_delete_dummy_father(), GB_disable_quicksave(), GB_export_error(), gb_findExtension(), GB_informationf(), GB_init_gb(), GB_install_pid(), gb_load_key_data_and_dictionaries(), gb_make_container(), gb_make_main_idx(), GB_MIND_CASE, gb_oldQuicksaveName(), gb_open_all, gb_open_read_only_all, GB_print_error(), GB_property_file(), gb_quicksaveName(), gb_read_ascii_beyond_header(), gb_read_bin(), gb_read_in_uint32(), gb_resort_system_folder_to_top(), gb_scan_directory(), GB_SCAN_NEW_QUICK, GB_SCAN_NO_QUICK, GB_SCAN_OLD_QUICK, GB_size_of_FILE(), GB_time_of_file(), GB_warning(), gbcm_login(), gbcm_logout(), GBK_terminatef(), GBS_global_string(), GBS_string_matches(), GBT_install_message_handler(), GBTUM_MAGIC_NUMBER, has_ascii_db_id(), gb_scandir::highest_quick_index, init_tmp_branch(), is_binary_db_id(), GB_MAIN_TYPE::is_server(), gb_quick_save::last_index, GB_MAIN_TYPE::login_remote(), GBCONTAINER::main_idx, GB_MAIN_TYPE::mark_as_server(), gb_scandir::newest_quick_index, NULp, GB_MAIN_TYPE::opentype, GB_MAIN_TYPE::qs, GB_MAIN_TYPE::root_container, GB_MAIN_TYPE::security_level, GBDATA::server_id, gb_scandir::type, warning(), ZFILE_AUTODETECT, and ZFILE_UNCOMPRESSED.
Referenced by GB_open().
Definition at line 1363 of file ad_load.cxx.
References GB_getenvUSER(), and GB_login().
Referenced by ARB_main(), ArbImporter::ArbImporter(), FINAL_TYPE< SEQTYPE >::ArbWriter(), calc_pvp(), check_socket_available(), export_newick(), export_seq_data(), GBT_open(), main(), ALI_ARBDB::open(), AP_main::open(), PH_root::open(), openArb(), probe_read_data_base(), run_command(), run_server(), and save_tree_as_newick().
Checks whether a file is an arb file (or ':')
Definition at line 1369 of file ad_load.cxx.
References ARB_zfclose(), ARB_zfopen(), error(), gb_assert, GB_is_regularfile(), gb_read_in_uint32(), GBS_global_string(), has_ascii_db_id(), is_binary_db_id(), NULp, and ZFILE_AUTODETECT.
Referenced by check_argument_for_mode(), and detectArgType().
|
static |
Definition at line 30 of file ad_load.cxx.
|
static |
Definition at line 916 of file ad_load.cxx.