TutOptionGetStrList get the value of a string list option
T_BOOL TutOptionGetStrList(option
,str_list_val_return
) T_OPTIONoption
; T_STR_LIST *str_list_val_return
;
option
option that contains a string list.
str_list_val_return
pointer to a T_STR_LIST into which TutOptionGetStrList copies a pointer to the string list.
TRUE
if value is retrieved successfully, FALSE
otherwise.
If TutOptionGetStrList fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TutOptionGetStrList gets the string list value of option
. A T_STR_LIST pointer value is copied into storage pointed to by str_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 str_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 option name str_list_opt
:
T_OPTION str_list_opt; T_STR_LIST str_list_val, node; str_list_opt = TutOptionLookup("str_list_opt"); if (str_list_opt == NULL) {/* error */
} if (!TutOptionGetStrList(str_list_opt, &str_list_val)) {/* error */
}/* Dump the string values */
for (node = str_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 |