1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

added implementation of mountpoint

This commit is contained in:
Falk Werner
2020-02-15 15:11:35 +01:00
parent 16705acf81
commit e727a9a54d
8 changed files with 100 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
#include "webfuse/adapter/impl/mountpoint.h"
#include <stdlib.h>
#include <string.h>
struct wf_mountpoint
{
char * path;
};
struct wf_mountpoint *
wf_impl_mountpoint_create(
char const * path)
{
struct wf_mountpoint * mountpoint = malloc(sizeof(struct wf_mountpoint));
mountpoint->path = strdup(path);
return mountpoint;
}
void
wf_impl_mountpoint_dispose(
struct wf_mountpoint * mountpoint)
{
free(mountpoint->path);
free(mountpoint);
}
char const *
wf_impl_mountpoint_get_path(
struct wf_mountpoint const * mountpoint)
{
return mountpoint->path;
}

View File

@@ -0,0 +1,26 @@
#ifndef WF_IMPL_MOUNTPOINT_H
#define WF_IMPL_MOUNTPOINT_H
#ifdef __cplusplus
extern "C"
{
#endif
extern struct wf_mountpoint *
wf_impl_mountpoint_create(
char const * path);
extern void
wf_impl_mountpoint_dispose(
struct wf_mountpoint * mountpoint);
extern char const *
wf_impl_mountpoint_get_path(
struct wf_mountpoint const * mountpoint);
#ifdef __cplusplus
}
#endif
#endif