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:
34
lib/webfuse/adapter/impl/mountpoint.c
Normal file
34
lib/webfuse/adapter/impl/mountpoint.c
Normal 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;
|
||||
}
|
||||
26
lib/webfuse/adapter/impl/mountpoint.h
Normal file
26
lib/webfuse/adapter/impl/mountpoint.h
Normal 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
|
||||
Reference in New Issue
Block a user