75 err.error.err_i16 = 0;
104 nats->user_ctx = ctx;
111 err.error.err_i16 = 0;
Memory allocation wrappers backed by libttak.
void cwist_free(void *ptr)
Free memory obtained via cwist_alloc/cwist_strdup/etc.
void * cwist_alloc(size_t size)
Allocate zeroed memory tracked by libttak.
natsConnection * cwist_nats_native(cwist_nats_t *nats)
Access the underlying NATS connection.
void cwist_nats_destroy(cwist_nats_t *nats)
Destroy a handle and release its resources.
cwist_error_t cwist_nats_publish_string(cwist_nats_t *nats, const char *subject, const char *data)
Publish a NUL-terminated string message to a subject.
cwist_error_t cwist_nats_subscribe(cwist_nats_t *nats, const char *subject, cwist_nats_msg_cb cb, void *ctx)
Subscribe to a NATS subject and register a message callback.
cwist_error_t cwist_nats_connect(cwist_nats_t **nats, const char *url)
Connect to a NATS server and create a handle.
void cwist_nats_dispatch(cwist_nats_t *nats)
Pump pending I/O on the connection.
void(* cwist_nats_msg_cb)(const char *subject, const char *data, size_t len, void *ctx)
struct cwist_nats cwist_nats_t
struct __natsConnection natsConnection
@ CWIST_ERR_INT16
used when checking common errcodes in Unix/Linux
cwist_error_t make_error(cwist_errtype_t type)
Creates an error object initialized with the specified type.
Integrated error structure used throughout the system.
#define CWIST_ERROR_INVALID_PARAM
#define CWIST_ERROR_NOMEM