Toy 1.1.6
The Toy programming language is an imperative bytecode-intermediate embedded scripting language
Loading...
Searching...
No Matches
toy_literal_array.h
Go to the documentation of this file.
1
7#ifndef TOY_LITERAL_ARRAY_H_
8#define TOY_LITERAL_ARRAY_H_
9
10#include <stdbool.h>
11
12#include "toy_common.h"
13#include "toy_literal.h"
14
20typedef struct Toy_LiteralArray {
23 int count;
25
33
41
51
60
71
82
92
93//TODO: add a function to get the capacity & count
94
95#endif /* TOY_LITERAL_ARRAY_H_ */
@????@
Definition: toy_literal_array.h:20
Toy_Literal * literals
Definition: toy_literal_array.h:21
int count
Definition: toy_literal_array.h:23
int capacity
Definition: toy_literal_array.h:22
Definition: toy_literal.h:85
TOY_API void Toy_freeLiteralArray(Toy_LiteralArray *array)
Frees a Toy_LiteralArray pointed to by array. Every literal within is passed to Toy_freeLiteral befor...
TOY_API bool Toy_setLiteralArray(Toy_LiteralArray *array, Toy_Literal index, Toy_Literal value)
Frees the literal at the position represented by the integer literal index, and stores value in its p...
TOY_API Toy_Literal Toy_getLiteralArray(Toy_LiteralArray *array, Toy_Literal index)
Returns the literal at the position represented by the integer literal index, or returns a null liter...
TOY_API int Toy_pushLiteralArray(Toy_LiteralArray *array, Toy_Literal literal)
Adds a new literal to the end of the array, growing the array's internal buffer if needed.
TOY_API void Toy_initLiteralArray(Toy_LiteralArray *array)
initializes a Toy_LiteralArray pointed to by array.
int Toy_findLiteralIndex(Toy_LiteralArray *array, Toy_Literal literal)
@????@
TOY_API Toy_Literal Toy_popLiteralArray(Toy_LiteralArray *array)
Removes the literal at the end of the array.