Add Scalar

Convenience Functions

Declaration

tibrv_status
tibrvMsg_AddScalar_type(
   tibrvMsg       message,
   const char*    fieldName,
   scalar_type     value);
tibrv_status
tibrvMsg_AddScalar_typeEx(
   tibrvMsg       message,
   const char*    fieldName,
   scalar_type     value,
   tibrv_i16      fieldId);

Purpose

Add a field containing a scalar value.

Function Name

Field Value Type

Type Description

tibrvMsg_AddBool

tibrv_bool

boolean

tibrvMsg_AddF32

tibrv_f32

32-bit floating point

tibrvMsg_AddF64

tibrv_f64

64-bit floating point

tibrvMsg_AddI8

tibrv_i8

8-bit integer

tibrvMsg_AddI16

tibrv_i16

16-bit integer

tibrvMsg_AddI32

tibrv_i32

32-bit integer

tibrvMsg_AddI64

tibrv_i64

64-bit integer

tibrvMsg_AddU8

tibrv_u8

8-bit unsigned integer

tibrvMsg_AddU16

tibrv_u16

16-bit unsigned integer

tibrvMsg_AddU32

tibrv_u32

32-bit unsigned integer

tibrvMsg_AddU64

tibrv_u64

64-bit unsigned integer

tibrvMsg_AddIPAddr32

tibrv_ipaddr32

4-byte IP address

tibrvMsg_AddIPPort16

tibrv_ipport16

2-byte IP port

Parameter

Description

message

Add the new field to this message.

fieldName

Create the new field with this name.

value

Add a new field with this value (which may be a literal or stored in a variable).

The convenience function must correspond to the datatype of this value. We recommend casting the data to match the convenience function.

The function copies the value into the new message field.

fieldId

Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message.

It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.