The world's most popular open source database
#include <ndb_global.h>#include "InitConfigFileParser.hpp"#include "Config.hpp"#include "MgmtErrorReporter.hpp"#include <NdbOut.hpp>#include "ConfigInfo.hpp"#include <m_string.h>#include <my_sys.h>#include <my_getopt.h>Include dependency graph for InitConfigFileParser.cpp:

Go to the source code of this file.
Functions | |
| static void | trim (char *) |
| static void | require (bool v) |
| static my_bool | parse_mycnf_opt (int, const struct my_option *opt, char *value) |
| static int | load_defaults (Vector< struct my_option > &options, const char *groups[]) |
Variables | |
| const int | MAX_LINE_LENGTH = 1024 |
| static int | order = 1 |
Definition at line 685 of file InitConfigFileParser.cpp.
References BaseString::assfmt(), BaseString::c_str(), defaults_extra_file, defaults_file, defaults_group_suffix, handle_options(), load_defaults(), options(), and parse_mycnf_opt().
00686 { 00687 int argc = 1; 00688 const char * argv[] = { "ndb_mgmd", 0, 0, 0, 0 }; 00689 BaseString file; 00690 BaseString extra_file; 00691 BaseString group_suffix; 00692 00693 const char *save_file = defaults_file; 00694 char *save_extra_file = defaults_extra_file; 00695 const char *save_group_suffix = defaults_group_suffix; 00696 00697 if (defaults_file) 00698 { 00699 file.assfmt("--defaults-file=%s", defaults_file); 00700 argv[argc++] = file.c_str(); 00701 } 00702 00703 if (defaults_extra_file) 00704 { 00705 extra_file.assfmt("--defaults-extra-file=%s", defaults_extra_file); 00706 argv[argc++] = extra_file.c_str(); 00707 } 00708 00709 if (defaults_group_suffix) 00710 { 00711 group_suffix.assfmt("--defaults-group-suffix=%s", defaults_group_suffix); 00712 argv[argc++] = group_suffix.c_str(); 00713 } 00714 00715 char ** tmp = (char**)argv; 00716 int ret = load_defaults("my", groups, &argc, &tmp); 00717 00718 defaults_file = save_file; 00719 defaults_extra_file = save_extra_file; 00720 defaults_group_suffix = save_group_suffix; 00721 00722 if (ret == 0) 00723 { 00724 return handle_options(&argc, &tmp, options.getBase(), parse_mycnf_opt); 00725 } 00726 00727 return ret; 00728 }
Here is the call graph for this function:

Definition at line 614 of file InitConfigFileParser.cpp.
References my_option::app_type, and opt().
Referenced by load_defaults().
00615 { 00616 if(opt->comment) 00617 ((struct my_option *)opt)->app_type++; 00618 else 00619 ((struct my_option *)opt)->app_type = order++; 00620 return 0; 00621 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void require | ( | bool | v | ) | [static] |
Definition at line 29 of file InitConfigFileParser.cpp.
References abort().
00029 { if(!v) abort();}
Here is the call graph for this function:

| static void trim | ( | char * | ) | [static] |
Definition at line 444 of file InitConfigFileParser.cpp.
References memmove, pos(), and strlen().
00444 { 00445 int len = strlen(str); 00446 for(len--; 00447 (str[len] == '\r' || str[len] == '\n' || 00448 str[len] == ' ' || str[len] == '\t') && 00449 len > 0; 00450 len--) 00451 str[len] = 0; 00452 00453 int pos = 0; 00454 while(str[pos] == ' ' || str[pos] == '\t') 00455 pos++; 00456 00457 if(str[pos] == '\"' && str[len] == '\"') { 00458 pos++; 00459 str[len] = 0; 00460 len--; 00461 } 00462 00463 memmove(str, &str[pos], len - pos + 2); 00464 }
Here is the call graph for this function:

| const int MAX_LINE_LENGTH = 1024 |
Definition at line 26 of file InitConfigFileParser.cpp.
int order = 1 [static] |
Definition at line 611 of file InitConfigFileParser.cpp.
Referenced by add_proc_to_list(), add_to_list(), copy_data_between_tables(), create_distinct_group(), create_sort_index(), eq_ref_table(), TaoCrypt::HASHwithTransform::Final(), find_order_in_list(), get_index_for_order(), inflate(), inflateBack(), init_order(), main(), make_unireg_sortorder(), mysql_delete(), mysql_prepare_update(), mysql_select(), only_eq_ref_tables(), Dbtup::prepare_initial_insert(), reinit_stmt_before_use(), remove_const(), setup_group(), setup_order(), setup_without_group(), Dbtup::setUpKeyArray(), test_if_order_by_key(), test_if_skip_sort_order(), test_if_subkey(), update_depend_map(), and Item_subselect::walk().
1.4.7

