safety push

This commit is contained in:
suchmememanyskill
2021-07-23 01:10:03 +02:00
parent b730c060c7
commit e41971c7d6
8 changed files with 139 additions and 44 deletions

View File

@@ -1,9 +1,20 @@
#include "dictionaryClass.h"
#include <string.h>
#include "garbageCollector.h"
#include "intClass.h"
u8 dictOneStrOneAll[] = { StringClass, VARARGCOUNT };
void addVariableToDict(Variable_t *dict, char* name, Variable_t *add){
Dict_t a = {.name = CpyStr(name), .var = add};
vecAdd(&dict->dictionary.vector, a);
}
void addIntToDict(Variable_t *dict, char* name, s64 integer){
Variable_t *v = newIntVariablePtr(integer);
addVariableToDict(dict, name, v);
}
Dict_t* getEntry(Vector_t *v, char* name) {
vecForEach(Dict_t*, dict, v) {
if (!strcmp(name, dict->name)) {