TutOptionGetEnum


Name

TutOptionGetEnum — get the value of an enumerated option

Synopsis

T_BOOL TutOptionGetEnum(option, enum_val_return) 
T_OPTION option; 
T_STR *enum_val_return;  

Arguments

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.

Return Values

TRUE if the value is retrieved successfully, FALSE otherwise.

Diagnostics

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

Description

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.

Caution

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.

See Also

TutOptionSetEnum

Examples

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