There are a number of utilities which I have written for the YAAF framework which provide functionality needed to get the framework off the ground. These utilities provide support that should have been provided by a standard C++ library (but the compiler doesn't implement the standard), or additional commonly-used utilites. This also provides an interface to some commonly used utilities which exist on both the Macintosh and/or Microsoft Windows, but the calling interface was different.
Roughly speaking, those utilities are:
Configuration-specific utilities
Data manipulation utilities
Cursor manipulation utilities
String manipulation
Dynamic array manipulation
Auto-pointer template
These macros and utilities help specify the target platform, and hide the differences between those platforms for some key, often used utilities.
Specify the platform the library is running on.
Specifies the platform's byte order
Rect, Point, EmptyRect(), PtInRect(), SectRect()
(Windows specific) declarations make the basic rectangle and point manipulation a little easier.
The data manipulation utilities provide routines for manipulating pascal-format strings, swapping the byte order, and getting the high and low order word out of a long-word.
MAKEDWORD(), GETLOWORD(), GETHIWORD()
Extract or concatenate high/low order words from a long-word argument
Convert from C to Pascal or Pascal to C format strings, using a string copy.
pstrcpy(), pstrcat(), pstrcmp()
Provides the functionality of the C string manipulation routines strcpy(), strcat(), and strcmp(), but for Pascal strings.
SwapWord(), SwapLong(), SwapFloat(), SwapDouble(), ...
Provides byte-order swapping for various sized objects. This allows you to swap the byte format from the Macintosh to Microsoft Windows and back again.
Cursor manipulation utilities allow you to change the mouse pointer to a different format. This also provides animated cursor support.
Set the cursor to the specified shape
InitCursorAnimation(), WaitCursor(), NormalCursor()
Animated cursor support. Used for putting up a cursor animation during a long computation
The control library needs to be able to manipulate dynamic strings. This provides a very simple implementation of dynamic string support.
Class for providing basic dynamic string support
This provides a very simple implementation for dynamic arrays, for use by the event management core
Template for dynamic array support.
This is a simple template for providing the same functionality of the autoptr template, which releases an allocated object when the stack is unwound past a particular function.
Template for auto pointer support