TutOptionGetEnum get the value of an enumerated option
option
option that contains an enumerated value.
enum_val_return
pointer to a T_STR into which TutOptionGetEnum copies a pointer to the enumerated value.
TRUE
if the value is retrieved successfully, FALSE
otherwise.
If TutOptionGetEnum fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutOptionGetEnum gets the enumerated value of option
. A T_STR pointer value is copied into storage pointed to by enum_val_return
, but no additional space is allocated for the string itself.
The storage pointed to by enum_val_return
should not be modified or freed. The storage is thread safe, but may be overwritten by subsequent calls to SmartSockets APIs within the same thread. If you wish to preserve the value, you should make a copy of the value.
This example gets the value of the option named enum_opt
:
T_OPTION enum_opt; T_STR enum_val; enum_opt = TutOptionLookup("enum_opt"); if (enum_opt == NULL) {/* error */
} if (!TutOptionGetEnum(enum_opt, &enum_val)) {/* error */
}
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |