Toy 1.1.6
The Toy programming language is an imperative bytecode-intermediate embedded scripting language
Loading...
Searching...
No Matches
toy_literal_dictionary.h
Go to the documentation of this file.
1
7#ifndef TOY_LITERAL_DICTIONARY_H_
8#define TOY_LITERAL_DICTIONARY_H_
9
10#include "toy_common.h"
11#include "toy_literal.h"
12
13//TODO: benchmark this
14#define TOY_DICTIONARY_MAX_LOAD 0.75
15
25
31typedef struct Toy_LiteralDictionary {
34 int count;
37
45
53
64
75
85
95
96#endif /* TOY_LITERAL_DICTIONARY_H_ */
Definition: toy_literal_dictionary.h:31
int contains
Definition: toy_literal_dictionary.h:35
Toy_private_dictionary_entry * entries
Definition: toy_literal_dictionary.h:32
int capacity
Definition: toy_literal_dictionary.h:33
int count
Definition: toy_literal_dictionary.h:34
Definition: toy_literal.h:85
Definition: toy_literal_dictionary.h:21
Toy_Literal value
Definition: toy_literal_dictionary.h:23
Toy_Literal key
Definition: toy_literal_dictionary.h:22
TOY_API void Toy_removeLiteralDictionary(Toy_LiteralDictionary *dictionary, Toy_Literal key)
Removes the key-value pair of literals from dictionary identified by key, if it exists....
TOY_API void Toy_initLiteralDictionary(Toy_LiteralDictionary *dictionary)
Initializes the Toy_LiteralDictionary pointed to by dictionary.
TOY_API Toy_Literal Toy_getLiteralDictionary(Toy_LiteralDictionary *dictionary, Toy_Literal key)
Returns the value of the literal within dictionary identified by key, or a null literal if it doesn't...
TOY_API void Toy_freeLiteralDictionary(Toy_LiteralDictionary *dictionary)
Frees a Toy_LiteralDictionary pointed to by dictionary. Every literal within is passed to Toy_freeLit...
TOY_API bool Toy_existsLiteralDictionary(Toy_LiteralDictionary *dictionary, Toy_Literal key)
Returns true if the key-value pair identified by key exists within dictionary, otherwise it returns f...
TOY_API void Toy_setLiteralDictionary(Toy_LiteralDictionary *dictionary, Toy_Literal key, Toy_Literal value)
Inserts the given key-value pair of literals into dictionary, creating it if it doesn't exist,...