Make it easier to print the help for select options.
[adu.git] / adu.h
diff --git a/adu.h b/adu.h
index f1d4fba029e6e79644e260d7db7566ae7c2b8ee2..85ab63a6e04db918f14f37e3e5f40d9294cb555a 100644 (file)
--- a/adu.h
+++ b/adu.h
@@ -8,7 +8,7 @@
 
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/wait.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h> /* time(), localtime() */
 #include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
-#include <ctype.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <sys/un.h> /* needed by create_pf_socket */
+#include <inttypes.h>
 #include <string.h>
 #include <assert.h>
 #include <osl.h>
 #include "gcc-compat.h"
+#include "select.cmdline.h"
 
 /** debug loglevel, gets really noisy */
 #define DEBUG 1
@@ -177,9 +174,12 @@ enum search_uid_flags {
        CREATE_USER_TABLE = 2,
 };
 
+#define FOR_EACH_UID_RANGE(ur, urs) for (ur = urs; ur->low <= ur->high; ur++)
+
 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*, ...);
@@ -188,14 +188,15 @@ void check_signals(void);
 void close_all_tables(void);
 char *get_uid_list_name(void);
 void create_hash_table(unsigned bits);
-int search_uid(uint32_t uid, enum search_uid_flags flags,
-               struct user_info **ui_ptr);
+int search_uid(uint32_t uid, struct uid_range *urs,
+               enum search_uid_flags flags, struct user_info **ui_ptr);
 int for_each_admissible_user(int (*func)(struct user_info *, void *),
                void *data);
 void sort_hash_table(int (*comp)(const void *, const void *));
 
-/* select.c */
-int com_select(void);
-
-/* create.h */
+/* create.c */
 int com_create(void);
+
+/* interactive.c */
+void print_interactive_help(void);
+int com_interactive(void);