mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
feat(API wrapper): separates implementation from public API
* moves implementation to impl subdirectory * adds prefix _impl to implementation symbols * removes double compilation for shared and static libraries * fixes include guards * fixes usage of extern "C"
This commit is contained in:
@@ -5,11 +5,19 @@
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_credentials;
|
||||
|
||||
typedef bool wsfs_authenticate_fn(
|
||||
struct wsfs_credentials * credentials,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
#include "wsfs/adapter/api.h"
|
||||
|
||||
struct wsfs_credentials;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_credentials;
|
||||
|
||||
extern WSFSA_API char const * wsfs_credentials_type(
|
||||
struct wsfs_credentials const * credentials);
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include "wsfs/adapter/api.h"
|
||||
|
||||
struct wsfs_server;
|
||||
struct wsfs_server_config;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server;
|
||||
struct wsfs_server_config;
|
||||
|
||||
extern WSFSA_API struct wsfs_server * wsfs_server_create(
|
||||
struct wsfs_server_config * config);
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "wsfs/adapter/api.h"
|
||||
#include "wsfs/adapter/authenticate.h"
|
||||
|
||||
struct wsfs_server_config;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server_config;
|
||||
|
||||
extern WSFSA_API struct wsfs_server_config * wsfs_server_config_create(void);
|
||||
|
||||
extern WSFSA_API void wsfs_server_config_dispose(
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
#include <wsfs/adapter/api.h>
|
||||
#include <wsfs/adapter/authenticate.h>
|
||||
|
||||
struct wsfs_server_protocol;
|
||||
struct lws_protocols;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfs_server_protocol;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WSFSA_API struct wsfs_server_protocol * wsfs_server_protocol_create(
|
||||
char * mount_point);
|
||||
|
||||
|
||||
@@ -3,25 +3,17 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
struct wsfsp_client;
|
||||
struct wsfsp_client_config;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client;
|
||||
struct wsfsp_client_config;
|
||||
|
||||
extern WSFSP_API struct wsfsp_client * wsfsp_client_create(
|
||||
struct wsfsp_client_config * config);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_set_keypath(
|
||||
struct wsfsp_client * client,
|
||||
char * key_path);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_set_certpath(
|
||||
struct wsfsp_client * client,
|
||||
char * cert_path);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_connect(
|
||||
struct wsfsp_client * client,
|
||||
char const * url);
|
||||
@@ -29,10 +21,6 @@ extern WSFSP_API void wsfsp_client_connect(
|
||||
extern WSFSP_API void wsfsp_client_disconnect(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_settimeout(
|
||||
struct wsfsp_client * client,
|
||||
unsigned int timepoint);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_dispose(
|
||||
struct wsfsp_client * client);
|
||||
|
||||
|
||||
@@ -10,22 +10,22 @@
|
||||
#include <wsfs/provider/operation/close.h>
|
||||
#include <wsfs/provider/operation/read.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client_config;
|
||||
|
||||
typedef void wsfsp_connected_fn(
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_disconnected_fn(
|
||||
void * user_data);
|
||||
void * user_data);
|
||||
|
||||
typedef void wsfsp_ontimer_fn(
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API struct wsfsp_client_config * wsfsp_client_config_create(void);
|
||||
|
||||
extern WSFSP_API void wsfsp_client_config_dispose(
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
struct wsfsp_client_protocol;
|
||||
struct wsfsp_provider;
|
||||
struct lws_protocols;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_client_protocol;
|
||||
struct wsfsp_provider;
|
||||
struct lws_protocols;
|
||||
|
||||
extern WSFSP_API struct wsfsp_client_protocol * wsfsp_client_protocol_create(
|
||||
struct wsfsp_provider const * provider,
|
||||
void * user_data);
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
|
||||
extern WSFSP_API struct wsfsp_dirbuffer * wsfsp_dirbuffer_create(void);
|
||||
|
||||
extern WSFSP_API void wsfsp_dirbuffer_dispose(
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef void wsfsp_close_fn(
|
||||
ino_t inode,
|
||||
uint32_t handle,
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
#define WSFSP_OPERATION_ERROR_H
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
#include "wsfs/status.h"
|
||||
|
||||
struct wsfsp_request;
|
||||
#include "wsfs/core/status.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_error(
|
||||
struct wsfsp_request * request,
|
||||
wsfs_status status);
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_getattr_fn(
|
||||
@@ -14,12 +19,6 @@ typedef void wsfsp_getattr_fn(
|
||||
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);
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_lookup_fn(
|
||||
@@ -15,11 +20,6 @@ typedef void wsfsp_lookup_fn(
|
||||
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);
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_open_fn(
|
||||
@@ -21,11 +26,6 @@ typedef void wsfsp_open_fn(
|
||||
int flags,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern WSFSP_API void wsfsp_respond_open(
|
||||
struct wsfsp_request * request,
|
||||
uint32_t handle);
|
||||
|
||||
@@ -16,6 +16,11 @@ using std::size_t;
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_request;
|
||||
|
||||
typedef void wsfsp_read_fn(
|
||||
@@ -26,11 +31,6 @@ typedef void wsfsp_read_fn(
|
||||
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,
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
#include "wsfs/provider/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wsfsp_dirbuffer;
|
||||
struct wsfsp_request;
|
||||
|
||||
@@ -15,12 +20,6 @@ typedef void wsfsp_readdir_fn(
|
||||
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);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef WSFS_ADAPTER_H
|
||||
#define WSFS_ADAPTER_H
|
||||
|
||||
#include <wsfs/status.h>
|
||||
#include <wsfs/core/status.h>
|
||||
|
||||
#include <wsfs/adapter/api.h>
|
||||
#include <wsfs/adapter/server.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef WSFS_PROVIDER_H
|
||||
#define WSFS_PROVIDER_H
|
||||
|
||||
#include <wsfs/status.h>
|
||||
#include <wsfs/core/status.h>
|
||||
|
||||
#include <wsfs/provider/api.h>
|
||||
#include <wsfs/provider/client.h>
|
||||
|
||||
Reference in New Issue
Block a user