TIBCO eFTL™
eftl.h File Reference

This file defines the eFTL API. More...

Data Structures

struct  tibeftlOptions
 eFTL options. More...
 

Macros

#define TIBEFTL_FIELD_NAME_DESTINATION   "_dest"
 Message field name identifying the destination of a message. More...
 
#define tibeftlOptionsDefault   { 0, NULL, NULL, NULL, NULL, 10000 }
 
Error Codes

Error codes returned by eFTL.

#define TIBEFTL_ERR_OK   (0)
 No error has been reported. More...
 
#define TIBEFTL_ERR_INVALID_ARG   (1)
 Invalid argument. More...
 
#define TIBEFTL_ERR_NO_MEMORY   (2)
 Memory allocation failed. More...
 
#define TIBEFTL_ERR_TIMEOUT   (3)
 Request timeout. More...
 
#define TIBEFTL_ERR_NOT_FOUND   (4)
 Item not found. More...
 
#define TIBEFTL_ERR_INVALID_TYPE   (5)
 Item of wrong type. More...
 
#define TIBEFTL_ERR_NOT_CONNECTED   (8)
 Not connected. More...
 
#define TIBEFTL_ERR_CONNECTION_LOST   (9)
 Connection lost. More...
 
#define TIBEFTL_ERR_CONNECT_FAILED   (10)
 Connect failed. More...
 
#define TIBEFTL_ERR_PUBLISH_FAILED   (11)
 Publish failed. More...
 
#define TIBEFTL_ERR_PUBLISH_NOT_AUTHORIZED   (12)
 Publish failed, not authorized. More...
 
#define TIBEFTL_ERR_SUBSCRIPTION_NOT_AUTHORIZED   (13)
 Subscription failed, not authorized. More...
 
#define TIBEFTL_ERR_SUBSCRIPTION_FAILED   (21)
 Subscription failed. More...
 
#define TIBEFTL_ERR_SUBSCRIPTION_INVALID   (22)
 Subscription failed, invalid matcher or durable. More...
 
#define TIBEFTL_ERR_GOING_AWAY   (1001)
 Server is shutting down. More...
 
#define TIBEFTL_ERR_MESSAGE_TOO_BIG   (1009)
 Published message is too big. More...
 
#define TIBEFTL_ERR_FORCE_CLOSE   (4000)
 Server closed the connection. More...
 
#define TIBEFTL_ERR_UNAVAILABLE   (4001)
 Server is temporarily unavailable. More...
 
#define TIBEFTL_ERR_AUTHENTICATION   (4002)
 Authentication failed. More...
 

Typedefs

typedef struct tibeftlConnectionStruct * tibeftlConnection
 eFTL connection. More...
 
typedef struct tibeftlErrStruct * tibeftlErr
 eFTL error. More...
 
typedef void(* tibeftlErrorCallback) (tibeftlConnection conn, tibeftlErr err, void *arg)
 Connection error callback. More...
 
typedef struct tibeftlMessageStruct * tibeftlMessage
 eFTL message. More...
 
typedef void(* tibeftlMessageCallback) (tibeftlConnection conn, tibeftlSubscription sub, int cnt, tibeftlMessage *msg, void *arg)
 Message callback. More...
 
typedef struct tibeftlSubscriptionStruct * tibeftlSubscription
 eFTL subscription. More...
 

Enumerations

enum  tibeftlFieldType {
  TIBEFTL_FIELD_TYPE_UNKNOWN,
  TIBEFTL_FIELD_TYPE_STRING,
  TIBEFTL_FIELD_TYPE_STRING_ARRAY,
  TIBEFTL_FIELD_TYPE_LONG,
  TIBEFTL_FIELD_TYPE_LONG_ARRAY,
  TIBEFTL_FIELD_TYPE_DOUBLE,
  TIBEFTL_FIELD_TYPE_DOUBLE_ARRAY,
  TIBEFTL_FIELD_TYPE_TIME,
  TIBEFTL_FIELD_TYPE_TIME_ARRAY,
  TIBEFTL_FIELD_TYPE_MESSAGE,
  TIBEFTL_FIELD_TYPE_MESSAGE_ARRAY,
  TIBEFTL_FIELD_TYPE_OPAQUE
}
 eFTL message field types. More...
 

