home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-01 | 5.1 KB | 45 lines | [TEXT/CWIE] |
- /* This has been rewritten to use one damn handle to hold all of the data. -- JMB */
-
- #ifdef MPW
- #pragma segment TEKMAIN
- #endif
-
- #include "vgtek.proto.h"
- #include "rg0.proto.h"
- #include "rgmp.proto.h"
- #include "tekrgmac.proto.h"
- #include "tekdefs.h" /* NCSA: sb - all defines are now here, for easy access */
- #include "tekstor.proto.h"
-
- // thiselnum runs from 0 to (handlesize-1), which is in accordance with C style
- // arrays. The handle is indexed 0...(handlesize-1) as well. This is why you see
- // the various +-1's. -- JMB 8/93
-
- TEKSTOREP newTEKstore(void)
- {
- TEKSTOREP s;
-
- s = (TEKSTOREP) myNewPtr(sizeof(TEKSTORE));
- if (s == NULL) return (NULL);
-
- if (!(s->dataHandle = myNewHandle(0L)))
- return (NULL);
-
- s->thiselnum = 0;
-
- return(s);
- }
-
- void freeTEKstore(TEKSTOREP s)
- {
- DisposeHandle(s->dataHandle);
- DisposePtr((Ptr) s);
- }
-
- short addTEKstore(TEKSTOREP s, char d)
- {
- Size handlesize;
- OSErr memErr;
- handlesize = GetHandleSize(s->dataHandle);
- memErr = mySetHandleSize(s->dataHandle, ++handlesize);
- if (m