home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-28 | 3.2 KB | 117 lines | [TEXT/KAHL] |
- typedef unsigned char uchar;
- typedef unsigned short ushort;
- typedef unsigned long ulong;
-
- extern struct Keyboard {
- short wasted;
- short wasted2;
- short wasted3;
- int command : 1;
- int : 5;
- int space : 1;
- int tab : 1;
- int : 4;
- int control : 1;
- int option : 1;
- int capslock : 1;
- int shift : 1;
- } keymap : 0x174;
-
- // theQDPort() is a quick way of getting the current port without having to
- // call GetPort.
-
- #pragma parameter __A0 theQDPort()
- pascal GrafPtr theQDPort(void) = { 0x2055, 0x2050 };
-
- // SetA4 is an inline for setting register a4 without using inline assembly.
- // it returns the old value of a4.
-
- #pragma parameter __A0 SetA4(__A0)
- pascal void *SetA4(void *newA4) = 0xC948;
-
- // CopyHandle is a better interface to HandToHand.
-
- #pragma parameter __A0 CopyHandle(__A0)
- pascal void *CopyHandle(void *) = {0xA9E1};
-
- // qGetHandleSize is just GetHandleSize, without the error checks.
-
- #pragma parameter __D0 qGetHandleSize(__A0)
- pascal Size qGetHandleSize(void *h) = 0xA025;
-
- // HandleOf is a better interface to PtrToHand
-
- #pragma parameter __A0 HandleOf(__A0, __D0)
- pascal void *HandleOf(void *, long) = {0xA9E3};
-
- // ClearSpace is a trivial inline for clearing space out.
-
- #pragma parameter ClearSpace(__A0, __D0)
- pascal void ClearSpace(void *, long) = {0x4218, 0x5380, 0x66FA};
-
- // QuickMove is faster than BlockMove for small moves. (and doesn't clear the cache)
-
- #pragma parameter QuickMove(__A0, __A1, __D0)
- pascal void QuickMove(void *from, void *to, short bytes) = {0x12D8, 0x5340, 0x66FA};
-
- // MakeALong makes a long out of two shorts efficiently.
-
- #pragma parameter __D0 MakeALong(__D0, __D1)
- pascal long MakeALong(short HiWord, short LoWord) = {0x4840, 0x3001};
-
- // MinShort takes the minimum of two input shorts efficiently
-
- #pragma parameter __D0 MinShort(__D0, __D1)
- pascal short MinShort (short a, short b) = {0xB240, 0x6E02, 0x3001};
-
- // MaxShort takes the maximum of two input shorts efficiently
-
- #pragma parameter __D0 MaxShort(__D0, __D1)
- pascal short MaxShort (short a, short b) = {0xB240, 0x6D02, 0x3001};
-
- // qLoWord quickly retrieves the low word of a long..
-
- #define qLoWord(l) ((short)(l))
-
- // qHiWord quickly retrieves the high word of a long..
-
- #pragma parameter __D0 qHiWord(__D0)
- pascal short qHiWord(long Long) = {0x4840};
-
- // qDelay is a better interface for Delay.
-
- #pragma parameter __A0 qDelay(__A0)
- pascal long qDelay(long numTicks)
- = {0xA03B};
-
- // PenWhite calls PenPat(white) from QuickDraw's globals.
-
- pascal void PenWhite(void)
- = {0x2055, 0x4868, 0xFFF8, 0xA89D};
-
- // PenBlack calls PenPat(black) from QuickDraw's globals.
-
- pascal void PenBlack(void)
- = {0x2055, 0x4868, 0xFFF0, 0xA89D};
-
- // PenGray calls PenPat(gray) from QuickDraw's globals.
-
- pascal void PenGray(void)
- = {0x2055, 0x4868, 0xFFE8, 0xA89D};
-
- // ArrowCursor calls SetCursor(arrow) from QuickDraw's globals.
-
- pascal void ArrowCursor(void)
- = {0x2055, 0x4868, 0xFF94, 0xA851};
-
- // PStringMove is a quick pascal string copy using the toolbox.
-
- #pragma parameter PStringMove(__A0,__A1)
- pascal void PStringMove(const void *srcPtr,void *destPtr)
- = {0x7001, 0xD010, 0xA02E};
-
- // Why HOpenResFile isn't declared this way, I don't know.
- // (Under System 7, HORF has its own trap)
-
- pascal short HOpenResFile7(short vRefNum,long dirID,ConstStr255Param fileName,
- char permission) = 0xA81A;