TutOptionGetType get the type of an option
option
option from which to retrieve type
opt_type
location to store type of specified option.
Type of option
.
If TutOptionGetType fails, it returns FALSE
and sets the global SmartSockets error number to:
TutOptionGetType returns the type of option
. Valid types are:
None
TutOptionCreate, TutOptionLookup
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 |