TutOptionGetStr


Name

TutOptionGetStr — get the value of a string option

Synopsis

T_BOOL TutOptionGetStr(option, str_val_return) 
T_OPTION option; 
T_STR *str_val_return; 

Arguments

option — option that contains a string value.

str_val_return — pointer to a T_STR into which TutOptionGetStr copies a pointer to the string.

Return Values

TRUE if the value is retrieved successfully, FALSE otherwise.

Diagnostics

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

Description

TutOptionGetStr gets the string value of option. A T_STR pointer value is copied into storage pointed to by str_val_return, but no additional space is allocated for the string itself.

Caution

The storage pointed to by str_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

TutOptionSetStr

Examples

This example gets the value of the option named str_opt:

T_OPTION str_opt; 
T_STR str_val; 
 
str_opt = TutOptionLookup("str_opt"); 
if (str_opt == NULL) { 
  /* error */ 
} 
 
if (!TutOptionGetStr(str_opt, &str_val)) { 
  /* error */ 
} 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com