mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
separated client opertation stubs
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#ifndef WSFS_H
|
||||
#define WSFS_H
|
||||
|
||||
#include "wsfs/api.h"
|
||||
#include "wsfs/server.h"
|
||||
#include "wsfs/server_config.h"
|
||||
#include "wsfs/server_protocol.h"
|
||||
#include <wsfs/api.h>
|
||||
#include <wsfs/server.h>
|
||||
#include <wsfs/server_config.h>
|
||||
#include <wsfs/server_protocol.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
#ifndef WSFSP_H
|
||||
#define WSFSP_H
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
#include "wsfsp/provider.h"
|
||||
#include "wsfsp/client.h"
|
||||
#include "wsfsp/client_protocol.h"
|
||||
#include <wsfsp/api.h>
|
||||
#include <wsfsp/client.h>
|
||||
#include <wsfsp/client_protocol.h>
|
||||
#include <wsfsp/provider.h>
|
||||
#include <wsfsp/dirbuffer.h>
|
||||
|
||||
#include <wsfsp/operation/error.h>
|
||||
#include <wsfsp/operation/lookup.h>
|
||||
#include <wsfsp/operation/getattr.h>
|
||||
#include <wsfsp/operation/readdir.h>
|
||||
#include <wsfsp/operation/open.h>
|
||||
#include <wsfsp/operation/close.h>
|
||||
#include <wsfsp/operation/read.h>
|
||||
|
||||
#endif
|
||||
|
||||
32
include/wsfsp/dirbuffer.h
Normal file
32
include/wsfsp/dirbuffer.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WSFSP_DIRBUFFER_H
|
||||
#define WSFSP_DIRBUFFER_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API struct wsfsp_dirbuffer * wsfsp_dirbuffer_init(void);
|
||||
|
||||
extern WSFSP_API void wsfsp_dirbuffer_dispose(
|
||||
struct wsfsp_dirbuffer * buffer);
|
||||
|
||||
extern WSFSP_API void wsfsp_dirbuffer_add(
|
||||
struct wsfsp_dirbuffer * buffer,
|
||||
char const * name,
|
||||
ino_t inode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
31
include/wsfsp/operation/close.h
Normal file
31
include/wsfsp/operation/close.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef WSFSP_OPERATION_CLOSE_H
|
||||
#define WSFSP_OPERATION_CLOSE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cinttypes>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
typedef void wsfsp_close_fn(
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
21
include/wsfsp/operation/error.h
Normal file
21
include/wsfsp/operation/error.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_ERROR_H
|
||||
#define WSFSP_OPERATION_ERROR_H
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
int status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
32
include/wsfsp/operation/getattr.h
Normal file
32
include/wsfsp/operation/getattr.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WSFSP_OPERATION_GETATTR_H
|
||||
#define WSFSP_OPERATION_GETATTR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_getattr_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_getattr(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
32
include/wsfsp/operation/lookup.h
Normal file
32
include/wsfsp/operation/lookup.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WSFSP_OPERATION_LOOKUP_H
|
||||
#define WSFSP_OPERATION_LOOKUP_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_lookup_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t parent,
|
||||
char const * name,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_lookup(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
38
include/wsfsp/operation/open.h
Normal file
38
include/wsfsp/operation/open.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef WSFSP_OPERATION_OPEN_H
|
||||
#define WSFSP_OPERATION_OPEN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cinttypes>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_open_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
uint32_t handle);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
44
include/wsfsp/operation/read.h
Normal file
44
include/wsfsp/operation/read.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef WSFSP_OPERATION_READ_H
|
||||
#define WSFSP_OPERATION_READ_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stddef.h>
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cstddef>
|
||||
#include <cinttypes>
|
||||
using std::size_t;
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_read_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
size_t offset,
|
||||
size_t length,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_read(
|
||||
struct wsfsp_request * request,
|
||||
char const * data,
|
||||
size_t length);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
32
include/wsfsp/operation/readdir.h
Normal file
32
include/wsfsp/operation/readdir.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef WSFSP_OPERATION_READDIR_H
|
||||
#define WSFSP_OPERATION_READDIR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_readdir_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t directory,
|
||||
void * user_data);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_readdir(
|
||||
struct wsfsp_request * request,
|
||||
struct wsfsp_dirbuffer * dirbuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,60 +1,12 @@
|
||||
#ifndef WSFSP_PROVIDER_H
|
||||
#define WSFSP_PROVIDER_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stddef.h>
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <cstddef>
|
||||
#include <cinttypes>
|
||||
using std::size_t;
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfsp/api.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
struct wsfsp_dirbuffer;
|
||||
|
||||
typedef void wsfsp_lookup_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t parent,
|
||||
char const * name,
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_getattr_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_readdir_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t directory,
|
||||
struct wsfsp_dirbuffer * dirbuffer,
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_open_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_close_fn(
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_read_fn(
|
||||
struct wsfsp_request * request,
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
size_t offset,
|
||||
size_t length,
|
||||
void * user_data);
|
||||
#include <wsfsp/operation/lookup.h>
|
||||
#include <wsfsp/operation/getattr.h>
|
||||
#include <wsfsp/operation/readdir.h>
|
||||
#include <wsfsp/operation/open.h>
|
||||
#include <wsfsp/operation/close.h>
|
||||
#include <wsfsp/operation/read.h>
|
||||
|
||||
typedef void wsfsp_connected_fn(
|
||||
void * user_data);
|
||||
@@ -78,38 +30,5 @@ struct wsfsp_provider
|
||||
wsfsp_read_fn * read;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
int status);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_lookup(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_getattr(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_readdir(
|
||||
struct wsfsp_request * request,
|
||||
struct wsfsp_dirbuffer * dirbuffer);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
uint32_t handle);
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_read(
|
||||
struct wsfsp_request * request,
|
||||
char const * data,
|
||||
size_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user