sdk: const correctness
[sdk] / compiler / bootstrap / ecere / bootstrap / memory.c
1 /* Code generated from eC source file: memory.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
34
35 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
36
37 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
38
39 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
40
41 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
42
43 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
44
45 struct __ecereNameSpace__ecere__sys__BTNode;
46
47 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
48
49 struct __ecereNameSpace__ecere__sys__BinaryTree
50 {
51 struct __ecereNameSpace__ecere__sys__BTNode * root;
52 int count;
53 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
54 void (*  FreeKey)(void *  key);
55 } __attribute__ ((gcc_struct));
56
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
58
59 struct __ecereNameSpace__ecere__sys__OldList
60 {
61 void *  first;
62 void *  last;
63 int count;
64 unsigned int offset;
65 unsigned int circ;
66 } __attribute__ ((gcc_struct));
67
68 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
69
70 struct __ecereNameSpace__ecere__com__Class
71 {
72 struct __ecereNameSpace__ecere__com__Class * prev;
73 struct __ecereNameSpace__ecere__com__Class * next;
74 const char *  name;
75 int offset;
76 int structSize;
77 int (* *  _vTbl)();
78 int vTblSize;
79 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
80 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
81 int offsetClass;
82 int sizeClass;
83 struct __ecereNameSpace__ecere__com__Class * base;
84 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
85 struct __ecereNameSpace__ecere__sys__BinaryTree members;
86 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
87 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
88 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
89 struct __ecereNameSpace__ecere__sys__OldList derivatives;
90 int memberID;
91 int startMemberID;
92 int type;
93 struct __ecereNameSpace__ecere__com__Instance * module;
94 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
95 const char *  dataTypeString;
96 struct __ecereNameSpace__ecere__com__Instance * dataType;
97 int typeSize;
98 int defaultAlignment;
99 void (*  Initialize)();
100 int memberOffset;
101 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
102 const char *  designerClass;
103 unsigned int noExpansion;
104 const char *  defaultProperty;
105 unsigned int comRedefinition;
106 int count;
107 int isRemote;
108 unsigned int internalDecl;
109 void *  data;
110 unsigned int computeSize;
111 int structAlignment;
112 int destructionWatchOffset;
113 unsigned int fixed;
114 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
115 int inheritanceAccess;
116 const char *  fullName;
117 void *  symbol;
118 struct __ecereNameSpace__ecere__sys__OldList conversions;
119 struct __ecereNameSpace__ecere__sys__OldList templateParams;
120 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
121 struct __ecereNameSpace__ecere__com__Class * templateClass;
122 struct __ecereNameSpace__ecere__sys__OldList templatized;
123 int numParams;
124 unsigned int isInstanceClass;
125 unsigned int byValueSystemClass;
126 } __attribute__ ((gcc_struct));
127
128 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
129
130 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
131
132 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
133
134 struct __ecereNameSpace__ecere__com__Property
135 {
136 struct __ecereNameSpace__ecere__com__Property * prev;
137 struct __ecereNameSpace__ecere__com__Property * next;
138 const char *  name;
139 unsigned int isProperty;
140 int memberAccess;
141 int id;
142 struct __ecereNameSpace__ecere__com__Class * _class;
143 const char *  dataTypeString;
144 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
145 struct __ecereNameSpace__ecere__com__Instance * dataType;
146 void (*  Set)(void * , int);
147 int (*  Get)(void * );
148 unsigned int (*  IsSet)(void * );
149 void *  data;
150 void *  symbol;
151 int vid;
152 unsigned int conversion;
153 unsigned int watcherOffset;
154 const char *  category;
155 unsigned int compiled;
156 unsigned int selfWatchable;
157 unsigned int isWatchable;
158 } __attribute__ ((gcc_struct));
159
160 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
161
162 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
163
164 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
165
166 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
167
168 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
169
170 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
171
172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
173
174 struct __ecereNameSpace__ecere__com__Instance
175 {
176 int (* *  _vTbl)();
177 struct __ecereNameSpace__ecere__com__Class * _class;
178 int _refCount;
179 } __attribute__ ((gcc_struct));
180
181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
182
183 struct __ecereNameSpace__ecere__com__DataMember
184 {
185 struct __ecereNameSpace__ecere__com__DataMember * prev;
186 struct __ecereNameSpace__ecere__com__DataMember * next;
187 const char *  name;
188 unsigned int isProperty;
189 int memberAccess;
190 int id;
191 struct __ecereNameSpace__ecere__com__Class * _class;
192 const char *  dataTypeString;
193 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
194 struct __ecereNameSpace__ecere__com__Instance * dataType;
195 int type;
196 int offset;
197 int memberID;
198 struct __ecereNameSpace__ecere__sys__OldList members;
199 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
200 int memberOffset;
201 int structAlignment;
202 } __attribute__ ((gcc_struct));
203
204 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
205
206 struct __ecereNameSpace__ecere__com__Method
207 {
208 const char *  name;
209 struct __ecereNameSpace__ecere__com__Method * parent;
210 struct __ecereNameSpace__ecere__com__Method * left;
211 struct __ecereNameSpace__ecere__com__Method * right;
212 int depth;
213 int (*  function)();
214 int vid;
215 int type;
216 struct __ecereNameSpace__ecere__com__Class * _class;
217 void *  symbol;
218 const char *  dataTypeString;
219 struct __ecereNameSpace__ecere__com__Instance * dataType;
220 int memberAccess;
221 } __attribute__ ((gcc_struct));
222
223 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
224
225 struct __ecereNameSpace__ecere__com__SerialBuffer
226 {
227 unsigned char *  _buffer;
228 unsigned int count;
229 unsigned int _size;
230 unsigned int pos;
231 } __attribute__ ((gcc_struct));
232
233 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
234
235 struct __ecereNameSpace__ecere__com__DataValue
236 {
237 union
238 {
239 char c;
240 unsigned char uc;
241 short s;
242 unsigned short us;
243 int i;
244 unsigned int ui;
245 void *  p;
246 float f;
247 double d;
248 long long i64;
249 uint64 ui64;
250 } __attribute__ ((gcc_struct));
251 } __attribute__ ((gcc_struct));
252
253 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
254
255 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
256 {
257 union
258 {
259 struct
260 {
261 const char *  dataTypeString;
262 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
263 } __attribute__ ((gcc_struct));
264 struct __ecereNameSpace__ecere__com__DataValue expression;
265 struct
266 {
267 const char *  memberString;
268 union
269 {
270 struct __ecereNameSpace__ecere__com__DataMember * member;
271 struct __ecereNameSpace__ecere__com__Property * prop;
272 struct __ecereNameSpace__ecere__com__Method * method;
273 } __attribute__ ((gcc_struct));
274 } __attribute__ ((gcc_struct));
275 } __attribute__ ((gcc_struct));
276 } __attribute__ ((gcc_struct));
277
278 extern void *  memmove(void * , const void * , size_t size);
279
280 void __ecereNameSpace__ecere__sys__MoveBytes(void * dest, const void * source, unsigned int count)
281 {
282 memmove(dest, source, count);
283 }
284
285 extern void *  memcpy(void * , const void * , size_t size);
286
287 void __ecereNameSpace__ecere__sys__CopyBytes(void * dest, const void * source, unsigned int count)
288 {
289 memcpy(dest, source, count);
290 }
291
292 void __ecereNameSpace__ecere__sys__CopyBytesBy2(void * dest, const void * source, unsigned int count)
293 {
294 memcpy(dest, source, count << 1);
295 }
296
297 void __ecereNameSpace__ecere__sys__CopyBytesBy4(void * dest, const void * source, unsigned int count)
298 {
299 memcpy(dest, source, count << 2);
300 }
301
302 extern void *  memset(void *  area, int value, size_t count);
303
304 void __ecereNameSpace__ecere__sys__FillBytes(void * area, unsigned char value, unsigned int count)
305 {
306 memset(area, value, count);
307 }
308
309 void __ecereNameSpace__ecere__sys__FillBytesBy2(void * area, unsigned short value, unsigned int count)
310 {
311 unsigned short * dest = area;
312 int c;
313
314 for(c = 0; c < count; c++)
315 dest[c] = value;
316 }
317
318 void __ecereNameSpace__ecere__sys__FillBytesBy4(void * area, unsigned int value, unsigned int count)
319 {
320 unsigned int * dest = area;
321 int c;
322
323 for(c = 0; c < count; c++)
324 dest[c] = value;
325 }
326
327 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
328
329 struct __ecereNameSpace__ecere__com__GlobalFunction;
330
331 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
332
333 void __ecereRegisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
334 {
335 struct __ecereNameSpace__ecere__com__Class * class;
336
337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::MoveBytes", "void ecere::sys::MoveBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__MoveBytes, module, 1);
338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytes", "void ecere::sys::CopyBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytes, module, 1);
339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy2", "void ecere::sys::CopyBytesBy2(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy2, module, 1);
340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy4", "void ecere::sys::CopyBytesBy4(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy4, module, 1);
341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytes", "void ecere::sys::FillBytes(void * area, byte value, uint count)", __ecereNameSpace__ecere__sys__FillBytes, module, 1);
342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy2", "void ecere::sys::FillBytesBy2(void * area, uint16 value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy2, module, 1);
343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy4", "void ecere::sys::FillBytesBy4(void * area, uint value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy4, module, 1);
344 }
345
346 void __ecereUnregisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
347 {
348
349 }
350