#ifndef LINER_C_API_H_
#define LINER_C_API_H_
#define LINER_API
#include <stddef.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef enum BOOL{ FALSE = 0, TRUE = 1}BOOL;
typedef void* lnr_uData;
typedef void(*lnr_receive_cb)(const char* to, const char* from, const char* data, size_t data_size, lnr_uData);
typedef void* lnr_hClient;
LINER_API lnr_hClient lnr_new_client_redis(const char* unique_name, const char* topic, const char* localhost, const char* redis_url);
LINER_API lnr_hClient lnr_new_client_sqlite(const char* unique_name, const char* topic, const char* localhost, const char* sqlite_path, const char* receivers_json);
#if defined(__GNUC__) || defined(__clang__)
#define LINER_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define LINER_DEPRECATED __declspec(deprecated)
#else
#define LINER_DEPRECATED
#endif
LINER_API LINER_DEPRECATED lnr_hClient lnr_new_client(const char* unique_name, const char* topic, const char* localhost, const char* redis_path);
LINER_API BOOL lnr_run(lnr_hClient client, lnr_receive_cb receive_cb, lnr_uData);
LINER_API BOOL lnr_send_to(lnr_hClient client,
const char* topic,
const char* data, size_t data_size,
BOOL at_least_once_delivery);
LINER_API BOOL lnr_send_all(lnr_hClient client,
const char* topic,
const char* data, size_t data_size,
BOOL at_least_once_delivery);
LINER_API BOOL lnr_subscribe(lnr_hClient client, const char* topic);
LINER_API BOOL lnr_unsubscribe(lnr_hClient client, const char* topic);
LINER_API BOOL lnr_refresh_address_topic(lnr_hClient client, const char* topic);
LINER_API BOOL lnr_clear_stored_messages(lnr_hClient client);
LINER_API BOOL lnr_clear_addresses_of_topic(lnr_hClient client);
LINER_API BOOL lnr_delete_client(lnr_hClient client);
#if defined(__cplusplus)
}
#endif
#endif