TutOptionGetEnumList get the value of an enumerated list option
T_BOOL TutOptionGetEnumList(option
,enum_list_val_return
) T_OPTIONoption
; T_STR_LIST *enum_list_val_return
;
option
option that contains an enumerated list.
enum_list_val_return
pointer to a T_STR_LIST into which TutOptionGetEnumList copies a pointer to the enumerated list.
TRUE
if the value is retrieved successfully, FALSE
otherwise.
If TutOptionGetEnumList fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutOptionGetEnumList gets the enumerated list value of option
. A T_STR_LIST pointer value is copied into storage pointed to by enum_list_val_return
, but no additional space is allocated for the string itself. A T_STR_LIST is a linked list of strings.
The storage pointed to by enum_list_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_list_opt
:
T_OPTION enum_list_opt; T_STR_LIST enum_list_val, node; enum_list_opt = TutOptionLookup("enum_list_opt"); if (enum_list_opt == NULL) {/* error */
} if (!TutOptionGetEnumList(enum_list_opt, &enum_list_val)) {/* error */
}/* Dump the string values */
for (node = enum_list_val; node != NULL; node = node->next) { TutOut("%s\n", node->string); }
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |