From 6092cf59d7f5d1c0d915c65bde20fdc98f80c950 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 25 Nov 2008 16:45:11 -0500 Subject: Make a binary out of each major sssd component instead of using the same binary to fork off all services. --- server/util/util.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'server/util/util.h') diff --git a/server/util/util.h b/server/util/util.h index 6e30cfd28..1c3fa2e77 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -10,6 +10,10 @@ extern const char *debug_prg_name; extern int debug_level; void debug_fn(const char *format, ...); +#define SSSD_DEBUG_OPTS \ + {"debug-level", 'd', POPT_ARG_INT, &debug_level, 0, \ + "Debug level", NULL}, + #define DEBUG(level, body) do { \ if (level <= debug_level) { \ debug_fn("[%s] [%s] (%d): ", \ @@ -30,11 +34,24 @@ void debug_fn(const char *format, ...); #define EOK 0 +#define SSSD_MAIN_OPTS SSSD_DEBUG_OPTS + +#define FLAGS_NONE 0x0000 +#define FLAGS_DAEMON 0x0001 +#define FLAGS_INTERACTIVE 0x0002 +#define FLAGS_PID_FILE 0x0004 + +struct main_context { + struct event_context *event_ctx; + struct confdb_ctx *confdb_ctx; +}; + #include "util/dlinklist.h" -/* from become_daemon.c */ -void become_daemon(bool Fork); -int pidfile(const char *path, const char *name); +/* from server.c */ +int server_setup(const char *name, int flags, + struct main_context **main_ctx); +void server_loop(struct main_context *main_ctx); /* from signal.c */ #include -- cgit