mirror of
https://github.com/falk-werner/webfused
synced 2024-10-27 20:44:08 +00:00
separated main
This commit is contained in:
parent
d8e1fcd426
commit
d304c843bc
@ -48,12 +48,15 @@ target_include_directories(userdb PUBLIC
|
|||||||
|
|
||||||
target_compile_options(userdb PUBLIC ${OPENSSL_CFLAGS_OTHER})
|
target_compile_options(userdb PUBLIC ${OPENSSL_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
add_library(webfused-static STATIC
|
||||||
|
src/webfused/daemon.c)
|
||||||
|
|
||||||
add_executable(webfused
|
add_executable(webfused
|
||||||
src/daemon/main.c
|
src/webfused/main.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(webfused PUBLIC
|
target_link_libraries(webfused PUBLIC
|
||||||
|
webfused-static
|
||||||
userdb
|
userdb
|
||||||
${LIBCONFIG_LIBRARIES}
|
${LIBCONFIG_LIBRARIES}
|
||||||
${OPENSSL_LIBRARIES}
|
${OPENSSL_LIBRARIES}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "webfused/daemon.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -154,7 +156,7 @@ static void on_interrupt(int signal_id)
|
|||||||
shutdown_requested = true;
|
shutdown_requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
int wfd_daemon_run(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
struct args args;
|
struct args args;
|
||||||
args.config = wf_server_config_create();
|
args.config = wf_server_config_create();
|
15
src/webfused/daemon.h
Normal file
15
src/webfused/daemon.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef WFD_DAEMON_H
|
||||||
|
#define WFD_DAEMON_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern int wfd_daemon_run(int argc, char * argv[]);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
6
src/webfused/main.c
Normal file
6
src/webfused/main.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "webfused/daemon.h"
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
return wfd_daemon_run(argc, argv);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user