1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/webfuse_provider/impl/provider.h

62 lines
1.2 KiB
C
Raw Normal View History

2020-06-17 14:51:08 +00:00
#ifndef WFP_IMPL_PROVIDER_H
#define WFP_IMPL_PROVIDER_H
2019-03-26 22:04:53 +00:00
2020-03-01 12:42:46 +00:00
#ifndef __cplusplus
#include <stdbool.h>
#endif
2019-03-26 22:04:53 +00:00
#include <jansson.h>
2020-06-16 21:39:45 +00:00
#include "webfuse_provider/client_config.h"
2019-03-26 22:04:53 +00:00
2020-03-01 12:42:46 +00:00
2019-03-26 22:04:53 +00:00
#ifdef __cplusplus
extern "C"
{
#endif
struct wfp_provider
{
wfp_connected_fn * connected;
wfp_disconnected_fn * disconnected;
wfp_lookup_fn * lookup;
wfp_getattr_fn * getattr;
wfp_readdir_fn * readdir;
wfp_open_fn * open;
wfp_close_fn * close;
wfp_read_fn * read;
2020-02-25 21:05:48 +00:00
wfp_get_credentials_fn * get_credentials;
2019-03-26 22:04:53 +00:00
};
struct wfp_impl_invokation_context
{
2020-03-29 16:38:58 +00:00
struct wfp_provider const * provider;
2019-03-26 22:04:53 +00:00
void * user_data;
struct wfp_request * request;
};
extern void wfp_impl_provider_init(
struct wfp_provider * provider);
extern void wfp_impl_provider_init_from_prototype(
struct wfp_provider * provider,
struct wfp_provider const * prototype);
extern void wfp_impl_provider_invoke(
struct wfp_impl_invokation_context * context,
json_t * request);
2020-03-01 12:42:46 +00:00
extern bool wfp_impl_provider_is_authentication_enabled(
struct wfp_provider * provider);
2019-03-26 22:04:53 +00:00
extern void wfp_impl_connected_default(
void * user_data);
extern void wfp_impl_disconnected_default(
void * user_data);
#ifdef __cplusplus
}
#endif
#endif