1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/include/webfuse_provider/client.h

106 lines
3.5 KiB
C
Raw Normal View History

2020-02-17 20:53:42 +00:00
////////////////////////////////////////////////////////////////////////////////
/// \file provider/client.h
/// \brief Webfuse provider client.
////////////////////////////////////////////////////////////////////////////////
2020-06-17 14:51:08 +00:00
#ifndef WFP_CLIENT_H
#define WFP_CLIENT_H
2019-03-26 22:04:53 +00:00
2020-06-16 21:39:45 +00:00
#include "webfuse_provider/api.h"
2019-03-26 22:04:53 +00:00
#ifdef __cplusplus
extern "C"
{
#endif
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \struct wfp_client
/// \brief Webfuse provider client.
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
struct wfp_client;
2020-02-17 20:53:42 +00:00
2019-03-26 22:04:53 +00:00
struct wfp_client_config;
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Creates a webfuse provider client.
///
/// \note Client configuration is not managed by the client.
///
/// \param config pointer to client configuration.
/// \return newly created client or NULL in case of an error.
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
extern WFP_API struct wfp_client * wfp_client_create(
struct wfp_client_config * config);
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Connects the client to a remote webfuse adapter server.
///
/// \note This call starts to establish a connection. A callback is invoked,
/// when the connection is estanlished.
///
/// \param client pointer to client
/// \param url URL of remote webfuse adapter server
///
/// \see wfp_connected_fn
/// \see wfp_client_config_set_onconnected
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
extern WFP_API void wfp_client_connect(
struct wfp_client * client,
char const * url);
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Disconnects a connected client.
///
/// \note This call starts to disconnect the connection. A callback is invoked
/// when conntection is disconnected.
///
/// \param client pointer to client
///
/// \see wfp_disconnected_fn
/// \see wfp_client_config_set_ondisconnected
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
extern WFP_API void wfp_client_disconnect(
struct wfp_client * client);
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Disposes a client.
///
/// \note Client configuration is not managed by client.
///
/// \param client pointer to client
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
extern WFP_API void wfp_client_dispose(
struct wfp_client * client);
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Triggers the client.
///
/// This function must be invoked in a loop while the client is running. It
/// makes the server wait for the next event and processes it.
///
/// \param client pointer to client
///
/// \see wfp_client_interrupt
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
2019-04-26 18:51:24 +00:00
extern WFP_API void wfp_client_service(
struct wfp_client * client);
2019-03-26 22:04:53 +00:00
//------------------------------------------------------------------------------
/// \brief interrupt wfp_client_service
///
/// This function can be called from another thread.
///
/// \param client pointer to client
///
/// \see wfp_client_service
//------------------------------------------------------------------------------
extern WFP_API void wfp_client_interrupt(
struct wfp_client * client);
2019-03-26 22:04:53 +00:00
#ifdef __cplusplus
}
#endif
#endif