X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=blobdiff_plain;f=select.c;h=4795de453adc095bdd0bf80134c5d4478dc40343;hp=e3d97b11ef7893f09ba89008aa1994b30318fc39;hb=e2fe978a3fa04160d60a4d39659f05798d356fab;hpb=0144f2253169466ca4c8b2434dca070aa14e491a diff --git a/select.c b/select.c index e3d97b1..4795de4 100644 --- a/select.c +++ b/select.c @@ -584,27 +584,9 @@ out: return ret; } -int com_select(void) +int run_select_query(struct uid_range *admissible_uids) { int ret; - struct uid_range *admissible_uids = NULL; - - if (conf.select_options_given) { - struct select_cmdline_parser_params params = { - .override = 1, - .initialize = 1, - .check_required = 1, - .check_ambiguity = 1, - .print_errors = 1 - }; - - if (select_cmdline_parser_string_ext(conf.select_options_arg, - &select_conf, "select", ¶ms)) - return -E_SYNTAX; - ret = parse_uid_arg(select_conf.uid_arg, &admissible_uids); - if (ret < 0) - return ret; - } if (select_conf.count_unit_arg != count_unit_arg_h) count_unit_buf[1] = count_unit_abbrevs[select_conf.count_unit_arg]; @@ -627,3 +609,27 @@ int com_select(void) close_all_tables(); return ret; } + +int com_select(void) +{ + int ret; + struct uid_range *admissible_uids = NULL; + + if (conf.select_options_given) { + struct select_cmdline_parser_params params = { + .override = 1, + .initialize = 1, + .check_required = 1, + .check_ambiguity = 1, + .print_errors = 1 + }; + + if (select_cmdline_parser_string_ext(conf.select_options_arg, + &select_conf, "select", ¶ms)) + return -E_SYNTAX; + ret = parse_uid_arg(select_conf.uid_arg, &admissible_uids); + if (ret < 0) + return ret; + } + return run_select_query(admissible_uids); +}