2,6 → 2,12 |
#define INCLUDE_COLLECTION_H |
#print "[include <collection.h>]\n" |
|
/*======================================================== |
= = |
= String = |
= = |
========================================================*/ |
|
struct collection |
{ |
int realloc_size, count; |
50,4 → 56,37 |
data_size = data_start = element_offset[count] = count = 0; |
} |
|
|
/*======================================================== |
= = |
= Integer = |
= = |
========================================================*/ |
|
struct collection_int |
{ |
int count; |
dword element[4096*3]; |
int add(); |
dword get(); |
void drop(); |
}; |
|
int collection_int::add(dword in) { |
if (count >= 4096*3) return 0; |
element[count] = in; |
count++; |
return 1; |
} |
|
dword collection_int::get(dword pos) { |
if (pos<0) || (pos>=count) return 0; |
return element[pos]; |
} |
|
void collection_int::drop() { |
element[0] = |
count = 0; |
} |
|
#endif |