1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

added stub of client implementation

This commit is contained in:
Falk Werner
2020-06-11 09:10:14 +02:00
parent 81fd41f46a
commit dcbe4f075a
7 changed files with 194 additions and 35 deletions

View File

@@ -8,6 +8,8 @@
#include "webfuse/core/util.h"
#include "webfuse/adapter/impl/client.h"
// server
struct wf_server * wf_server_create(
@@ -201,39 +203,35 @@ wf_client_create(
wf_client_callback_fn * callback,
void * user_data)
{
(void) callback;
(void) user_data;
return NULL;
return wf_impl_client_create(callback, user_data);
}
void
wf_client_dispose(
struct wf_client * client)
{
(void) client;
wf_impl_client_dispose(client);
}
void *
wf_client_get_userdata(
struct wf_client * client)
{
(void) client;
return NULL;
return wf_impl_client_get_userdata(client);
}
void
wf_client_service(
struct wf_client * client)
{
(void) client;
wf_impl_client_service(client);
}
void
wf_client_interrupt(
struct wf_client * client)
{
(void) client;
wf_impl_client_interrupt(client);
}
void
@@ -241,22 +239,21 @@ wf_client_connect(
struct wf_client * client,
char const * url)
{
(void) client;
(void) url;
wf_impl_client_connect(client, url);
}
void
wf_client_disconnect(
struct wf_client * client)
{
(void) client;
wf_impl_client_disconnect(client);
}
void
wf_client_authenticate(
struct wf_client * client)
{
(void) client;
wf_impl_client_authenticate(client);
}
void
@@ -265,8 +262,6 @@ wf_client_add_filesystem(
char const * local_path,
char const * name)
{
(void) client;
(void) local_path;
(void) name;
wf_impl_client_add_filesystem(client, local_path, name);
}

View File

@@ -0,0 +1,87 @@
#include "webfuse/adapter/impl/client.h"
#include <stdlib.h>
struct wf_client
{
wf_client_callback_fn * callback;
void * user_data;
};
struct wf_client *
wf_impl_client_create(
wf_client_callback_fn * callback,
void * user_data)
{
struct wf_client * client = malloc(sizeof(struct wf_client));
client->callback = callback;
client->user_data = user_data;
client->callback(client, WF_CLIENT_CREATED, NULL);
return client;
}
void
wf_impl_client_dispose(
struct wf_client * client)
{
client->callback(client, WF_CLIENT_DISPOSING, NULL);
free(client);
}
void *
wf_impl_client_get_userdata(
struct wf_client * client)
{
return client->user_data;
}
void
wf_impl_client_service(
struct wf_client * client)
{
(void) client;
}
void
wf_impl_client_interrupt(
struct wf_client * client)
{
(void) client;
}
void
wf_impl_client_connect(
struct wf_client * client,
char const * url)
{
(void) url;
client->callback(client, WF_CLIENT_DISCONNECTED, NULL);
}
void
wf_impl_client_disconnect(
struct wf_client * client)
{
(void) client;
}
void
wf_impl_client_authenticate(
struct wf_client * client)
{
client->callback(client, WF_CLIENT_AUTHENTICATION_FAILED, NULL);
}
void
wf_impl_client_add_filesystem(
struct wf_client * client,
char const * local_path,
char const * name)
{
(void) local_path;
(void) name;
client->callback(client, WF_CLIENT_FILESYSTEM_ADD_FAILED, NULL);
}

View File

@@ -0,0 +1,57 @@
#ifndef WF_ADAPTER_IMPL_CLIENT_H
#define WF_ADAPTER_IMPL_CLIENT_H
#include "webfuse/adapter/client_callback.h"
#ifdef __cplusplus
extern "C"
{
#endif
extern struct wf_client *
wf_impl_client_create(
wf_client_callback_fn * callback,
void * user_data);
extern void
wf_impl_client_dispose(
struct wf_client * client);
extern void *
wf_impl_client_get_userdata(
struct wf_client * client);
extern void
wf_impl_client_service(
struct wf_client * client);
extern void
wf_impl_client_interrupt(
struct wf_client * client);
extern void
wf_impl_client_connect(
struct wf_client * client,
char const * url);
extern void
wf_impl_client_disconnect(
struct wf_client * client);
extern void
wf_impl_client_authenticate(
struct wf_client * client);
extern void
wf_impl_client_add_filesystem(
struct wf_client * client,
char const * local_path,
char const * name);
#ifdef __cplusplus
}
#endif
#endif