comparison dstep/coreservices/carboncore/MacMemory.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
comparison
equal deleted inserted replaced
10:27e00625790b 11:07194b026fa4
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Jul 21, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.coreservices.carboncore.MacMemory;
8
9 //import dstep.AvailabilityMacros;
10 import dstep.coreservices.carboncore.MacTypes;
11 import dstep.coreservices.carboncore.MixedMode;
12 //import dstep.string;
13
14 enum
15 {
16 maxSize = 0x7FFFFFF0
17 }
18
19 enum
20 {
21 defaultPhysicalEntryCount = 8
22 }
23
24 enum
25 {
26 kPageInMemory = 0,
27 kPageOnDisk = 1,
28 kNotPaged = 2
29 }
30
31 enum
32 {
33 k32BitHeap = 1,
34 kNewStyleHeap = 2,
35 kNewDebugHeap = 4
36 }
37
38 enum
39 {
40 kHandleIsResourceBit = 5,
41 kHandlePurgeableBit = 6,
42 kHandleLockedBit = 7
43 }
44
45 enum
46 {
47 kHandleIsResourceMask = 0x20,
48 kHandlePurgeableMask = 0x40,
49 kHandleLockedMask = 0x80
50 }
51
52 extern (C)
53 {
54 short MemError ();
55 short LMGetMemErr ();
56 void LMSetMemErr (short value);
57 Handle NewHandle (int byteCount);
58 Handle NewHandleClear (int byteCount);
59 Handle RecoverHandle (char* p);
60 char* NewPtr (int byteCount);
61 char* NewPtrClear (int byteCount);
62 Handle NewEmptyHandle ();
63 void HLock (Handle h);
64 void HLockHi (Handle h);
65 void HUnlock (Handle h);
66 Handle TempNewHandle (int logicalSize, OSErr* resultCode);
67 void DisposePtr (char* p);
68 int GetPtrSize (char* p);
69 void SetPtrSize (char* p, int newSize);
70 void DisposeHandle (Handle h);
71 void SetHandleSize (Handle h, int newSize);
72 int GetHandleSize (Handle h);
73 void ReallocateHandle (Handle h, int byteCount);
74 void EmptyHandle (Handle h);
75 void HSetRBit (Handle h);
76 void HClrRBit (Handle h);
77 byte HGetState (Handle h);
78 void HSetState (Handle h, byte flags);
79 short HandToHand (Handle* theHndl);
80 short PtrToXHand (void* srcPtr, Handle dstHndl, int size);
81 short PtrToHand (void* srcPtr, Handle* dstHndl, int size);
82 short HandAndHand (Handle hand1, Handle hand2);
83 short PtrAndHand (void* ptr1, Handle hand2, int size);
84 ubyte IsHeapValid ();
85 ubyte IsHandleValid (Handle h);
86 ubyte IsPointerValid (char* p);
87 }