TipcMsgFieldSetSize


Name

TipcMsgFieldSetSize — set the size of a message pointer field

Synopsis

T_BOOL TipcMsgFieldSetSize(field, size) 
T_IPC_MSG_FIELD field; 
T_INT4 size; 

Arguments

field — message pointer field to resize

size — new size (usually in bytes)

Return Values

TRUE if field size set successfully, FALSE if error occurred.

Diagnostics

If TipcMsgFieldSetSize fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcMsgFieldSetSize sets the size of a message pointer field (one created with a TipcMsgAppend*Ptr function). For scalar and binary field types, the size argument is specified in bytes. For all array field types (including MSG_ARRAY), the size argument is specified in elements. For individual MSG fields, the size argument must always be zero.

Caution

None

See Also

The TipcMsgAppend*Ptr functions

Examples

This example sets the size of a message pointer field:

T_CHAR str[80]; 
T_IPC_MSG_FIELD field; 
str[0] = '\0'; 
if (!TipcMsgAppendStrPtr(msg, str, &field)) { 
  return;  /* error */ 
}  
strcpy(str, "This is the field data."); 
if (!TipcMsgFieldSetSize(field, strlen(str) + 1)) { 
  return;  /* error */ 
} 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com