TipcMsgNextChar get a CHAR field from a message
msg
message to get field from
char_return
storage for CHAR value from field
TRUE
if the field was successfully retrieved from the message, FALSE
otherwise.
If TipcMsgNextChar fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMsgNextChar retrieves the value of the current field of a message, which must be a CHAR (character) field. If TipcMsgNextChar succeeds, it advances the current field to the next field in the message.
TipcMsgNextChar converts the field into the data format used by this process if necessary.
If TipcMsgNextChar returns FALSE
, it does not store a value in char_return
.
This example creates a message, appends a CHAR field, and reads the field back from the message:
T_IPC_MT mt; T_IPC_MSG msg; T_CHAR char_val; #define USER_MT_CHAR_TEST 100 mt = TipcMtCreate("char_test", USER_MT_CHAR_TEST, "char"); if (mt == NULL) {return
; /* error */
} msg = TipcMsgCreate(mt); if (msg == NULL) {return
; /* error */
} if (!TipcMsgAppendChar(msg, 'x')) {return
; /* error */
} if (!TipcMsgSetCurrent(msg, 0)) {return
; /* error */
} if (!TipcMsgNextChar(msg, &char_val)) {return
; /* error */
} TutOut("char_val == %d\n", char_val);
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |