home *** CD-ROM | disk | FTP | other *** search
- /* Access to low-memory globals is provided in several different manners,
- depending on the header file used. THINK C has a header called "LoMem.h"
- that uses a special syntax to define low-memory globals. Usually,
- "LoMem.h" is included in the default precompiled header "MacHeaders".
- Since both "LoMem.h" and "SysEqu.h" declare symbols with identical names,
- only one of the files may be used. Apple's universal header "LowMem.h"
- declares functions (or macros) for accessing the low-memory globals. We
- determine if the universal header "LowMem.h" are being used by testing
- for USESROUTINEDESCRIPTORS. We determine if THINK C's "LoMem.h" is being
- used by testing for __LOMEM__. */
- #ifdef USESROUTINEDESCRIPTORS
- #include <LowMem.h>
- #else /* USESROUTINEDESCRIPTORS */
- #ifndef __LOMEM__
- #include <SysEqu.h>
- #define SysFontFam (0x0BA6)
- #define SysFontSiz (0x0BA8)
- #define LMGetApplLimit() (*(Ptr *) ApplLimit)
- #define LMGetHiliteMode() (*(Byte *) HiliteMode)
- #define LMGetResErrProc() (*(ProcPtr *) ResErrProc)
- #define LMGetResLoad() (*(short *) ResLoad)
- #define LMGetSysFontFam() (*(short *) SysFontFam)
- #define LMGetSysFontSize() (*(short *) SysFontSiz)
- #define LMSetApplLimit(v) ((void) (*(Ptr *) ApplLimit = (v)))
- #define LMSetHiliteMode(v) ((void) (*(Byte *) HiliteMode = (v)))
- #define LMSetResErrProc(v) ((void) (*(ProcPtr *) ResErrProc = (v)))
- #define LMSetResLoad(v) ((void) (*(short *) ResLoad = (v)))
- #define LMSetSysFontFam(v) ((void) (*(short *) SysFontFam = (v)))
- #define LMSetSysFontSize(v) ((void) (*(short *) SysFontSiz = (v)))
- #else /* __LOMEM__ */
- short SysFontFam : 0x0BA6;
- short SysFontSiz : 0x0BA8;
- #define LMGetApplLimit() (ApplLimit)
- #define LMGetHiliteMode() (HiliteMode)
- #define LMGetResErrProc() (ResErrProc)
- #define LMGetResLoad() (ResLoad)
- #define LMGetSysFontFam() (SysFontFam)
- #define LMGetSysFontSize() (SysFontSiz)
- #define LMSetApplLimit(v) ((void) (ApplLimit = (v)))
- #define LMSetHiliteMode(v) ((void) (HiliteMode = (v)))
- #define LMSetResErrProc(v) ((void) (ResErrProc = (v)))
- #define LMSetResLoad(v) ((void) (ResLoad = (v)))
- #define LMSetSysFontFam(v) ((void) (SysFontFam = (v)))
- #define LMSetSysFontSize(v) ((void) (SysFontSiz = (v)))
- #endif /* __LOMEM__ */
- #endif /* USESROUTINEDESCRIPTORS */
-