Functions

DLL_EXPORT tibeftlConnection tibeftl_Connect (tibeftlErr err, const char *url, tibeftlOptions *opts, tibeftlErrorCallback errCb, void *errCbArg)
 Connect to the server. More...
 
DLL_EXPORT void tibeftl_Disconnect (tibeftlErr err, tibeftlConnection conn)
 Disconnect from the server and free all resources associated with the connection. More...
 
DLL_EXPORT bool tibeftl_IsConnected (tibeftlErr err, tibeftlConnection conn)
 Check whether or not there is a connection to the server. More...
 
DLL_EXPORT void tibeftl_Publish (tibeftlErr err, tibeftlConnection conn, tibeftlMessage msg)
 Publish a message to all subscribing clients. More...
 
DLL_EXPORT void tibeftl_Reconnect (tibeftlErr err, tibeftlConnection conn)
 Reconnect to the server. More...
 
DLL_EXPORT tibeftlSubscription tibeftl_Subscribe (tibeftlErr err, tibeftlConnection conn, const char *matcher, const char *durable, tibeftlMessageCallback msgCb, void *msgCbArg)
 Subscribe to messages. More...
 
DLL_EXPORT void tibeftl_Unsubscribe (tibeftlErr err, tibeftlConnection conn, tibeftlSubscription sub)
 Unsubscribe from messages and free all resources associated with the subscription. More...
 
DLL_EXPORT void tibeftl_UnsubscribeAll (tibeftlErr err, tibeftlConnection conn)
 Unsubscribe from all messages and free all resources associated with all subscriptions. More...
 
DLL_EXPORT const char * tibeftl_Version (void)
 Version string of the eFTL library. More...
 
DLL_EXPORT void tibeftlErr_Clear (tibeftlErr err)
 Clear an error. More...
 
DLL_EXPORT tibeftlErr tibeftlErr_Create (void)
 Create an error object. More...
 
DLL_EXPORT void tibeftlErr_Destroy (tibeftlErr err)
 Destroy an error object. More...
 
DLL_EXPORT int tibeftlErr_GetCode (tibeftlErr err)
 Get the error code. More...
 
DLL_EXPORT const char * tibeftlErr_GetDescription (tibeftlErr err)
 Get the error description. More...
 
DLL_EXPORT bool tibeftlErr_IsSet (tibeftlErr err)
 Check if an error has been set. More...
 
DLL_EXPORT void tibeftlErr_Set (tibeftlErr err, int code, const char *desc)
 Set an error. More...
 
DLL_EXPORT void tibeftlMessage_ClearAllFields (tibeftlErr err, tibeftlMessage msg)
 Clear all fields from a message. More...
 
DLL_EXPORT void tibeftlMessage_ClearField (tibeftlErr err, tibeftlMessage msg, const char *field)
 Clear a field from a message. More...
 
DLL_EXPORT tibeftlMessage tibeftlMessage_Create (tibeftlErr err)
 Create a message object. More...
 
DLL_EXPORT void tibeftlMessage_Destroy (tibeftlErr err, tibeftlMessage msg)
 Destroy a message object. More...
 
DLL_EXPORT void * tibeftlMessage_GetArray (tibeftlErr err, tibeftlMessage msg, tibeftlFieldType type, const char *field, int *size)
 Get an array field from a message. More...
 
