TipcMsgNextBool


Name

TipcMsgNextBool — get a BOOL field from a message

Synopsis

T_BOOL TipcMsgNextBool(msg, bool_return) 
T_IPC_MSG msg; 
T_BOOL *bool_return; 

Arguments

msg — message to get field from

bool_return — storage for BOOL value from field

Return Values

TRUE if the field was successfully retrieved from the message, FALSE otherwise.

Diagnostics

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

Description

TipcMsgNextBool retrieves the value of the current field of a message, which must be a BOOL field. If TipcMsgNextBool succeeds, it advances the current field to the next field in the message.

If necessary, TipcMsgNextBool converts the field into the data format used by this process.

Caution

If TipcMsgNextBool returns FALSE, it does not store a value in bool_return.

Do not modify the value stored in bool_return. It points directly into an internal data structure.

See Also

TipcMsgAppendBool

Examples

This example creates a message, appends a BOOL field, and reads the field back from the message:

T_IPC_MT mt; 
T_IPC_MSG msg; 
T_BOOL value; 
 
#define USER_MT_BOOL_TEST 100 
mt = TipcMtCreate("bool_test", USER_MT_BOOL_TEST, "bool"); 
if (mt == NULL) { 
    return;  /* error */ 
} 
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
    return;  /* error */ 
} 
if (!TipcMsgAppendBool(msg. T_TRUE)) { 
    return;  /* error */ 
} 
if (!TipcMsgSetCurrent(msg, 0)) { 
    return;  /* error */ 
} 
if (!TipcMsgNextBool(msg, &value)) { 
    return;  /* error */ 
} 
TutOut("boolean value == %s\n", (value)?"True":"False"); 

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