tibemsMapMsg_SetBytes

Function

Purpose

Set a byte array as a named value in a map message.

C Declaration

tibems_status tibemsMapMsg_SetBytes(
    tibemsMapMsg message,
    const char* name,
    void* bytes,
    tibems_uint bytesSize );

tibems_status tibemsMapMsg_SetReferencedBytes(
    tibemsMapMsg message,
    const char* name,
    void* bytes,
    tibems_uint bytesSize );

COBOL Call

CALL "tibemsMapMsg_SetBytes"
     USING BY VALUE message,
           BY REFERENCE name,
           BY REFERENCE bytes,
           BY VALUE bytesSize,
           RETURNING tibems-status
END-CALL.

CALL "tibemsMapMsg_SetReferencedBytes"
     USING BY VALUE message,
           BY REFERENCE name,
           BY REFERENCE bytes,
           BY VALUE bytesSize,
           RETURNING tibems-status
END-CALL.
Note: message has usage pointer.

Parameters

Parameter Description
message Set the name and value pair in the body of this map message.
name Set the pair with this name.
bytes Associate this byte array value with the name.
bytesSize Set a byte array value of this length.

Remarks

tibemsMapMsg_SetBytes copies the byte array into the map message field. The program may free the orignal byte array after this call returns.

tibemsMapMsg_SetReferencedBytes adds a reference to the byte array, but does not copy the bytes. When the byte array is very large, it can be more efficient to avoid making a copy. However, the program must not free nor modify the original byte array until after freeing the map message.