new TypeId system

This commit is contained in:
2022-08-24 19:18:24 +06:00
parent 11c5b57856
commit 2e378d1458
14 changed files with 390 additions and 202 deletions

View File

@@ -46,12 +46,21 @@ void __Autoarr_free_##type(Autoarr_##type* ar){\
free(ar);\
}\
\
type* __Autoarr_toArray_##type(Autoarr_##type* ar){\
uint32 length=Autoarr_length(ar);\
type* array=malloc(length * sizeof(type));\
for(uint32 i=0; i<length; i++)\
array[i]=__Autoarr_get_##type(ar, i);\
return array;\
}\
\
__functions_list_t_##type __functions_list_##type={\
&__Autoarr_add_##type,\
&__Autoarr_get_##type,\
&__Autoarr_getptr_##type,\
&__Autoarr_set_##type,\
&__Autoarr_free_##type\
&__Autoarr_free_##type,\
&__Autoarr_toArray_##type\
};\
\
Autoarr_##type* __Autoarr_create_##type(uint16 max_blocks_count, uint16 max_block_length){\