You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.0 KiB
54 lines
1.0 KiB
4 years ago
|
#include "webfuse/impl/mountpoint.h"
|
||
5 years ago
|
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
struct wf_mountpoint
|
||
|
{
|
||
|
char * path;
|
||
5 years ago
|
void * user_data;
|
||
|
wf_mountpoint_userdata_dispose_fn * dispose;
|
||
5 years ago
|
};
|
||
|
|
||
|
struct wf_mountpoint *
|
||
|
wf_impl_mountpoint_create(
|
||
|
char const * path)
|
||
|
{
|
||
|
struct wf_mountpoint * mountpoint = malloc(sizeof(struct wf_mountpoint));
|
||
|
mountpoint->path = strdup(path);
|
||
5 years ago
|
mountpoint->user_data = NULL;
|
||
|
mountpoint->dispose = NULL;
|
||
5 years ago
|
|
||
|
return mountpoint;
|
||
|
}
|
||
|
|
||
|
void
|
||
|
wf_impl_mountpoint_dispose(
|
||
|
struct wf_mountpoint * mountpoint)
|
||
|
{
|
||
5 years ago
|
if (NULL != mountpoint->dispose)
|
||
|
{
|
||
|
mountpoint->dispose(mountpoint->user_data);
|
||
|
}
|
||
5 years ago
|
|
||
5 years ago
|
free(mountpoint->path);
|
||
|
free(mountpoint);
|
||
|
}
|
||
|
|
||
|
char const *
|
||
|
wf_impl_mountpoint_get_path(
|
||
|
struct wf_mountpoint const * mountpoint)
|
||
|
{
|
||
|
return mountpoint->path;
|
||
|
}
|
||
5 years ago
|
|
||
5 years ago
|
extern void
|
||
|
wf_impl_mountpoint_set_userdata(
|
||
5 years ago
|
struct wf_mountpoint * mountpoint,
|
||
5 years ago
|
void * user_data,
|
||
|
wf_mountpoint_userdata_dispose_fn * dispose)
|
||
5 years ago
|
{
|
||
5 years ago
|
mountpoint->user_data = user_data;
|
||
|
mountpoint->dispose = dispose;
|
||
5 years ago
|
}
|