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:
29
lib/wsfsp/operation/close.c
Normal file
29
lib/wsfsp/operation/close.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "wsfsp/operation/close_intern.h"
|
||||
#include <limits.h>
|
||||
#include "wsfs/util.h"
|
||||
|
||||
void wsfsp_close(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int WSFS_UNUSED_PARAM(id))
|
||||
{
|
||||
size_t const param_count = json_array_size(params);
|
||||
if (3 == param_count)
|
||||
{
|
||||
json_t * inode_holder = json_array_get(params, 0);
|
||||
json_t * handle_holder = json_array_get(params, 1);
|
||||
json_t * flags_holder = json_array_get(params, 2);
|
||||
|
||||
if (json_is_integer(inode_holder) &&
|
||||
json_is_integer(handle_holder) &&
|
||||
json_is_integer(flags_holder))
|
||||
{
|
||||
ino_t inode = (ino_t) json_integer_value(inode_holder);
|
||||
uint32_t handle = (uint32_t) (json_integer_value(handle_holder) & UINT32_MAX);
|
||||
int flags = json_integer_value(flags_holder);
|
||||
|
||||
context->provider->close(inode, handle, flags, context->user_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
21
lib/wsfsp/operation/close_intern.h
Normal file
21
lib/wsfsp/operation/close_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_CLOSE_INTERN_H
|
||||
#define WSFSP_OPERATION_CLOSE_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/close.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_close(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
11
lib/wsfsp/operation/error.c
Normal file
11
lib/wsfsp/operation/error.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "wsfsp/operation/error.h"
|
||||
|
||||
void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
int status)
|
||||
{
|
||||
(void) request;
|
||||
(void) status;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
24
lib/wsfsp/operation/getattr.c
Normal file
24
lib/wsfsp/operation/getattr.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "wsfsp/operation/getattr_intern.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void wsfsp_getattr(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
|
||||
puts("getattr");
|
||||
}
|
||||
|
||||
void wsfsp_respond_getattr(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat)
|
||||
{
|
||||
(void) request;
|
||||
(void) stat;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
21
lib/wsfsp/operation/getattr_intern.h
Normal file
21
lib/wsfsp/operation/getattr_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_GETATTR_INTERN_H
|
||||
#define WSFSP_OPERATION_GETATTR_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/getattr.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_getattr(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
lib/wsfsp/operation/lookup.c
Normal file
24
lib/wsfsp/operation/lookup.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "wsfsp/operation/lookup_intern.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void wsfsp_lookup(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
|
||||
puts("lookup");
|
||||
}
|
||||
|
||||
void wsfsp_respond_lookup(
|
||||
struct wsfsp_request * request,
|
||||
struct stat const * stat)
|
||||
{
|
||||
(void) request;
|
||||
(void) stat;
|
||||
|
||||
}
|
||||
|
||||
21
lib/wsfsp/operation/lookup_intern.h
Normal file
21
lib/wsfsp/operation/lookup_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_LOOKUP_INTERN_H
|
||||
#define WSFSP_OPERATION_LOOKUP_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/lookup.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_lookup(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
lib/wsfsp/operation/open.c
Normal file
24
lib/wsfsp/operation/open.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "wsfsp/operation/open_intern.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void wsfsp_open(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
|
||||
puts("open");
|
||||
}
|
||||
|
||||
void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
uint32_t handle)
|
||||
{
|
||||
(void) request;
|
||||
(void) handle;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
21
lib/wsfsp/operation/open_intern.h
Normal file
21
lib/wsfsp/operation/open_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_OPEN_INTERN_H
|
||||
#define WSFSP_OPERATION_OPEN_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/open.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_open(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
lib/wsfsp/operation/read.c
Normal file
24
lib/wsfsp/operation/read.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "wsfsp/operation/read_intern.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void wsfsp_read(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
|
||||
puts("read");
|
||||
}
|
||||
|
||||
void wsfsp_respond_read(
|
||||
struct wsfsp_request * request,
|
||||
char const * data,
|
||||
size_t length)
|
||||
{
|
||||
(void) request;
|
||||
(void) data;
|
||||
(void) length;
|
||||
}
|
||||
21
lib/wsfsp/operation/read_intern.h
Normal file
21
lib/wsfsp/operation/read_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_READ_INTERN_H
|
||||
#define WSFSP_OPERATION_READ_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/read.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_read(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
25
lib/wsfsp/operation/readdir.c
Normal file
25
lib/wsfsp/operation/readdir.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "wsfsp/operation/readdir_intern.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void wsfsp_readdir(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id)
|
||||
{
|
||||
(void) context;
|
||||
(void) params;
|
||||
(void) id;
|
||||
|
||||
puts("readdir");
|
||||
}
|
||||
|
||||
void wsfsp_respond_readdir(
|
||||
struct wsfsp_request * request,
|
||||
struct wsfsp_dirbuffer * dirbuffer)
|
||||
{
|
||||
(void) request;
|
||||
(void) dirbuffer;
|
||||
|
||||
// ToDo: implement me
|
||||
}
|
||||
|
||||
21
lib/wsfsp/operation/readdir_intern.h
Normal file
21
lib/wsfsp/operation/readdir_intern.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef WSFSP_OPERATION_READDIR_INTERN_H
|
||||
#define WSFSP_OPERATION_READDIR_INTERN_H
|
||||
|
||||
#include "wsfsp/operation/readdir.h"
|
||||
#include "wsfsp/provider_intern.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern void wsfsp_readdir(
|
||||
struct wsfsp_invokation_context * context,
|
||||
json_t * params,
|
||||
int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user