1 | 'basic.sbp
|
---|
2 |
|
---|
3 |
|
---|
4 | #ifndef _INC_BASIC
|
---|
5 | #define _INC_BASIC
|
---|
6 |
|
---|
7 |
|
---|
8 | Sub _System_InitDllGlobalVariables() 'dummy
|
---|
9 | End Sub
|
---|
10 |
|
---|
11 |
|
---|
12 | Const LONG_MAX = &H7FFFFFFF
|
---|
13 | Const LONG_MIN = &H80000000
|
---|
14 |
|
---|
15 | Const FLT_MAX = 3.402823466e+38
|
---|
16 | Const FLT_MIN = 1.175494351e-38
|
---|
17 |
|
---|
18 | '-------------
|
---|
19 | ' Basic Types
|
---|
20 | '-------------
|
---|
21 |
|
---|
22 | 'Char
|
---|
23 | 'Byte
|
---|
24 | 'Integer
|
---|
25 | 'Word
|
---|
26 | 'Long
|
---|
27 | TypeDef Int32 = Long
|
---|
28 | 'DWord
|
---|
29 | 'Int64
|
---|
30 | 'QWord
|
---|
31 | 'Single
|
---|
32 | 'Double
|
---|
33 |
|
---|
34 | TypeDef Int16 = Integer
|
---|
35 | TypeDef Int8 = SByte
|
---|
36 |
|
---|
37 | TypeDef BOOL = Long
|
---|
38 |
|
---|
39 |
|
---|
40 | ' Boolena型の定数
|
---|
41 | Const True = 1 As Boolean
|
---|
42 | Const False = 0 As Boolean
|
---|
43 |
|
---|
44 |
|
---|
45 |
|
---|
46 | '------------------
|
---|
47 | ' Types of pointer
|
---|
48 | '------------------
|
---|
49 | TypeDef BytePtr = *Byte
|
---|
50 | TypeDef WordPtr = *Word
|
---|
51 | TypeDef DWordPtr = *DWord
|
---|
52 | TypeDef SinglePtr = *Single
|
---|
53 | TypeDef DoublePtr = *Double
|
---|
54 |
|
---|
55 | #ifdef _WIN64
|
---|
56 | TypeDef LONG_PTR = Int64
|
---|
57 | TypeDef ULONG_PTR = QWord
|
---|
58 | TypeDef HALF_PTR = Long
|
---|
59 | TypeDef UHALF_PTR = DWord
|
---|
60 | #else
|
---|
61 | TypeDef LONG_PTR = Long
|
---|
62 | TypeDef ULONG_PTR = DWord
|
---|
63 | TypeDef HALF_PTR = Integer
|
---|
64 | TypeDef UHALF_PTR = Word
|
---|
65 | #endif
|
---|
66 | TypeDef DWORD_PTR = ULONG_PTR
|
---|
67 |
|
---|
68 | Sub Set_LONG_PTR(pPtr As VoidPtr, lpData As LONG_PTR)
|
---|
69 | #ifdef _WIN64
|
---|
70 | SetQWord(pPtr,lpData)
|
---|
71 | #else
|
---|
72 | SetDWord(pPtr,lpData)
|
---|
73 | #endif
|
---|
74 | End Sub
|
---|
75 |
|
---|
76 | Function Get_LONG_PTR(pPtr As VoidPtr) As LONG_PTR
|
---|
77 | #ifdef _WIN64
|
---|
78 | Get_LONG_PTR = GetQWord(pPtr)
|
---|
79 | #else
|
---|
80 | Get_LONG_PTR = GetDWord(pPtr)
|
---|
81 | #endif
|
---|
82 | End Function
|
---|
83 |
|
---|
84 | Sub SetChar(p As *Char, c As Char)
|
---|
85 | p[0] = c
|
---|
86 | End Sub
|
---|
87 |
|
---|
88 | Function GetChar(p As *Char) As Char
|
---|
89 | GetChar = p[0]
|
---|
90 | End Function
|
---|
91 |
|
---|
92 | TypeDef SIZE_T = ULONG_PTR
|
---|
93 | TypeDef SSIZE_T = LONG_PTR
|
---|
94 |
|
---|
95 | TypeDef WCHAR = Word
|
---|
96 |
|
---|
97 | '--------------------------
|
---|
98 | ' Specify elements number
|
---|
99 | '--------------------------
|
---|
100 | Const ELM(n) = (n - 1)
|
---|
101 |
|
---|
102 | #include <windows.sbp>
|
---|
103 | #include <crt.sbp>
|
---|
104 | #include <objbase.sbp>
|
---|
105 |
|
---|
106 |
|
---|
107 | Sub _System_GetEip() 'dummy
|
---|
108 | End Sub
|
---|
109 |
|
---|
110 |
|
---|
111 | Dim _System_CriticalSection As CRITICAL_SECTION
|
---|
112 | Dim _System_hProcessHeap As HANDLE
|
---|
113 |
|
---|
114 | Sub _System_StartupProgram()
|
---|
115 | 'この関数はアプリケーションの起動時にシステムからコールバックされます
|
---|
116 |
|
---|
117 | InitializeCriticalSection(_System_CriticalSection)
|
---|
118 |
|
---|
119 | _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
|
---|
120 |
|
---|
121 | _System_GC._System_CGarbageCollection()
|
---|
122 |
|
---|
123 | 'Initialize global variables
|
---|
124 | _System_InitDllGlobalVariables()
|
---|
125 |
|
---|
126 | 'Initialize static variables
|
---|
127 | _System_InitStaticLocalVariables()
|
---|
128 | End Sub
|
---|
129 |
|
---|
130 | Sub _System_EndProgram()
|
---|
131 | DeleteCriticalSection(_System_CriticalSection)
|
---|
132 | End Sub
|
---|
133 |
|
---|
134 |
|
---|
135 |
|
---|
136 | #include <system\string.sbp>
|
---|
137 | #include <system\debug.sbp>
|
---|
138 | #include <system\gc.sbp>
|
---|
139 | #include <system\enum.sbp>
|
---|
140 | #include <system\exception.ab>
|
---|
141 |
|
---|
142 | #include <Classes\index.ab>
|
---|
143 |
|
---|
144 |
|
---|
145 | #include <basic\function.sbp>
|
---|
146 | #include <basic\command.sbp>
|
---|
147 |
|
---|
148 |
|
---|
149 | #endif '_INC_BASIC
|
---|