16,7 → 16,8 |
dword element_offset[4000]; |
int add(); |
int addn(); |
dword get(); |
dword get(); //get_name_by_pos |
dword get_pos_by_name(); |
void drop(); |
void increase_data_size(); |
}; |
56,6 → 57,14 |
return data_start + element_offset[pos]; |
} |
|
:dword collection::get_pos_by_name(dword name) { |
dword i; |
for (i=0; i<count; i++) { |
if (strcmp(data_start + element_offset[i], name)==0) return i; |
} |
return -1; |
} |
|
:void collection::drop() { |
if (data_start) free(data_start); |
data_size = data_start = element_offset[count] = count = 0; |