]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Use only one copy of struct select_conf.
authorAndre Noll <maan@systemlinux.org>
Mon, 23 Jun 2008 11:53:57 +0000 (13:53 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 23 Jun 2008 11:53:57 +0000 (13:53 +0200)
Previously, we had one copy in select.c and another copy in
interactive.c. Define a single copy in adu.c instead and use
it from both interactive.c and select.c.

adu.c
adu.h
interactive.c
select.c

diff --git a/adu.c b/adu.c
index 09619cfcecdcc49685c218d4249322fa92824fa7..02bfa302779ccdf5bc299e8a6a81f5b3c2fb8f60 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -8,6 +8,7 @@
 #include "string.h"
 #include "error.h"
 #include "portable_io.h"
+#include "select.cmdline.h"
 
 DEFINE_ERRLIST;
 int osl_errno;
@@ -18,6 +19,9 @@ static int signum;
 /** Command line and config file options. */
 struct gengetopt_args_info conf;
 
+/** Options passed to --select-options. */
+struct select_args_info select_conf;
+
 /** The number of different uids found so far. */
 uint32_t num_uids = 0;
 
diff --git a/adu.h b/adu.h
index 70dba7764677e30df5c5bf50b2675005c4ac079b..60966921219462236bb6109da2172c60590ced6d 100644 (file)
--- a/adu.h
+++ b/adu.h
@@ -178,6 +178,7 @@ enum search_uid_flags {
 extern uint32_t num_uids;
 extern struct osl_table *dir_table;
 extern struct gengetopt_args_info conf;
+extern struct select_args_info select_conf;
 
 /* adu.c */
 __printf_2_3 void __log(int, const char*, ...);
index 8b27c0c79837c733b9f2c056e27ed7d5e5c7097a..376ab48b627f499c29cd896b318feb2fad38a1ee 100644 (file)
@@ -4,8 +4,6 @@
 #include "cmdline.h"
 #include "select.cmdline.h"
 
-struct select_args_info select_conf;
-
 struct interactive_command {
        const char *name;
        int (*handler)(char *);
index 0c73a587585543c4690753a3f774abee68de2ad3..9353c5f8edd18373eafd074f6db989b91b212368 100644 (file)
--- a/select.c
+++ b/select.c
@@ -77,7 +77,6 @@ static const uint64_t count_unit_divisors[] = {
 
 static const char size_unit_abbrevs[] = " BKMGT";
 static const char count_unit_abbrevs[] = "  kmgt";
-struct select_args_info select_conf;
 static struct uid_range *admissible_uids;
 
 static enum enum_size_unit format_size_value(enum enum_size_unit unit,