MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / parse_args

Method parse_args

src/jrd/validation.cpp:887–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887void Validation::parse_args(thread_db* tdbb)
888{
889 Switches local_sw_table(val_option_in_sw_table, FB_NELEM(val_option_in_sw_table), true, true);
890
891 const char** argv = vdr_service->argv.begin();
892 const char* const* end = vdr_service->argv.end();
893 for (++argv; argv < end; argv++)
894 {
895 if (!*argv)
896 continue;
897
898 string arg(*argv);
899 Switches::in_sw_tab_t* sw = local_sw_table.findSwitchMod(arg);
900 if (!sw)
901 continue;
902
903 if (sw->in_sw_state)
904 {
905 string s;
906 s.printf("Switch %s specified more than once", sw->in_sw_name);
907
908 (Arg::Gds(isc_random) << Arg::Str(s)).raise();
909 }
910
911 sw->in_sw_state = true;
912
913 switch (sw->in_sw)
914 {
915 case IN_SW_VAL_TAB_INCL:
916 case IN_SW_VAL_TAB_EXCL:
917 case IN_SW_VAL_IDX_INCL:
918 case IN_SW_VAL_IDX_EXCL:
919 case IN_SW_VAL_LOCK_TIMEOUT:
920 *argv++ = NULL;
921 if (argv >= end || !(*argv))
922 {
923 string s;
924 s.printf("Switch %s requires value", sw->in_sw_name);
925
926 (Arg::Gds(isc_random) << Arg::Str(s)).raise();
927 }
928 break;
929
930 default:
931 break;
932 }
933
934 switch (sw->in_sw)
935 {
936 case IN_SW_VAL_TAB_INCL:
937 vdr_tab_incl = createPatternMatcher(tdbb, *argv);
938 break;
939
940 case IN_SW_VAL_TAB_EXCL:
941 vdr_tab_excl = createPatternMatcher(tdbb, *argv);
942 break;
943
944 case IN_SW_VAL_IDX_INCL:

Callers 1

benchplot.pyFile · 0.80

Calls 8

GdsClass · 0.85
StrClass · 0.85
createPatternMatcherFunction · 0.85
findSwitchModMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
printfMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected