TutOptionCreate


Name

TutOptionCreate — create a new option

Synopsis

T_OPTION TutOptionCreate(name, type) 
T_STR name; 
T_OPT_TYPE type; 

Arguments

name — option name (not case sensitive)

type — option value type

Return Values

Returns pointer to new option, NULL if option already exists.

Diagnostics

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

Description

TutOptionCreate creates a new SmartSockets option. An option consists of name and type, where name is a string that is not case sensitive, and type is one of:

SmartSockets options are similar to environment variables used by operating systems, plus they have additional built-in type-checking capabilities. Option change callbacks can be used to notify you when the option’s value changes. See TutOptionChangeCbCreate on page 151 for more information on option change callbacks.

Caution

The name argument must be an identifier.

See Also

TutOptionLookup, TutOptionDestroy, TutOptionChangeCbCreate

Examples

This example creates a boolean option named bool_opt:

T_OPTION option; 
 
option = TutOptionCreate("bool_opt", T_OPT_TYPE_BOOLEAN); 
 
if (option == NULL) { 
  /* error */ 
} 

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