Important: The information in this document is obsolete and should not be used for new development.
OTCreateConfiguration
Creates a structure defining a provider's configuration.C INTERFACE
OTConfiguration* OTCreateConfiguration(const char* path);C++ INTERFACES
None. C++ applications use the C interface to this function.PARAMETERS
path- A pointer to a character string describing the provider.
- function result
- A pointer to a private
OTConfigurationstructure. If the value specified with the path parameter was invalid, the function returns the resultkOTInvalidConfigurationPtr. If there was not enough memory to create the structure, the function returns the resultkOTNoMemoryConfigurationPtr.DISCUSSION
TheOTCreateConfigurationfunction creates a configuration structure that defines the software modules, hardware ports, and options that Open Transport uses when you open a provider. This is a private structure, defined by theOTConfigurationdata type . To create a configuration structure, use thepathparameter to pass a string describing the provider service desired to theOTCreateConfigurationfunction.The simplest possible value of the
pathparameter is the name of the highest-level protocol you want to use; for example, "tcp". If you do not specify a complete communications path, Open Transport uses default settings to construct the rest of the path. For example, if you specify "adsp" for thepathparameter, Open Transport defaults to using the AppleTalk Data Stream Protocol (ADSP) protocol module layered above the Datagram Delivery Protocol (DDP) protocol module, which is, in turn, layered on the default port configured in the AppleTalk control panel.If you want to identify a particular port in the configuration string, you use the port name to do so, described in the chapter "Ports". More typically, however, you leave this value blank--for example, using a string with only "adsp", which configures the provider with whatever port is specified in the AppleTalk control panel.
To specify more than one protocol module, separate the module names with commas. You can also specify values for options by putting them in parentheses after the protocol name; for example,
"adsp, ddp(Checksum=1)"specifies that ADSP is to run on top of DDP and that the DDP checksum option is enabled. For a list of valid options for each protocol, see the corresponding protocol reference chapter.The
OTCreateConfigurationfunction returns a pointer to the configuration structure it creates. You pass this pointer as a parameter to the open-provider functions such as theOTOpenEndpointorOTOpenMapperfunctions. If the function returns an error code, it is safe to pass the error code as theOTOpenEndpointOTConfiguration* parameter.OTOpenEndpointwill return the appropriate error.SPECIAL CONSIDERATIONS
Functions that open providers dispose of theOTConfigurationstructure that they use, so you need to use theOTCloneConfigurationfunction to clone a configuration structure if you want to open multiple providers with the same configuration.SEE ALSO
"Reusing Provider Configurations".The
OTCloneConfigurationfunction.The
OTDestroyConfigurationfunction.The
OTOpenEndpointfunction. TheOTAsyncOpenEndpointfunction.