TutOptionGetType


Name

TutOptionGetType — get the type of an option

Synopsis

T_BOOL TutOptionGetType(option, opt_type) 
T_OPTION option; 
T_OPT_TYPE *opt_type; 

Arguments

option — option from which to retrieve type

opt_type — location to store type of specified option.

Return Values

Type of option.

Diagnostics

If TutOptionGetType fails, it returns FALSE and sets the global SmartSockets error number to:

Description

TutOptionGetType returns the type of option. Valid types are:

Caution

None

See Also

TutOptionCreate, TutOptionLookup

Examples

This example prints the option type:

T_OPTION opt; 
T_OPT_TYPE option_type; 
 
opt = TutOptionLookup("any_option"); 
if (opt == NULL) { 
  /* error */ 
} 
 
if (!TutOptionGetType(opt, &option_type)) { 
  /* error */ 
} 
switch (option_type) { 
case T_OPT_TYPE_NUMERIC: 
  TutOut("Type of any_option is NUMERIC\n"); 
  break; 
case T_OPT_TYPE_ENUM: 
  TutOut("Type of any_option is ENUMERATED\n"); 
  break; 
case T_OPT_TYPE_BOOLEAN: 
  TutOut("Type of any_option is BOOLEAN\n"); 
  break; 
case T_OPT_TYPE_STRING: 
  TutOut("Type of any_option is STRING\n"); 
  break; 
case T_OPT_TYPE_LIST_ENUM: 
  TutOut("Type of any_option is ENUM LIST\n"); 
  break; 
case T_OPT_TYPE_LIST_STRING: 
  TutOut("Type of any_option is STRING LIST\n"); 
  break; 
case T_OPT_TYPE_LIST_NUMERIC: 
  TutOut("Type of any_option is NUMERIC LIST\n"); 
  break; 
default: 
  TutOut("Unknown Type\n"); 
} /* switch */ 

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