Prepended file names with "toy_"

This commit is contained in:
2023-01-23 21:45:52 +00:00
parent 59b0d15915
commit 047ccc5f16
29 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#pragma once
#include "toy_common.h"
#include "literal.h"
//TODO: benchmark this
#define DICTIONARY_MAX_LOAD 0.75
typedef struct _entry {
Literal key;
Literal value;
} _entry;
typedef struct LiteralDictionary {
_entry* entries;
int capacity;
int count;
int contains; //count + tombstones, for internal use
} LiteralDictionary;
TOY_API void initLiteralDictionary(LiteralDictionary* dictionary);
TOY_API void freeLiteralDictionary(LiteralDictionary* dictionary);
TOY_API void setLiteralDictionary(LiteralDictionary* dictionary, Literal key, Literal value);
TOY_API Literal getLiteralDictionary(LiteralDictionary* dictionary, Literal key);
TOY_API void removeLiteralDictionary(LiteralDictionary* dictionary, Literal key);
TOY_API bool existsLiteralDictionary(LiteralDictionary* dictionary, Literal key);