2020-06-28 13:51:34 +00:00
|
|
|
#include "webfuse/impl/mountpoint_factory.h"
|
2020-02-16 20:03:17 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
wf_impl_mountpoint_factory_init_default(
|
|
|
|
struct wf_impl_mountpoint_factory * factory)
|
|
|
|
{
|
|
|
|
factory->create_mountpoint = NULL;
|
|
|
|
factory->user_data = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
wf_impl_mountpoint_factory_init(
|
|
|
|
struct wf_impl_mountpoint_factory * factory,
|
|
|
|
wf_create_mountpoint_fn * create_mountpoint,
|
2020-03-21 08:11:18 +00:00
|
|
|
void * user_data)
|
2020-02-16 20:03:17 +00:00
|
|
|
{
|
|
|
|
factory->create_mountpoint = create_mountpoint;
|
|
|
|
factory->user_data = user_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2020-04-07 17:34:19 +00:00
|
|
|
wf_impl_mountpoint_factory_clone(
|
2020-02-16 20:03:17 +00:00
|
|
|
struct wf_impl_mountpoint_factory * factory,
|
|
|
|
struct wf_impl_mountpoint_factory * other)
|
|
|
|
{
|
|
|
|
other->create_mountpoint = factory->create_mountpoint;
|
|
|
|
other->user_data = factory->user_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
wf_impl_mountpoint_factory_isvalid(
|
|
|
|
struct wf_impl_mountpoint_factory * factory)
|
|
|
|
{
|
|
|
|
return (NULL != factory->create_mountpoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
wf_impl_mountpoint_factory_cleanup(
|
|
|
|
struct wf_impl_mountpoint_factory * factory)
|
|
|
|
{
|
|
|
|
|
|
|
|
factory->create_mountpoint = NULL;
|
|
|
|
factory->user_data = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct wf_mountpoint *
|
|
|
|
wf_impl_mountpoint_factory_create_mountpoint(
|
|
|
|
struct wf_impl_mountpoint_factory * factory,
|
|
|
|
char const * filesystem)
|
|
|
|
{
|
|
|
|
return factory->create_mountpoint(filesystem, factory->user_data);
|
|
|
|
}
|
|
|
|
|