Toy 1.1.6
The Toy programming language is an imperative bytecode-intermediate embedded scripting language
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
toy_literal_dictionary.h File Reference

@???@ More...

#include "toy_common.h"
#include "toy_literal.h"

Go to the source code of this file.

Data Structures

struct  Toy_private_dictionary_entry
 
struct  Toy_LiteralDictionary
 

Macros

#define TOY_DICTIONARY_MAX_LOAD   0.75
 

Typedefs

typedef struct Toy_private_dictionary_entry Toy_private_dictionary_entry
 @???@
 
typedef struct Toy_LiteralDictionary Toy_LiteralDictionary
 @???@
 

Functions

TOY_API void Toy_initLiteralDictionary (Toy_LiteralDictionary *dictionary)
 Initializes the Toy_LiteralDictionary pointed to by dictionary.
 
TOY_API void Toy_freeLiteralDictionary (Toy_LiteralDictionary *dictionary)
 Frees a Toy_LiteralDictionary pointed to by dictionary. Every literal within is passed to Toy_freeLiteral before its memory is released.
 
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, or freeing and overwriting it if key is already present. This function may also expand the memory buffer if needed. Literal functions and opaques cannot be used as keys.
 
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 exist. Literal functions and opaques cannot be used as keys.
 
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. Literal functions and opaques cannot be used as keys.
 
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 false.
 

Detailed Description

@???@

Typedef Documentation

◆ Toy_LiteralDictionary

@???@

◆ Toy_private_dictionary_entry

@???@

Function Documentation

◆ Toy_existsLiteralDictionary()

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 false.

Parameters
dictionary
key
Returns

◆ Toy_freeLiteralDictionary()

void Toy_freeLiteralDictionary ( Toy_LiteralDictionary *  dictionary)

Frees a Toy_LiteralDictionary pointed to by dictionary. Every literal within is passed to Toy_freeLiteral before its memory is released.

Parameters
dictionary

◆ Toy_getLiteralDictionary()

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 exist. Literal functions and opaques cannot be used as keys.

Parameters
dictionary
key
Returns

◆ Toy_initLiteralDictionary()

void Toy_initLiteralDictionary ( Toy_LiteralDictionary *  dictionary)

Initializes the Toy_LiteralDictionary pointed to by dictionary.

Parameters
dictionary

◆ Toy_removeLiteralDictionary()

vvoid Toy_removeLiteralDictionary ( Toy_LiteralDictionary *  dictionary,
Toy_Literal  key 
)

Removes the key-value pair of literals from dictionary identified by key, if it exists. Literal functions and opaques cannot be used as keys.

Parameters
dictionary
key

◆ Toy_setLiteralDictionary()

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, or freeing and overwriting it if key is already present. This function may also expand the memory buffer if needed. Literal functions and opaques cannot be used as keys.

Parameters
dictionary
key
value