Read Me About OTClassicContext

1.0b3

OTClassicContext provides the glue necessary to call the Carbon "InContext" Open Transport APIs in an InterfaceLib environment. The goal is to allow you to build a Carbon and non-Carbon application (or extension) from the same source base without conditional compilation.

Open Transport tracks assets, like memory and endpoints, in a very Byzantine fashion. See DTS Technote 1173 Understanding Open Transport Asset Tracking for a full description. To make this clearer Carbon introduced a new set of Open Transport APIs, with the suffix "InContext", which explicitly describe the context to which assets are assigned. For example, in Carbon you must call OTOpenEndpointInContext rather than OTOpenEndpoint so that the system knows which client owns the endpoint.

The main problem with this technique is that it is hard to maintain a source base that compiles for both Carbon and non-Carbon applications and extensions. This glue is a way around that problem.

The glue in this sample supports PowerPC code compiled for OT 1.1.1 and above. See the Caveats section for an explanation of these restrictions.

A future version of the OT SDK will contain a final release of this glue.

Packing List

The sample contains the following items:

Using the Glue

To use this glue within your project, take the following steps.

  1. Remove any Open Transport "PPC.o" files from your project. This includes "OpenTransportAppPPC.o", "OpenTransportExtnPPC.o", "OpenTptATalkPPC.o", "OpenTptInetPPC.o", "OpenTptUtilsAppPPC.o", and "OpenTptUtilsExtnPPC.o", and their debug variants.
  2. Add the "OpenTransportClientPPC.o" file to your production build and "OpenTransportClientPPC.debug.o" to your debug build.
  3. Convert your source code to use the "InContext" versions of the Open Transport routines that create assets. See the Carbon documentation for details on these routines. If you use routines that create assets that aren't part of Carbon, for example OTStreamOpen, you must include "OTClassicContext.h" in your source.

Caveats

You should be aware of the caveats associated with this glue.

Credits and Version History

If you find any problems with this sample, mail <DTS@apple.com> and I'll try to fix them up.

1.0b1 (Sep 2000) was distributed to a small number of Apple engineers for review purposes.

1.0b2 (Oct 2000) was distributed to a small number of Apple engineers for review purposes. The glue is now included as an object file rather than source code.

1.0b3 (Oct 2000) was the first released version. The name of the object file has changed to better match the future OT SDK version.

Share and Enjoy.

Apple Developer Technical Support
Networking, Communications, Hardware

12 Oct 2000