mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
removed wfp_client_ontimer (breaking change)
This commit is contained in:
parent
3eb5dc89a7
commit
69af19193a
@ -45,14 +45,6 @@ typedef void wfp_connected_fn(
|
|||||||
typedef void wfp_disconnected_fn(
|
typedef void wfp_disconnected_fn(
|
||||||
void * user_data);
|
void * user_data);
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
/// \brief Callback to signal when a timer event occued.
|
|
||||||
///
|
|
||||||
/// \param user_data user defined context
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
typedef void wfp_ontimer_fn(
|
|
||||||
void * user_data);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/// \brief Creates a new client configuration.
|
/// \brief Creates a new client configuration.
|
||||||
///
|
///
|
||||||
@ -145,18 +137,6 @@ extern WFP_API void wfp_client_config_set_ondisconnected(
|
|||||||
struct wfp_client_config * config,
|
struct wfp_client_config * config,
|
||||||
wfp_disconnected_fn * handler);
|
wfp_disconnected_fn * handler);
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
/// \brief Sets ontimer handler.
|
|
||||||
///
|
|
||||||
/// The handler is invoked, when a timer event occured.
|
|
||||||
///
|
|
||||||
/// \param config pointer to client configuration
|
|
||||||
/// \param handler pointer to handler
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
extern WFP_API void wfp_client_config_set_ontimer(
|
|
||||||
struct wfp_client_config * config,
|
|
||||||
wfp_ontimer_fn * handler);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/// \brief Sets onlookup handler.
|
/// \brief Sets onlookup handler.
|
||||||
///
|
///
|
||||||
|
@ -116,13 +116,6 @@ void wfp_client_config_set_ondisconnected(
|
|||||||
wfp_impl_client_config_set_ondisconnected(config, handler);
|
wfp_impl_client_config_set_ondisconnected(config, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfp_client_config_set_ontimer(
|
|
||||||
struct wfp_client_config * config,
|
|
||||||
wfp_ontimer_fn * handler)
|
|
||||||
{
|
|
||||||
wfp_impl_client_config_set_ontimer(config, handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wfp_client_config_set_onlookup(
|
void wfp_client_config_set_onlookup(
|
||||||
struct wfp_client_config * config,
|
struct wfp_client_config * config,
|
||||||
wfp_lookup_fn * handler)
|
wfp_lookup_fn * handler)
|
||||||
|
@ -69,13 +69,6 @@ void wfp_impl_client_config_set_ondisconnected(
|
|||||||
config->provider.disconnected = handler;
|
config->provider.disconnected = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfp_impl_client_config_set_ontimer(
|
|
||||||
struct wfp_client_config * config,
|
|
||||||
wfp_ontimer_fn * handler)
|
|
||||||
{
|
|
||||||
config->provider.ontimer = handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wfp_impl_client_config_set_onlookup(
|
void wfp_impl_client_config_set_onlookup(
|
||||||
struct wfp_client_config * config,
|
struct wfp_client_config * config,
|
||||||
wfp_lookup_fn * handler)
|
wfp_lookup_fn * handler)
|
||||||
|
@ -47,10 +47,6 @@ extern void wfp_impl_client_config_set_ondisconnected(
|
|||||||
struct wfp_client_config * config,
|
struct wfp_client_config * config,
|
||||||
wfp_disconnected_fn * handler);
|
wfp_disconnected_fn * handler);
|
||||||
|
|
||||||
extern void wfp_impl_client_config_set_ontimer(
|
|
||||||
struct wfp_client_config * config,
|
|
||||||
wfp_ontimer_fn * handler);
|
|
||||||
|
|
||||||
extern void wfp_impl_client_config_set_onlookup(
|
extern void wfp_impl_client_config_set_onlookup(
|
||||||
struct wfp_client_config * config,
|
struct wfp_client_config * config,
|
||||||
wfp_lookup_fn * handler);
|
wfp_lookup_fn * handler);
|
||||||
|
@ -66,7 +66,6 @@ void wfp_impl_provider_init(
|
|||||||
provider->read = &wfp_impl_read_default;
|
provider->read = &wfp_impl_read_default;
|
||||||
provider->connected = &wfp_impl_connected_default;
|
provider->connected = &wfp_impl_connected_default;
|
||||||
provider->disconnected = &wfp_impl_disconnected_default;
|
provider->disconnected = &wfp_impl_disconnected_default;
|
||||||
provider->ontimer = &wfp_impl_ontimer_default;
|
|
||||||
provider->get_credentials = NULL;
|
provider->get_credentials = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +81,6 @@ void wfp_impl_provider_init_from_prototype(
|
|||||||
provider->read = prototype->read;
|
provider->read = prototype->read;
|
||||||
provider->connected = prototype->connected;
|
provider->connected = prototype->connected;
|
||||||
provider->disconnected = prototype->disconnected;
|
provider->disconnected = prototype->disconnected;
|
||||||
provider->ontimer = prototype->ontimer;
|
|
||||||
provider->get_credentials = prototype->get_credentials;
|
provider->get_credentials = prototype->get_credentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,14 +117,6 @@ void wfp_impl_disconnected_default(
|
|||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfp_impl_ontimer_default(
|
|
||||||
void * user_data)
|
|
||||||
{
|
|
||||||
(void) user_data;
|
|
||||||
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wfp_impl_provider_is_authentication_enabled(
|
bool wfp_impl_provider_is_authentication_enabled(
|
||||||
struct wfp_provider * provider)
|
struct wfp_provider * provider)
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,6 @@ struct wfp_provider
|
|||||||
{
|
{
|
||||||
wfp_connected_fn * connected;
|
wfp_connected_fn * connected;
|
||||||
wfp_disconnected_fn * disconnected;
|
wfp_disconnected_fn * disconnected;
|
||||||
wfp_ontimer_fn * ontimer;
|
|
||||||
wfp_lookup_fn * lookup;
|
wfp_lookup_fn * lookup;
|
||||||
wfp_getattr_fn * getattr;
|
wfp_getattr_fn * getattr;
|
||||||
wfp_readdir_fn * readdir;
|
wfp_readdir_fn * readdir;
|
||||||
@ -56,9 +55,6 @@ extern void wfp_impl_connected_default(
|
|||||||
extern void wfp_impl_disconnected_default(
|
extern void wfp_impl_disconnected_default(
|
||||||
void * user_data);
|
void * user_data);
|
||||||
|
|
||||||
extern void wfp_impl_ontimer_default(
|
|
||||||
void * user_data);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,13 +18,6 @@ static void webfuse_test_MockProvider_disconnected(
|
|||||||
provider->disconnected();
|
provider->disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void webfuse_test_MockProvider_on_timer(
|
|
||||||
void * user_data)
|
|
||||||
{
|
|
||||||
auto * provider = reinterpret_cast<MockProvider*>(user_data);
|
|
||||||
provider->on_timer();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void webfuse_test_MockProvider_lookup(
|
static void webfuse_test_MockProvider_lookup(
|
||||||
wfp_request * request,
|
wfp_request * request,
|
||||||
ino_t parent,
|
ino_t parent,
|
||||||
@ -100,7 +93,6 @@ static wfp_provider const webfuse_test_MockProvider =
|
|||||||
{
|
{
|
||||||
&webfuse_test_MockProvider_connected,
|
&webfuse_test_MockProvider_connected,
|
||||||
&webfuse_test_MockProvider_disconnected,
|
&webfuse_test_MockProvider_disconnected,
|
||||||
&webfuse_test_MockProvider_on_timer,
|
|
||||||
&webfuse_test_MockProvider_lookup,
|
&webfuse_test_MockProvider_lookup,
|
||||||
&webfuse_test_MockProvider_getattr,
|
&webfuse_test_MockProvider_getattr,
|
||||||
&webfuse_test_MockProvider_readdir,
|
&webfuse_test_MockProvider_readdir,
|
||||||
|
@ -21,13 +21,6 @@ static void webfuse_test_iproviderclient_ondisconnected(
|
|||||||
self->OnDisconnected();
|
self->OnDisconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void webfuse_test_iproviderclient_ontimer(
|
|
||||||
void * user_data)
|
|
||||||
{
|
|
||||||
auto * self = reinterpret_cast<IProviderClient*>(user_data);
|
|
||||||
self->OnTimer();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void webfuse_test_iproviderclient_onlookup(
|
static void webfuse_test_iproviderclient_onlookup(
|
||||||
struct wfp_request * request,
|
struct wfp_request * request,
|
||||||
ino_t parent,
|
ino_t parent,
|
||||||
@ -207,7 +200,6 @@ void IProviderClient::AttachTo(wfp_client_config * config, bool enableAuthentica
|
|||||||
wfp_client_config_set_userdata(config, self);
|
wfp_client_config_set_userdata(config, self);
|
||||||
wfp_client_config_set_onconnected(config, &webfuse_test_iproviderclient_onconnected);
|
wfp_client_config_set_onconnected(config, &webfuse_test_iproviderclient_onconnected);
|
||||||
wfp_client_config_set_ondisconnected(config, &webfuse_test_iproviderclient_ondisconnected);
|
wfp_client_config_set_ondisconnected(config, &webfuse_test_iproviderclient_ondisconnected);
|
||||||
wfp_client_config_set_ontimer(config, &webfuse_test_iproviderclient_ontimer);
|
|
||||||
|
|
||||||
wfp_client_config_set_onlookup(config, &webfuse_test_iproviderclient_onlookup);
|
wfp_client_config_set_onlookup(config, &webfuse_test_iproviderclient_onlookup);
|
||||||
wfp_client_config_set_ongetattr(config, &webfuse_test_iproviderclient_ongetattr);
|
wfp_client_config_set_ongetattr(config, &webfuse_test_iproviderclient_ongetattr);
|
||||||
|
@ -23,7 +23,6 @@ namespace webfuse_test
|
|||||||
virtual ~IProviderClient() = default;
|
virtual ~IProviderClient() = default;
|
||||||
virtual void OnConnected() = 0;
|
virtual void OnConnected() = 0;
|
||||||
virtual void OnDisconnected() = 0;
|
virtual void OnDisconnected() = 0;
|
||||||
virtual void OnTimer() = 0;
|
|
||||||
virtual void Lookup(ino_t parent, char const * name, struct stat * result) = 0;
|
virtual void Lookup(ino_t parent, char const * name, struct stat * result) = 0;
|
||||||
virtual void GetAttr(ino_t inode, struct stat * buffer) = 0;
|
virtual void GetAttr(ino_t inode, struct stat * buffer) = 0;
|
||||||
virtual void ReadDir(ino_t directory, wfp_dirbuffer * buffer) = 0;
|
virtual void ReadDir(ino_t directory, wfp_dirbuffer * buffer) = 0;
|
||||||
@ -41,7 +40,6 @@ namespace webfuse_test
|
|||||||
~MockProviderClient() override = default;
|
~MockProviderClient() override = default;
|
||||||
MOCK_METHOD0( OnConnected, void());
|
MOCK_METHOD0( OnConnected, void());
|
||||||
MOCK_METHOD0( OnDisconnected, void());
|
MOCK_METHOD0( OnDisconnected, void());
|
||||||
MOCK_METHOD0( OnTimer, void());
|
|
||||||
MOCK_METHOD3( Lookup, void(ino_t parent, char const * name, struct stat * result));
|
MOCK_METHOD3( Lookup, void(ino_t parent, char const * name, struct stat * result));
|
||||||
MOCK_METHOD2( GetAttr, void(ino_t inode, struct stat * buffer));
|
MOCK_METHOD2( GetAttr, void(ino_t inode, struct stat * buffer));
|
||||||
MOCK_METHOD2( ReadDir, void(ino_t directory, wfp_dirbuffer * buffer));
|
MOCK_METHOD2( ReadDir, void(ino_t directory, wfp_dirbuffer * buffer));
|
||||||
|
Loading…
Reference in New Issue
Block a user