119#undef VLINK_C_API_EXPORT
120#ifdef VLINK_C_API_LIBRARY_STATIC
121#define VLINK_C_API_EXPORT
122#elif defined(_WIN32) || defined(__CYGWIN__)
123#ifdef VLINK_C_API_LIBRARY
124#define VLINK_C_API_EXPORT __declspec(dllexport)
126#define VLINK_C_API_EXPORT __declspec(dllimport)
129#define VLINK_C_API_EXPORT __attribute__((visibility("default")))
void(* vlink_connect_callback_t)(const bool is_connected, void *user_data)
Callback invoked when the connection state of a Publisher or Client changes.
Definition c_api.h:280
VLINK_C_API_EXPORT int vlink_invoke(const vlink_client_handle_t handle, const uint8_t *data, const size_t size, const vlink_resp_callback_t resp_callback, void *user_data)
Sends an RPC request and registers a callback to receive the response.
VLINK_C_API_EXPORT int vlink_publish(const vlink_publisher_handle_t handle, const uint8_t *data, const size_t size)
Publishes a message to all matched Subscribers.
vlink_ret_t
Return code for all VLink C API functions.
Definition c_api.h:147
@ VLINK_RET_UNKNOWN_ERROR
Definition c_api.h:148
@ VLINK_RET_NO_ERROR
Definition c_api.h:149
@ VLINK_RET_RUNTIME_ERROR
Definition c_api.h:153
@ VLINK_RET_INVALID_ERROR
Definition c_api.h:151
@ VLINK_RET_MEMORY_ERROR
Definition c_api.h:152
@ VLINK_RET_TRANSFER_ERROR
Definition c_api.h:154
@ VLINK_RET_UNEXPECTED_ERROR
Definition c_api.h:150
VLINK_C_API_EXPORT int vlink_create_setter(const char *url, const vlink_schema_info_t *schema_info, vlink_setter_handle_t *handle)
Setter.
vlink_schema_t
Coarse runtime schema family used for raw C API nodes.
Definition c_api.h:167
@ VLINK_SCHEMA_ZEROCOPY
Definition c_api.h:170
@ VLINK_SCHEMA_RAW
Definition c_api.h:169
@ VLINK_SCHEMA_FLATBUFFERS
Definition c_api.h:172
@ VLINK_SCHEMA_PROTOBUF
Definition c_api.h:171
@ VLINK_SCHEMA_UNKNOWN
Definition c_api.h:168
VLINK_C_API_EXPORT int vlink_has_server(const vlink_client_handle_t handle)
Checks whether the Client is connected to a Server.
void(* vlink_req_callback_t)(const uint8_t *data, const size_t size, void *user_data)
Callback invoked when a Server receives an RPC request.
Definition c_api.h:305
VLINK_C_API_EXPORT int vlink_publish_by_force(const vlink_publisher_handle_t handle, const uint8_t *data, const size_t size)
Publishes a message even when no Subscribers are currently matched.
#define VLINK_C_API_EXPORT
Definition c_api.h:129
VLINK_C_API_EXPORT int vlink_create_publisher(const char *url, const vlink_schema_info_t *schema_info, vlink_publisher_handle_t *handle)
Publisher.
VLINK_C_API_EXPORT int vlink_create_getter(const char *url, const vlink_schema_info_t *schema_info, vlink_getter_handle_t *handle, const vlink_msg_callback_t msg_callback, void *user_data)
Getter.
VLINK_C_API_EXPORT int vlink_detect_subscribers(const vlink_publisher_handle_t handle, const vlink_connect_callback_t connect_callback, void *user_data)
Registers a callback fired whenever the Subscriber connection state changes.
VLINK_C_API_EXPORT int vlink_detect_server(const vlink_client_handle_t handle, const vlink_connect_callback_t connect_callback, void *user_data)
Registers a callback fired whenever the Server connection state changes.
VLINK_C_API_EXPORT int vlink_create_subscriber(const char *url, const vlink_schema_info_t *schema_info, vlink_subscriber_handle_t *handle, const vlink_msg_callback_t msg_callback, void *user_data)
Subscriber.
VLINK_C_API_EXPORT int vlink_destroy_publisher(vlink_publisher_handle_t *handle)
Destroys a Publisher node and releases all associated resources.
void(* vlink_resp_callback_t)(const uint8_t *data, const size_t size, void *user_data)
Callback invoked when a Client receives an RPC response.
Definition c_api.h:315
VLINK_C_API_EXPORT int vlink_wait_for_subscribers(const vlink_publisher_handle_t handle, const int timeout_ms)
Blocks until at least one Subscriber matches or the timeout elapses.
VLINK_C_API_EXPORT int vlink_wait_for_server(const vlink_client_handle_t handle, const int timeout_ms)
Blocks until a Server is available or the timeout elapses.
VLINK_C_API_EXPORT int vlink_reply(vlink_server_handle_t *handle, const uint8_t *data, const size_t size)
Provides the response data for the current in-progress RPC request.
VLINK_C_API_EXPORT int vlink_get(const vlink_getter_handle_t handle, uint8_t *data, size_t *size)
Retrieves the latest field value into a caller-provided buffer.
void(* vlink_msg_callback_t)(const uint8_t *data, const size_t size, void *user_data)
Callback invoked when a Subscriber or Getter receives a message.
Definition c_api.h:289
VLINK_C_API_EXPORT int vlink_destroy_server(vlink_server_handle_t *handle)
Destroys a Server node and frees all internal resources including the internal mutex and any pending ...
VLINK_C_API_EXPORT int vlink_destroy_client(vlink_client_handle_t *handle)
Destroys a Client node and releases all associated resources.
VLINK_C_API_EXPORT int vlink_create_client(const char *url, const vlink_schema_info_t *schema_info, vlink_client_handle_t *handle)
Client.
VLINK_C_API_EXPORT int vlink_create_server(const char *url, const vlink_schema_info_t *schema_info, vlink_server_handle_t *handle, const vlink_req_callback_t req_callback, void *user_data)
Server.
VLINK_C_API_EXPORT int vlink_has_subscribers(const vlink_publisher_handle_t handle)
Checks whether at least one Subscriber has matched this Publisher.
VLINK_C_API_EXPORT int vlink_destroy_subscriber(vlink_subscriber_handle_t *handle)
Destroys a Subscriber node and releases all associated resources.
VLINK_C_API_EXPORT int vlink_destroy_setter(vlink_setter_handle_t *handle)
Destroys a Setter node and releases all associated resources.
VLINK_C_API_EXPORT int vlink_destroy_getter(vlink_getter_handle_t *handle)
Destroys a Getter node and releases all associated resources.
VLINK_C_API_EXPORT int vlink_set(const vlink_setter_handle_t handle, const uint8_t *data, const size_t size)
Publishes the latest field value.
Opaque handle for a Client node.
Definition c_api.h:243
void * reserved[4]
Definition c_api.h:245
void * native_handle
Definition c_api.h:244
Opaque handle for a Getter node.
Definition c_api.h:269
void * native_handle
Definition c_api.h:270
void * reserved[4]
Definition c_api.h:271
Opaque handle for a Publisher node.
Definition c_api.h:197
void * native_handle
Definition c_api.h:198
void * reserved[4]
Definition c_api.h:199
Bundled runtime schema metadata for C API node creation.
Definition c_api.h:184
const char * ser
Definition c_api.h:185
vlink_schema_t schema
Definition c_api.h:186
Opaque handle for a Server node.
Definition c_api.h:230
void * reserved[4]
Definition c_api.h:232
void * native_handle
Definition c_api.h:231
Opaque handle for a Setter node.
Definition c_api.h:256
void * native_handle
Definition c_api.h:257
void * reserved[4]
Definition c_api.h:258
Opaque handle for a Subscriber node.
Definition c_api.h:210
void * reserved[4]
Definition c_api.h:212
void * native_handle
Definition c_api.h:211