Whole document tree
    

Whole document tree

Using PRC-Tools: 1.4.1 NewTypes.h
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4.1 NewTypes.h

With Palm OS SDKs prior to the 3.5 SDK, programmers were encouraged to use typedefs such as DWord and VoidHand rather than the built-in types. In the 3.5 SDK, the names of these typedefs have been changed to the somewhat more mnemonic UInt32 (etc) and the rather more functional MemHandle. (Previously there were two "handle" datatypes, VoidHand and Handle, with no real reason for a distinction between them, and programmers were continually casting between them. MemHandle corrects this historical accident.)

People wanting to write library header files capable of interacting with any SDK have a dilemma: which to use, old- or new-style type names?

You can use old-style names by instructing developers to include `PalmCompatibility.h' before including your header file if they are using the 3.5 SDK. But this is not very satisfactory: the onus shouldn't be on developers to get this right, and you might prefer to use new-style names.

You can ensure new-style names are available simply by including `NewTypes.h' at the top of your header file, and instructing developers to include at least `Common.h'/`PalmTypes.h' before your header. (They are probably including `Pilot.h'/`PalmOS.h' anyway.)

Including `NewTypes.h' provides the following:

  • The identifiers UInt8, Int8, UInt16, Int16, UInt32, Int32, MemPtr, and MemHandle are all typedeffed appropriately.

  • The macro SDK_VERSION is defined to one of 10, 20, 30, 31, 35, 40, and so on, indicating the SDK version which is in use.



This document was generated by root on January, 30 2002 using texi2html