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