clay/generator/array_add.template.c

7 lines
252 B
C
Raw Normal View History

2024-08-23 04:05:23 +00:00
$TYPE$ *$NAME$_Add($NAME$ *array, $TYPE$ item) {
if (Clay__Array_IncrementCapacityCheck(array->length, array->capacity)) {
array->internalArray[array->length++] = item;
return &array->internalArray[array->length - 1];
}
return $DEFAULT_VALUE$;
}