2019-03-26 14:35:33 +00:00
|
|
|
#ifndef WSFS_PROVIDER_IMPL_PROVIDER_H
|
|
|
|
#define WSFS_PROVIDER_IMPL_PROVIDER_H
|
2019-03-04 20:18:16 +00:00
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
#include <jansson.h>
|
2019-03-04 20:18:16 +00:00
|
|
|
#include "wsfs/provider/client_config.h"
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
2019-03-04 20:18:16 +00:00
|
|
|
|
|
|
|
struct wsfsp_provider
|
|
|
|
{
|
|
|
|
wsfsp_connected_fn * connected;
|
|
|
|
wsfsp_disconnected_fn * disconnected;
|
|
|
|
wsfsp_ontimer_fn * ontimer;
|
|
|
|
wsfsp_lookup_fn * lookup;
|
|
|
|
wsfsp_getattr_fn * getattr;
|
|
|
|
wsfsp_readdir_fn * readdir;
|
|
|
|
wsfsp_open_fn * open;
|
|
|
|
wsfsp_close_fn * close;
|
|
|
|
wsfsp_read_fn * read;
|
|
|
|
};
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
struct wsfsp_impl_invokation_context
|
2019-03-04 20:18:16 +00:00
|
|
|
{
|
|
|
|
struct wsfsp_provider * provider;
|
|
|
|
void * user_data;
|
|
|
|
struct wsfsp_request * request;
|
|
|
|
};
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_provider_init(
|
2019-03-04 20:18:16 +00:00
|
|
|
struct wsfsp_provider * provider);
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_provider_init_from_prototype(
|
2019-03-04 20:18:16 +00:00
|
|
|
struct wsfsp_provider * provider,
|
|
|
|
struct wsfsp_provider const * prototype);
|
|
|
|
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_provider_invoke(
|
|
|
|
struct wsfsp_impl_invokation_context * context,
|
2019-03-04 20:18:16 +00:00
|
|
|
json_t * request);
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_connected_default(
|
2019-03-04 20:18:16 +00:00
|
|
|
void * user_data);
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_disconnected_default(
|
2019-03-04 20:18:16 +00:00
|
|
|
void * user_data);
|
|
|
|
|
2019-03-26 14:35:33 +00:00
|
|
|
extern void wsfsp_impl_ontimer_default(
|
2019-03-04 20:18:16 +00:00
|
|
|
void * user_data);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|