Initial commit
This commit is contained in:
17
src/List/append.c
Normal file
17
src/List/append.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "../../include/ground.h"
|
||||
|
||||
void _GroundListAppend(GroundList* list, GroundValue value) {
|
||||
if (list->count + 1 >= list->capacity) {
|
||||
GroundValue* tmp = realloc(list->at, sizeof(GroundValue) * list->capacity * 2);
|
||||
if (tmp == NULL) {
|
||||
Ground.Flags.error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
list->at = tmp;
|
||||
list->capacity *= 2;
|
||||
}
|
||||
|
||||
list->at[list->count] = Ground.Copy.Value(&value);
|
||||
list->count++;
|
||||
}
|
||||
Reference in New Issue
Block a user