diff --git a/include/wsfs/adapter/authenticate.h b/include/wsfs/adapter/authenticate.h index 9e630ee..c34d402 100644 --- a/include/wsfs/adapter/authenticate.h +++ b/include/wsfs/adapter/authenticate.h @@ -5,11 +5,19 @@ #include #endif +#ifdef __cplusplus +extern "C" +{ +#endif + struct wsfs_credentials; typedef bool wsfs_authenticate_fn( struct wsfs_credentials * credentials, void * user_data); +#ifdef __cplusplus +} +#endif #endif diff --git a/include/wsfs/adapter/credentials.h b/include/wsfs/adapter/credentials.h index 747b107..9e77113 100644 --- a/include/wsfs/adapter/credentials.h +++ b/include/wsfs/adapter/credentials.h @@ -3,13 +3,13 @@ #include "wsfs/adapter/api.h" -struct wsfs_credentials; - #ifdef __cplusplus extern "C" { #endif +struct wsfs_credentials; + extern WSFSA_API char const * wsfs_credentials_type( struct wsfs_credentials const * credentials); diff --git a/include/wsfs/adapter/server.h b/include/wsfs/adapter/server.h index 7886251..3a27bdc 100644 --- a/include/wsfs/adapter/server.h +++ b/include/wsfs/adapter/server.h @@ -3,14 +3,14 @@ #include "wsfs/adapter/api.h" -struct wsfs_server; -struct wsfs_server_config; - #ifdef __cplusplus extern "C" { #endif +struct wsfs_server; +struct wsfs_server_config; + extern WSFSA_API struct wsfs_server * wsfs_server_create( struct wsfs_server_config * config); diff --git a/include/wsfs/adapter/server_config.h b/include/wsfs/adapter/server_config.h index 639e1c1..8983693 100644 --- a/include/wsfs/adapter/server_config.h +++ b/include/wsfs/adapter/server_config.h @@ -4,13 +4,13 @@ #include "wsfs/adapter/api.h" #include "wsfs/adapter/authenticate.h" -struct wsfs_server_config; - #ifdef __cplusplus extern "C" { #endif +struct wsfs_server_config; + extern WSFSA_API struct wsfs_server_config * wsfs_server_config_create(void); extern WSFSA_API void wsfs_server_config_dispose( diff --git a/include/wsfs/adapter/server_protocol.h b/include/wsfs/adapter/server_protocol.h index 0579677..bfa33ee 100644 --- a/include/wsfs/adapter/server_protocol.h +++ b/include/wsfs/adapter/server_protocol.h @@ -4,14 +4,14 @@ #include #include -struct wsfs_server_protocol; -struct lws_protocols; - #ifdef __cplusplus extern "C" { #endif +struct wsfs_server_protocol; +struct lws_protocols; + extern WSFSA_API struct wsfs_server_protocol * wsfs_server_protocol_create( char * mount_point); diff --git a/lib/wsfs/adapter/api.c b/lib/wsfs/adapter/api.c index 5af1b1a..05121e8 100644 --- a/lib/wsfs/adapter/api.c +++ b/lib/wsfs/adapter/api.c @@ -1,6 +1,65 @@ #include "wsfs_adapter.h" -#include "wsfs/adapter/impl/credentials.h" + +#include "wsfs/adapter/impl/server.h" +#include "wsfs/adapter/impl/server_protocol.h" #include "wsfs/adapter/impl/server_config.h" +#include "wsfs/adapter/impl/credentials.h" + +// server + +struct wsfs_server * wsfs_server_create( + struct wsfs_server_config * config) +{ + return wsfs_impl_server_create(config); +} + +void wsfs_server_dispose( + struct wsfs_server * server) +{ + wsfs_impl_server_dispose(server); +} + +void wsfs_server_run( + struct wsfs_server * server) +{ + wsfs_impl_server_run(server); +} + +void wsfs_server_shutdown( + struct wsfs_server * server) +{ + wsfs_impl_server_shutdown(server); +} + +// server protocol + +struct wsfs_server_protocol * wsfs_server_protocol_create( + char * mount_point) +{ + return wsfs_impl_server_protocol_create(mount_point); +} + +void wsfs_server_protocol_dispose( + struct wsfs_server_protocol * protocol) +{ + wsfs_impl_server_protocol_dispose(protocol); +} + +void wsfs_server_protocol_init_lws( + struct wsfs_server_protocol * protocol, + struct lws_protocols * lws_protocol) +{ + wsfs_impl_server_protocol_init_lws(protocol, lws_protocol); +} + +void wsfs_server_protocol_add_authenticator( + struct wsfs_server_protocol * protocol, + char const * type, + wsfs_authenticate_fn * authenticate, + void * user_data) +{ + wsfs_impl_server_protocol_add_authenticator(protocol, type, authenticate, user_data); +} // server_config diff --git a/lib/wsfs/adapter/impl/authenticator.h b/lib/wsfs/adapter/impl/authenticator.h index 585cc24..fa73cd5 100644 --- a/lib/wsfs/adapter/impl/authenticator.h +++ b/lib/wsfs/adapter/impl/authenticator.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_AUTHENTICATOR_H -#define WSFS_ADAPTER_AUTHENTICATOR_H +#ifndef WSFS_ADAPTER_IMPL_AUTHENTICATOR_H +#define WSFS_ADAPTER_IMPL_AUTHENTICATOR_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/authenticators.h b/lib/wsfs/adapter/impl/authenticators.h index 48b8056..7e88c94 100644 --- a/lib/wsfs/adapter/impl/authenticators.h +++ b/lib/wsfs/adapter/impl/authenticators.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_AUTHENTICATORS_H -#define WSFS_ADAPTER_AUTHENTICATORS_H +#ifndef WSFS_ADAPTER_IMPL_AUTHENTICATORS_H +#define WSFS_ADAPTER_IMPL_AUTHENTICATORS_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/filesystem.h b/lib/wsfs/adapter/impl/filesystem.h index 4de50a9..8772a95 100644 --- a/lib/wsfs/adapter/impl/filesystem.h +++ b/lib/wsfs/adapter/impl/filesystem.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_FILESYSTEM_H -#define WSFS_ADAPTER_FILESYSTEM_H +#ifndef WSFS_ADAPTER_IMPL_FILESYSTEM_H +#define WSFS_ADAPTER_IMPL_FILESYSTEM_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/fuse_wrapper.h b/lib/wsfs/adapter/impl/fuse_wrapper.h index 2f8d72b..0cba5c2 100644 --- a/lib/wsfs/adapter/impl/fuse_wrapper.h +++ b/lib/wsfs/adapter/impl/fuse_wrapper.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_FUSE_H -#define WSFS_ADAPTER_FUSE_H +#ifndef WSFS_ADAPTER_IMPL_FUSE_H +#define WSFS_ADAPTER_IMPL_FUSE_H #ifdef __cplusplus extern "C" { diff --git a/lib/wsfs/adapter/impl/jsonrpc/method.h b/lib/wsfs/adapter/impl/jsonrpc/method.h index 038bce4..d8c2ac4 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/method.h +++ b/lib/wsfs/adapter/impl/jsonrpc/method.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSONRPC_METHOD_H -#define WSFS_ADAPTER_JSONRPC_METHOD_H +#ifndef WSFS_ADAPTER_IMPL_JSONRPC_METHOD_H +#define WSFS_ADAPTER_IMPL_JSONRPC_METHOD_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/jsonrpc/method_intern.h b/lib/wsfs/adapter/impl/jsonrpc/method_intern.h index 84f6ca5..905c92d 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/method_intern.h +++ b/lib/wsfs/adapter/impl/jsonrpc/method_intern.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSONRPC_METHOD_INTERN_H -#define WSFS_ADAPTER_JSONRPC_METHOD_INTERN_H +#ifndef WSFS_ADAPTER_IMPL_JSONRPC_METHOD_INTERN_H +#define WSFS_ADAPTER_IMPL_JSONRPC_METHOD_INTERN_H #include "wsfs/adapter/impl/jsonrpc/method.h" diff --git a/lib/wsfs/adapter/impl/jsonrpc/request.h b/lib/wsfs/adapter/impl/jsonrpc/request.h index 9f28c48..aaf97f0 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/request.h +++ b/lib/wsfs/adapter/impl/jsonrpc/request.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSONRPC_REQUEST_H -#define WSFS_ADAPTER_JSONRPC_REQUEST_H +#ifndef WSFS_ADAPTER_IMPL_JSONRPC_REQUEST_H +#define WSFS_ADAPTER_IMPL_JSONRPC_REQUEST_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/jsonrpc/response.h b/lib/wsfs/adapter/impl/jsonrpc/response.h index 4e6e34a..00189fb 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/response.h +++ b/lib/wsfs/adapter/impl/jsonrpc/response.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSONRPC_RESPONSE_H -#define WSFS_ADAPTER_JSONRPC_RESPONSE_H +#ifndef WSFS_ADAPTER_IMPL_JSONRPC_RESPONSE_H +#define WSFS_ADAPTER_IMPL_JSONRPC_RESPONSE_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/jsonrpc/server.h b/lib/wsfs/adapter/impl/jsonrpc/server.h index a439f99..78235d0 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/server.h +++ b/lib/wsfs/adapter/impl/jsonrpc/server.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSONRPC_SERVER_H -#define WSFS_ADAPTER_JSONRPC_SERVER_H +#ifndef WSFS_ADAPTER_IMPL_JSONRPC_SERVER_H +#define WSFS_ADAPTER_IMPL_JSONRPC_SERVER_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/jsonrpc/util.h b/lib/wsfs/adapter/impl/jsonrpc/util.h index 23370cd..2de676b 100644 --- a/lib/wsfs/adapter/impl/jsonrpc/util.h +++ b/lib/wsfs/adapter/impl/jsonrpc/util.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_JSON_UTIL_H -#define WSFS_ADAPTER_JSON_UTIL_H +#ifndef WSFS_ADAPTER_IMPL_JSON_UTIL_H +#define WSFS_ADAPTER_IMPL_JSON_UTIL_H #include diff --git a/lib/wsfs/adapter/impl/operations.h b/lib/wsfs/adapter/impl/operations.h index 992c08b..480ad85 100644 --- a/lib/wsfs/adapter/impl/operations.h +++ b/lib/wsfs/adapter/impl/operations.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_OPERATIONS -#define WSFS_ADAPTER_OPERATIONS +#ifndef WSFS_ADAPTER_IMPL_OPERATIONS_H +#define WSFS_ADAPTER_IMPL_OPERATIONS_H #include "wsfs/adapter/impl/fuse_wrapper.h" diff --git a/lib/wsfs/adapter/impl/server.c b/lib/wsfs/adapter/impl/server.c index 30c5c81..12b97e2 100644 --- a/lib/wsfs/adapter/impl/server.c +++ b/lib/wsfs/adapter/impl/server.c @@ -9,7 +9,7 @@ #include #include "wsfs/adapter/impl/server_config.h" -#include "wsfs/adapter/impl/server_protocol_intern.h" +#include "wsfs/adapter/impl/server_protocol.h" #define WSFS_DISABLE_LWS_LOG 0 #define WSFS_SERVER_PROTOCOL_COUNT 3 @@ -26,13 +26,13 @@ struct wsfs_server struct lws_context_creation_info info; }; -static bool wsfs_server_tls_enabled( +static bool wsfs_impl_server_tls_enabled( struct wsfs_server * server) { return ((server->config.key_path != NULL) && (server->config.cert_path != NULL)); } -static struct lws_context * wsfs_server_context_create( +static struct lws_context * wsfs_impl_server_context_create( struct wsfs_server * server) { lws_set_log_level(WSFS_DISABLE_LWS_LOG, NULL); @@ -41,7 +41,7 @@ static struct lws_context * wsfs_server_context_create( server->ws_protocols[0].name = "http"; server->ws_protocols[0].callback = lws_callback_http_dummy; server->ws_protocols[1].name = "fs"; - wsfs_server_protocol_init_lws(&server->protocol, &server->ws_protocols[1]); + wsfs_impl_server_protocol_init_lws(&server->protocol, &server->ws_protocols[1]); memset(&server->mount, 0, sizeof(struct lws_http_mount)); server->mount.mount_next = NULL, @@ -66,7 +66,7 @@ static struct lws_context * wsfs_server_context_create( server->info.mounts = NULL; } - if (wsfs_server_tls_enabled(server)) + if (wsfs_impl_server_tls_enabled(server)) { server->info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; server->info.ssl_cert_filepath = server->config.cert_path; @@ -78,7 +78,7 @@ static struct lws_context * wsfs_server_context_create( } -static bool wsfs_server_check_mountpoint( +static bool wsfs_impl_server_check_mountpoint( struct wsfs_server_config * config) { bool result = false; @@ -98,22 +98,22 @@ static bool wsfs_server_check_mountpoint( return result; } -struct wsfs_server * wsfs_server_create( +struct wsfs_server * wsfs_impl_server_create( struct wsfs_server_config * config) { struct wsfs_server * server = NULL; - if (wsfs_server_check_mountpoint(config)) + if (wsfs_impl_server_check_mountpoint(config)) { server = malloc(sizeof(struct wsfs_server)); if (NULL != server) { - if (wsfs_server_protocol_init(&server->protocol, config->mount_point)) + if (wsfs_impl_server_protocol_init(&server->protocol, config->mount_point)) { server->shutdown_requested = false; wsfs_impl_server_config_clone(config, &server->config); wsfs_authenticators_move(&server->config.authenticators, &server->protocol.authenticators); - server->context = wsfs_server_context_create(server); + server->context = wsfs_impl_server_context_create(server); } else { @@ -126,16 +126,16 @@ struct wsfs_server * wsfs_server_create( return server; } -void wsfs_server_dispose( +void wsfs_impl_server_dispose( struct wsfs_server * server) { lws_context_destroy(server->context); - wsfs_server_protocol_cleanup(&server->protocol); + wsfs_impl_server_protocol_cleanup(&server->protocol); wsfs_impl_server_config_cleanup(&server->config); free(server); } -void wsfs_server_run( +void wsfs_impl_server_run( struct wsfs_server * server) { int n = 0; @@ -145,7 +145,7 @@ void wsfs_server_run( } } -void wsfs_server_shutdown( +void wsfs_impl_server_shutdown( struct wsfs_server * server) { server->shutdown_requested = true; diff --git a/lib/wsfs/adapter/impl/server.h b/lib/wsfs/adapter/impl/server.h index bc54837..8185e7d 100644 --- a/lib/wsfs/adapter/impl/server.h +++ b/lib/wsfs/adapter/impl/server.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_SERVER_H -#define WSFS_ADAPTER_SERVER_H +#ifndef WSFS_ADAPTER_IMPL_SERVER_H +#define WSFS_ADAPTER_IMPL_SERVER_H struct wsfs_server; struct wsfs_server_config; @@ -9,16 +9,16 @@ extern "C" { #endif -extern struct wsfs_server * wsfs_server_create( +extern struct wsfs_server * wsfs_impl_server_create( struct wsfs_server_config * config); -extern void wsfs_server_dispose( +extern void wsfs_impl_server_dispose( struct wsfs_server * server); -extern void wsfs_server_run( +extern void wsfs_impl_server_run( struct wsfs_server * server); -extern void wsfs_server_shutdown( +extern void wsfs_impl_server_shutdown( struct wsfs_server * server); #ifdef __cplusplus diff --git a/lib/wsfs/adapter/impl/server_protocol.c b/lib/wsfs/adapter/impl/server_protocol.c index 7129e59..ef4dba9 100644 --- a/lib/wsfs/adapter/impl/server_protocol.c +++ b/lib/wsfs/adapter/impl/server_protocol.c @@ -1,4 +1,4 @@ -#include "wsfs/adapter/impl/server_protocol_intern.h" +#include "wsfs/adapter/impl/server_protocol.h" #include #include @@ -8,7 +8,7 @@ #include "wsfs/adapter/impl/filesystem.h" -static int wsfs_server_protocol_callback( +static int wsfs_impl_server_protocol_callback( struct lws * wsi, enum lws_callback_reasons reason, void * WSFS_UNUSED_PARAM(user), @@ -70,7 +70,7 @@ static int wsfs_server_protocol_callback( return 0; } -static bool wsfs_server_protocol_invoke( +static bool wsfs_impl_server_protocol_invoke( void * user_data, json_t const * request) { @@ -84,13 +84,13 @@ static bool wsfs_server_protocol_invoke( } -struct wsfs_server_protocol * wsfs_server_protocol_create( +struct wsfs_server_protocol * wsfs_impl_server_protocol_create( char * mount_point) { struct wsfs_server_protocol * protocol = malloc(sizeof(struct wsfs_server_protocol)); if (NULL != protocol) { - if (!wsfs_server_protocol_init(protocol, mount_point)) + if (!wsfs_impl_server_protocol_init(protocol, mount_point)) { free(protocol); protocol = NULL; @@ -100,23 +100,23 @@ struct wsfs_server_protocol * wsfs_server_protocol_create( return protocol; } -void wsfs_server_protocol_dispose( +void wsfs_impl_server_protocol_dispose( struct wsfs_server_protocol * protocol) { - wsfs_server_protocol_cleanup(protocol); + wsfs_impl_server_protocol_cleanup(protocol); free(protocol); } -void wsfs_server_protocol_init_lws( +void wsfs_impl_server_protocol_init_lws( struct wsfs_server_protocol * protocol, struct lws_protocols * lws_protocol) { - lws_protocol->callback = &wsfs_server_protocol_callback; + lws_protocol->callback = &wsfs_impl_server_protocol_callback; lws_protocol->per_session_data_size = 0; lws_protocol->user = protocol; } -bool wsfs_server_protocol_init( +bool wsfs_impl_server_protocol_init( struct wsfs_server_protocol * protocol, char * mount_point) { @@ -125,12 +125,12 @@ bool wsfs_server_protocol_init( wsfs_authenticators_init(&protocol->authenticators); wsfs_jsonrpc_server_init(&protocol->rpc, &protocol->timeout_manager); - wsfs_jsonrpc_server_add(&protocol->rpc, "lookup", &wsfs_server_protocol_invoke, protocol); - wsfs_jsonrpc_server_add(&protocol->rpc, "getattr", &wsfs_server_protocol_invoke, protocol); - wsfs_jsonrpc_server_add(&protocol->rpc, "readdir", &wsfs_server_protocol_invoke, protocol); - wsfs_jsonrpc_server_add(&protocol->rpc, "open", &wsfs_server_protocol_invoke, protocol); - wsfs_jsonrpc_server_add(&protocol->rpc, "close", &wsfs_server_protocol_invoke, protocol); - wsfs_jsonrpc_server_add(&protocol->rpc, "read", &wsfs_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "lookup", &wsfs_impl_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "getattr", &wsfs_impl_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "readdir", &wsfs_impl_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "open", &wsfs_impl_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "close", &wsfs_impl_server_protocol_invoke, protocol); + wsfs_jsonrpc_server_add(&protocol->rpc, "read", &wsfs_impl_server_protocol_invoke, protocol); bool const success = wsfs_filesystem_init(&protocol->filesystem, &protocol->rpc, mount_point); @@ -146,7 +146,7 @@ bool wsfs_server_protocol_init( return success; } -void wsfs_server_protocol_cleanup( +void wsfs_impl_server_protocol_cleanup( struct wsfs_server_protocol * protocol) { wsfs_filesystem_cleanup(&protocol->filesystem); @@ -156,7 +156,7 @@ void wsfs_server_protocol_cleanup( wsfs_session_manager_cleanup(&protocol->session_manager); } -void wsfs_server_protocol_add_authenticator( +void wsfs_impl_server_protocol_add_authenticator( struct wsfs_server_protocol * protocol, char const * type, wsfs_authenticate_fn * authenticate, diff --git a/lib/wsfs/adapter/impl/server_protocol.h b/lib/wsfs/adapter/impl/server_protocol.h index d07445d..11e0305 100644 --- a/lib/wsfs/adapter/impl/server_protocol.h +++ b/lib/wsfs/adapter/impl/server_protocol.h @@ -1,27 +1,46 @@ -#ifndef WSFS_ADAPTER_SERVER_PROTOCOL_H -#define WSFS_ADAPTER_SERVER_PROTOCOL_H +#ifndef WSFS_ADAPTER_IMPL_SERVER_PROTOCOL_H +#define WSFS_ADAPTER_IMPL_SERVER_PROTOCOL_H -#include "wsfs/adapter/authenticate.h" - -struct wsfs_server_protocol; -struct lws_protocols; +#include "wsfs/adapter/impl/filesystem.h" +#include "wsfs/adapter/impl/jsonrpc/server.h" +#include "wsfs/adapter/impl/time/timeout_manager.h" +#include "wsfs/adapter/impl/authenticators.h" +#include "wsfs/adapter/impl/session_manager.h" #ifdef __cplusplus extern "C" { #endif -extern struct wsfs_server_protocol * wsfs_server_protocol_create( +struct lws_protocols; + +struct wsfs_server_protocol +{ + struct wsfs_timeout_manager timeout_manager; + struct wsfs_filesystem filesystem; + struct wsfs_jsonrpc_server rpc; + struct wsfs_authenticators authenticators; + struct wsfs_session_manager session_manager; +}; + +extern bool wsfs_impl_server_protocol_init( + struct wsfs_server_protocol * protocol, char * mount_point); -extern void wsfs_server_protocol_dispose( +extern void wsfs_impl_server_protocol_cleanup( struct wsfs_server_protocol * protocol); -extern void wsfs_server_protocol_init_lws( +extern struct wsfs_server_protocol * wsfs_impl_server_protocol_create( + char * mount_point); + +extern void wsfs_impl_server_protocol_dispose( + struct wsfs_server_protocol * protocol); + +extern void wsfs_impl_server_protocol_init_lws( struct wsfs_server_protocol * protocol, struct lws_protocols * lws_protocol); -extern void wsfs_server_protocol_add_authenticator( +extern void wsfs_impl_server_protocol_add_authenticator( struct wsfs_server_protocol * protocol, char const * type, wsfs_authenticate_fn * authenticate, diff --git a/lib/wsfs/adapter/impl/server_protocol_intern.h b/lib/wsfs/adapter/impl/server_protocol_intern.h deleted file mode 100644 index 6edbe9a..0000000 --- a/lib/wsfs/adapter/impl/server_protocol_intern.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef WSFS_ADAPTER_SERVER_PROTOCOL_INTERN_H -#define WSFS_ADAPTER_SERVER_PROTOCOL_INTERN_H - -#include "wsfs/adapter/impl/server_protocol.h" -#include "wsfs/adapter/impl/filesystem.h" -#include "wsfs/adapter/impl/jsonrpc/server.h" -#include "wsfs/adapter/impl/time/timeout_manager.h" -#include "wsfs/adapter/impl/authenticators.h" -#include "wsfs/adapter/impl/session_manager.h" - -struct wsfs_server_protocol -{ - struct wsfs_timeout_manager timeout_manager; - struct wsfs_filesystem filesystem; - struct wsfs_jsonrpc_server rpc; - struct wsfs_authenticators authenticators; - struct wsfs_session_manager session_manager; -}; - -extern bool wsfs_server_protocol_init( - struct wsfs_server_protocol * protocol, - char * mount_point); - -extern void wsfs_server_protocol_cleanup( - struct wsfs_server_protocol * protocol); - -#endif diff --git a/lib/wsfs/adapter/impl/session.h b/lib/wsfs/adapter/impl/session.h index 86d41d8..46dbdb5 100644 --- a/lib/wsfs/adapter/impl/session.h +++ b/lib/wsfs/adapter/impl/session.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_SESSION_H -#define WSFS_ADAPTER_SESSION_H +#ifndef WSFS_ADAPTER_IMPL_SESSION_H +#define WSFS_ADAPTER_IMPL_SESSION_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/session_manager.h b/lib/wsfs/adapter/impl/session_manager.h index 43ec84a..f66bdad 100644 --- a/lib/wsfs/adapter/impl/session_manager.h +++ b/lib/wsfs/adapter/impl/session_manager.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_SESSION_MANAGER_H -#define WSFS_ADAPTER_SESSION_MANAGER_H +#ifndef WSFS_ADAPTER_IMPL_SESSION_MANAGER_H +#define WSFS_ADAPTER_IMPL_SESSION_MANAGER_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/time/timeout_manager.h b/lib/wsfs/adapter/impl/time/timeout_manager.h index ce7d875..8e4fcf7 100644 --- a/lib/wsfs/adapter/impl/time/timeout_manager.h +++ b/lib/wsfs/adapter/impl/time/timeout_manager.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_TIME_TIMEOUT_MANAGER_H -#define WSFS_ADAPTER_TIME_TIMEOUT_MANAGER_H +#ifndef WSFS_ADAPTER_IMPL_TIME_TIMEOUT_MANAGER_H +#define WSFS_ADAPTER_IMPL_TIME_TIMEOUT_MANAGER_H struct wsfs_timer; struct wsfs_timeout_manager diff --git a/lib/wsfs/adapter/impl/time/timeout_manager_intern.h b/lib/wsfs/adapter/impl/time/timeout_manager_intern.h index 0b76c26..304a242 100644 --- a/lib/wsfs/adapter/impl/time/timeout_manager_intern.h +++ b/lib/wsfs/adapter/impl/time/timeout_manager_intern.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_TIME_TIMEOUT_MANAGER_INTERN_H -#define WSFS_ADAPTER_TIME_TIMEOUT_MANAGER_INTERN_H +#ifndef WSFS_ADAPTER_IMPL_TIME_TIMEOUT_MANAGER_INTERN_H +#define WSFS_ADAPTER_IMPL_TIME_TIMEOUT_MANAGER_INTERN_H #include "wsfs/adapter/impl/time/timeout_manager.h" diff --git a/lib/wsfs/adapter/impl/time/timepoint.h b/lib/wsfs/adapter/impl/time/timepoint.h index 44b1418..ed39ff1 100644 --- a/lib/wsfs/adapter/impl/time/timepoint.h +++ b/lib/wsfs/adapter/impl/time/timepoint.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_TIME_TIMEPOINT_H -#define WSFS_ADAPTER_TIME_TIMEPOINT_H +#ifndef WSFS_ADAPTER_IMPL_TIME_TIMEPOINT_H +#define WSFS_ADAPTER_IMPL_TIME_TIMEPOINT_H #ifndef __cplusplus #include diff --git a/lib/wsfs/adapter/impl/time/timer.h b/lib/wsfs/adapter/impl/time/timer.h index 68be653..9be16dd 100644 --- a/lib/wsfs/adapter/impl/time/timer.h +++ b/lib/wsfs/adapter/impl/time/timer.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_TIME_TIMER_H -#define WSFS_ADAPTER_TIME_TIMER_H +#ifndef WSFS_ADAPTER_IMPL_TIME_TIMER_H +#define WSFS_ADAPTER_IMPL_TIME_TIMER_H #include "wsfs/adapter/impl/time/timepoint.h" diff --git a/lib/wsfs/adapter/impl/time/timer_intern.h b/lib/wsfs/adapter/impl/time/timer_intern.h index 209b380..395b8d1 100644 --- a/lib/wsfs/adapter/impl/time/timer_intern.h +++ b/lib/wsfs/adapter/impl/time/timer_intern.h @@ -1,5 +1,5 @@ -#ifndef WSFS_ADAPTER_TIME_TIMER_INTERN_H -#define WSFS_ADAPTER_TIME_TIMER_INTERN_H +#ifndef WSFS_ADAPTER_IMPL_TIME_TIMER_INTERN_H +#define WSFS_ADAPTER_IMPL_TIME_TIMER_INTERN_H #ifndef __cplusplus #include