mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
added skeleton of provider example app
This commit is contained in:
@@ -1,2 +1,82 @@
|
||||
#include "wsfsp/client.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "wsfsp/provider.h"
|
||||
|
||||
struct wsfsp_client
|
||||
{
|
||||
volatile bool is_running;
|
||||
struct wsfsp_provider provider;
|
||||
void * user_data;
|
||||
};
|
||||
|
||||
|
||||
struct wsfsp_client * wsfsp_client_create(
|
||||
struct wsfsp_provider * provider,
|
||||
void * user_data)
|
||||
{
|
||||
struct wsfsp_client * client = malloc(sizeof(struct wsfsp_client));
|
||||
if (NULL != client)
|
||||
{
|
||||
client->is_running = true;
|
||||
client->user_data = user_data;
|
||||
memcpy(&client->provider, provider, sizeof(struct wsfsp_provider));
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
void wsfsp_client_dispose(
|
||||
struct wsfsp_client * client)
|
||||
{
|
||||
free(client);
|
||||
}
|
||||
|
||||
void wsfsp_client_connect(
|
||||
struct wsfsp_client * client,
|
||||
char const * url)
|
||||
{
|
||||
(void) client;
|
||||
(void) url;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_client_disconnect(
|
||||
struct wsfsp_client * client)
|
||||
{
|
||||
(void) client;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_client_settimeout(
|
||||
struct wsfsp_client * client,
|
||||
unsigned int timepoint)
|
||||
{
|
||||
(void) client;
|
||||
(void) timepoint;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
|
||||
void wsfsp_client_run(
|
||||
struct wsfsp_client * client)
|
||||
{
|
||||
while (client->is_running)
|
||||
{
|
||||
// ToDo: implement me
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void wsfsp_client_shutdown(
|
||||
struct wsfsp_client * client)
|
||||
{
|
||||
client->is_running = false;
|
||||
}
|
||||
|
||||
|
||||
63
lib/wsfsp/provider.c
Normal file
63
lib/wsfsp/provider.c
Normal file
@@ -0,0 +1,63 @@
|
||||
#include "wsfsp/provider.h"
|
||||
|
||||
void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
int status)
|
||||
{
|
||||
(void) request;
|
||||
(void) status;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_respond_lookup(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat)
|
||||
{
|
||||
(void) request;
|
||||
(void) stat;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_respond_getattr(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat)
|
||||
{
|
||||
(void) request;
|
||||
(void) stat;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_respond_readdir(
|
||||
struct wsfsp_request * request,
|
||||
struct wsfsp_dirbuffer * dirbuffer)
|
||||
{
|
||||
(void) request;
|
||||
(void) dirbuffer;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
uint32_t handle)
|
||||
{
|
||||
(void) request;
|
||||
(void) handle;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
void wsfsp_respond_read(
|
||||
struct wsfsp_request * request,
|
||||
char const * data,
|
||||
size_t length)
|
||||
{
|
||||
(void) request;
|
||||
(void) data;
|
||||
(void) length;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
Reference in New Issue
Block a user