TutOptionGetStrList


Name

TutOptionGetStrList — get the value of a string list option

Synopsis

T_BOOL TutOptionGetStrList(option, str_list_val_return) 
T_OPTION option; 
T_STR_LIST *str_list_val_return;  

Arguments

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.

Return Values

TRUE if value is retrieved successfully, FALSE otherwise.

Diagnostics

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

Description

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.

Caution

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.

See Also

TutOptionSetStrList

Examples

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