DLL_EXPORT double tibeftlMessage_GetDouble (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get a double field from a message. More...
 
DLL_EXPORT tibeftlFieldType tibeftlMessage_GetFieldType (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get the type of a field in a message. More...
 
DLL_EXPORT int64_t tibeftlMessage_GetLong (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get a long field from a message. More...
 
DLL_EXPORT tibeftlMessage tibeftlMessage_GetMessage (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get a message field from a message. More...
 
DLL_EXPORT void * tibeftlMessage_GetOpaque (tibeftlErr err, tibeftlMessage msg, const char *field, size_t *size)
 Get an opaque field from a message. More...
 
DLL_EXPORT const char * tibeftlMessage_GetString (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get a string field from a message. More...
 
DLL_EXPORT int64_t tibeftlMessage_GetTime (tibeftlErr err, tibeftlMessage msg, const char *field)
 Get a time field from a message. More...
 
DLL_EXPORT bool tibeftlMessage_IsFieldSet (tibeftlErr err, tibeftlMessage msg, const char *field)
 Check whether a field is set in a message. More...
 
DLL_EXPORT bool tibeftlMessage_NextField (tibeftlErr err, tibeftlMessage msg, const char **field, tibeftlFieldType *type)
 Get the next field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetArray (tibeftlErr err, tibeftlMessage msg, tibeftlFieldType type, const char *field, const void *const value, int size)
 Set an array field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetDouble (tibeftlErr err, tibeftlMessage msg, const char *field, double value)
 Set a double field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetLong (tibeftlErr err, tibeftlMessage msg, const char *field, int64_t value)
 Set a long field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetMessage (tibeftlErr err, tibeftlMessage msg, const char *field, tibeftlMessage value)
 Set a message field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetOpaque (tibeftlErr err, tibeftlMessage msg, const char *field, void *value, size_t size)
 Set an opaque field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetString (tibeftlErr err, tibeftlMessage msg, const char *field, const char *value)
 Set a string field in a message. More...
 
DLL_EXPORT void tibeftlMessage_SetTime (tibeftlErr err, tibeftlMessage msg, const char *field, int64_t value)
 Set a time field in a message. More...
 
DLL_EXPORT size_t tibeftlMessage_ToString (tibeftlErr err, tibeftlMessage msg, char *buffer, size_t size)
 Get a printable string that describes the contents of a message. More...
 

Detailed Description

This file defines the eFTL API.

Macro Definition Documentation

#define TIBEFTL_ERR_AUTHENTICATION   (4002)

Authentication failed.

#define TIBEFTL_ERR_CONNECT_FAILED   (10)

Connect failed.

#define TIBEFTL_ERR_CONNECTION_LOST   (9)

Connection lost.

#define TIBEFTL_ERR_FORCE_CLOSE   (4000)

Server closed the connection.

#define TIBEFTL_ERR_GOING_AWAY   (1001)

Server is shutting down.

#define TIBEFTL_ERR_INVALID_ARG   (1)

Invalid argument.

#define TIBEFTL_ERR_INVALID_TYPE   (5)

Item of wrong type.

#define TIBEFTL_ERR_MESSAGE_TOO_BIG   (1009)

Published message is too big.

#define TIBEFTL_ERR_NO_MEMORY   (2)

Memory allocation failed.

#define TIBEFTL_ERR_NOT_CONNECTED   (8)

Not connected.

#define TIBEFTL_ERR_NOT_FOUND   (4)

Item not found.

#define TIBEFTL_ERR_OK   (0)

No error has been reported.

#define TIBEFTL_ERR_PUBLISH_FAILED   (11)

Publish failed.

#define TIBEFTL_ERR_PUBLISH_NOT_AUTHORIZED   (12)

Publish failed, not authorized.

#define TIBEFTL_ERR_SUBSCRIPTION_FAILED   (21)

Subscription failed.

#define TIBEFTL_ERR_SUBSCRIPTION_INVALID   (22)

Subscription failed, invalid matcher or durable.

#define TIBEFTL_ERR_SUBSCRIPTION_NOT_AUTHORIZED   (13)

Subscription failed, not authorized.

#define TIBEFTL_ERR_TIMEOUT   (3)

Request timeout.

#define TIBEFTL_ERR_UNAVAILABLE   (4001)

Server is temporarily unavailable.

#define TIBEFTL_FIELD_NAME_DESTINATION   "_dest"

Message field name identifying the destination of a message.

To publish a message on a specific destination include this message field using tibeftlMessage_SetString().

To subscribe to messages published on a specific destination, use a subscription matcher that includes this message field name in tibeftl_Subscribe().

#define tibeftlOptionsDefault   { 0, NULL, NULL, NULL, NULL, 10000 }

Typedef Documentation

typedef struct tibeftlConnectionStruct* tibeftlConnection

eFTL connection.

A tibeftlConnection object represents the connection to the server.

typedef struct tibeftlErrStruct* tibeftlErr

eFTL error.

A tibeftlErr object is passed to function calls to capture information about failures.

typedef void(* tibeftlErrorCallback) (tibeftlConnection conn, tibeftlErr err, void *arg)

Connection error callback.

A connection error callback is invoked whenever an error occurs on the connection. When the connection to the server is lost, tibeftl_Reconnect() can be called from within this callback to attempt a reconnect to the server.

Parameters
connThe connection on which the error occurred.
errThe connection error.
argThe callback-specific argument.
See also
tibeftl_Connect
typedef struct tibeftlMessageStruct* tibeftlMessage

eFTL message.

A tibeftlMessage object is used to send information between clients.

typedef void(* tibeftlMessageCallback) (tibeftlConnection conn, tibeftlSubscription sub, int cnt, tibeftlMessage *msg, void *arg)

Message callback.

A message callback is invoked whenever messages are received that matche a subscription.

Parameters
connThe connection on which the message was received.
subThe subscription associated with the message.
cntThe number of received messages.
msgThe array of received messages.
argThe callback-specific argument.
See also
tibeftl_Subscribe
typedef struct tibeftlSubscriptionStruct* tibeftlSubscription

eFTL subscription.

A tibeftlSubscription object represents an interest in receiving messages with particular content.

Enumeration Type Documentation

eFTL message field types.

Enumerator
TIBEFTL_FIELD_TYPE_UNKNOWN 
TIBEFTL_FIELD_TYPE_STRING 
TIBEFTL_FIELD_TYPE_STRING_ARRAY 
TIBEFTL_FIELD_TYPE_LONG 
TIBEFTL_FIELD_TYPE_LONG_ARRAY 
TIBEFTL_FIELD_TYPE_DOUBLE 
TIBEFTL_FIELD_TYPE_DOUBLE_ARRAY 
TIBEFTL_FIELD_TYPE_TIME 
TIBEFTL_FIELD_TYPE_TIME_ARRAY 
TIBEFTL_FIELD_TYPE_MESSAGE 
TIBEFTL_FIELD_TYPE_MESSAGE_ARRAY 
TIBEFTL_FIELD_TYPE_OPAQUE 

Function Documentation

DLL_EXPORT tibeftlConnection tibeftl_Connect ( tibeftlErr  err,
const char *  url,
tibeftlOptions opts,
tibeftlErrorCallback  errCb,
void *  errCbArg 
)

Connect to the server.

Creates a connection to the server.

The server URL has the syntax:

ws://host:port/channel wss://host:port/channel

Optionally, the URL can contain the username, password, and/or client identifier:

ws://username:password:port/channel?clientId=<identifier> wss://username:password:port/channel?clientId=<identifier>

Parameters
errAn eFTL error to capture information about failures.
urlThe URL of the server.
opts(optional) The options to use when creating the connection.
errCb(optional) The error callback to be invoked when connection errors occur.
errCbArg(optional) The error callback argument.
Returns
The connection object.
DLL_EXPORT void tibeftl_Disconnect ( tibeftlErr  err,
tibeftlConnection  conn 
)

Disconnect from the server and free all resources associated with the connection.

Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
DLL_EXPORT bool tibeftl_IsConnected ( tibeftlErr  err,
tibeftlConnection  conn 
)

Check whether or not there is a connection to the server.

Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
Returns
true if there is a connection to the server, false otherwise.
DLL_EXPORT void tibeftl_Publish ( tibeftlErr  err,
tibeftlConnection  conn,
tibeftlMessage  msg 
)

Publish a message to all subscribing clients.

It is good practice to direct messages to specific destinations by adding a message string field with the name TIBEFTL_FIELD_NAME_DESTINATION.; for example:

1 tibeftlMessage_SetString(err, msg, TIBEFTL_FIELD_NAME_DESTINATION, "MyDest");
Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
msgThe message to publish.
DLL_EXPORT void tibeftl_Reconnect ( tibeftlErr  err,
tibeftlConnection  conn 
)

Reconnect to the server.

Can be called from within the tibeftlErrorCallback.

All subscriptions are restored following a successful reconnect.

Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
DLL_EXPORT tibeftlSubscription tibeftl_Subscribe ( tibeftlErr  err,
tibeftlConnection  conn,
const char *  matcher,
const char *  durable,
tibeftlMessageCallback  msgCb,
void *  msgCbArg 
)

Subscribe to messages.

A subscription can be narrowed by using a matcher that matches only those messages whose content is of interest.

It is good practice to subscribe to messages published to specific destinations by using the message field name TIBEFTL_FIELD_NAME_DESTINATION in the matcher; for example:

1 char matcher[64];
2 
3 snprintf(matcher, sizeof(matcher), "{\"%s\":\"%s\"}",
4  TIBEFTL_FIELD_NAME_DESTINATION, "MyDestination");
5 
6 tibeftl_Subscribe(err, conn, matcher, "MyDurable", cb, NULL);
Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
matcher(optional) The matcher for selecting which messages to receive.
durable(optional) The name to use when creating durable subscriptions.
msgCbThe message callback to be invoked when messages are received.
msgCbArgThe message callback argument.
DLL_EXPORT void tibeftl_Unsubscribe ( tibeftlErr  err,
tibeftlConnection  conn,
tibeftlSubscription  sub 
)

Unsubscribe from messages and free all resources associated with the subscription.

Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
subThe subscription from which to unsubscribe.
DLL_EXPORT void tibeftl_UnsubscribeAll ( tibeftlErr  err,
tibeftlConnection  conn 
)

Unsubscribe from all messages and free all resources associated with all subscriptions.

Parameters
errAn eFTL error to capture information about failures.
connThe connection object.
DLL_EXPORT const char* tibeftl_Version ( void  )

Version string of the eFTL library.

Returns
The version string of the eFTL library.
DLL_EXPORT void tibeftlErr_Clear ( tibeftlErr  err)

Clear an error.

Parameters
errThe error object.
DLL_EXPORT tibeftlErr tibeftlErr_Create ( void  )

Create an error object.

Returns
The error object.
DLL_EXPORT void tibeftlErr_Destroy ( tibeftlErr  err)

Destroy an error object.

Parameters
errThe error object.
DLL_EXPORT int tibeftlErr_GetCode ( tibeftlErr  err)

Get the error code.

Parameters
errThe error object.
Returns
The error code.
DLL_EXPORT const char* tibeftlErr_GetDescription ( tibeftlErr  err)

Get the error description.

Parameters
errThe error object.
Returns
The error description.
DLL_EXPORT bool tibeftlErr_IsSet ( tibeftlErr  err)

Check if an error has been set.

Parameters
errThe error object.
Returns
true if the error is set, false otherwise.
DLL_EXPORT void tibeftlErr_Set ( tibeftlErr  err,
int  code,
const char *  desc 
)

Set an error.

Parameters
errThe error object.
codeThe error code.
descThe error description.
DLL_EXPORT void tibeftlMessage_ClearAllFields ( tibeftlErr  err,
tibeftlMessage  msg 
)

Clear all fields from a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
DLL_EXPORT void tibeftlMessage_ClearField ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Clear a field from a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to clear.
DLL_EXPORT tibeftlMessage tibeftlMessage_Create ( tibeftlErr  err)

Create a message object.

Parameters
errAn eFTL error to capture information about failures.
Returns
The message object.
DLL_EXPORT void tibeftlMessage_Destroy ( tibeftlErr  err,
tibeftlMessage  msg 
)

Destroy a message object.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
DLL_EXPORT void* tibeftlMessage_GetArray ( tibeftlErr  err,
tibeftlMessage  msg,
tibeftlFieldType  type,
const char *  field,
int *  size 
)

Get an array field from a message.

The returned array is valid only for the lifetime of the message. The returned array must not be modified or freed.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
typeThe field type to get.
fieldThe name of the field to get.
sizeThe number of elements in the array.
Returns
The value of the field.
DLL_EXPORT double tibeftlMessage_GetDouble ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get a double field from a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
Returns
The value of the field.
DLL_EXPORT tibeftlFieldType tibeftlMessage_GetFieldType ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get the type of a field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe field name.
Returns
The type of the field.
DLL_EXPORT int64_t tibeftlMessage_GetLong ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get a long field from a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
Returns
The value of the field.
DLL_EXPORT tibeftlMessage tibeftlMessage_GetMessage ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get a message field from a message.

The returned message is valid only for the lifetime of the message. The returned message must not be modified or freed.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
Returns
The value of the field.
DLL_EXPORT void* tibeftlMessage_GetOpaque ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
size_t *  size 
)

Get an opaque field from a message.

The returned opaque is valid only for the lifetime of the message. The returned opaque must not be modified or freed.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
sizeThe size of the field in bytes.
Returns
The value of the field.
DLL_EXPORT const char* tibeftlMessage_GetString ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get a string field from a message.

The returned string is valid only for the lifetime of the message. The returned string must not be modified or freed.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
Returns
The value of the field.
DLL_EXPORT int64_t tibeftlMessage_GetTime ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Get a time field from a message.

Time is the number of milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to get.
Returns
The value of the field.
DLL_EXPORT bool tibeftlMessage_IsFieldSet ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field 
)

Check whether a field is set in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe field name.
Returns
true if the field is set, false otherwise.
DLL_EXPORT bool tibeftlMessage_NextField ( tibeftlErr  err,
tibeftlMessage  msg,
const char **  field,
tibeftlFieldType type 
)

Get the next field in a message.

Calling this function repeatedly will iterate over all of the fields in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the next field.
typeThe type of the next field.
Returns
true if there are additional fields, false if the current field is the last field.
DLL_EXPORT void tibeftlMessage_SetArray ( tibeftlErr  err,
tibeftlMessage  msg,
tibeftlFieldType  type,
const char *  field,
const void *const  value,
int  size 
)

Set an array field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
typeThe type of the field to set.
fieldThe name of the field to set.
valueThe value of the field to set.
sizeThe number of elements in the array.
DLL_EXPORT void tibeftlMessage_SetDouble ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
double  value 
)

Set a double field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
DLL_EXPORT void tibeftlMessage_SetLong ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
int64_t  value 
)

Set a long field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
DLL_EXPORT void tibeftlMessage_SetMessage ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
tibeftlMessage  value 
)

Set a message field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
DLL_EXPORT void tibeftlMessage_SetOpaque ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
void *  value,
size_t  size 
)

Set an opaque field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
sizeThe size of the field to set in bytes.
DLL_EXPORT void tibeftlMessage_SetString ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
const char *  value 
)

Set a string field in a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
DLL_EXPORT void tibeftlMessage_SetTime ( tibeftlErr  err,
tibeftlMessage  msg,
const char *  field,
int64_t  value 
)

Set a time field in a message.

Time is the number of milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
fieldThe name of the field to set.
valueThe value of the field to set.
DLL_EXPORT size_t tibeftlMessage_ToString ( tibeftlErr  err,
tibeftlMessage  msg,
char *  buffer,
size_t  size 
)

Get a printable string that describes the contents of a message.

Parameters
errAn eFTL error to capture information about failures.
msgThe message object.
buffer(optional) The buffer into which the printable string is stored.
sizeThe size of the buffer in bytes.
Returns
The actual length of the printable string, including the terminating NULL character, in bytes.