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

@????@ More...

#include <stdbool.h>
#include "toy_common.h"
#include "toy_literal.h"

Go to the source code of this file.

Data Structures

struct  Toy_LiteralArray
 @????@ More...
 

Typedefs

typedef struct Toy_LiteralArray Toy_LiteralArray
 

Functions

TOY_API void Toy_initLiteralArray (Toy_LiteralArray *array)
 initializes a Toy_LiteralArray pointed to by array.
 
TOY_API void Toy_freeLiteralArray (Toy_LiteralArray *array)
 Frees a Toy_LiteralArray pointed to by array. Every literal within is passed to Toy_freeLiteral before its memory is released.
 
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 Toy_Literal Toy_popLiteralArray (Toy_LiteralArray *array)
 Removes the literal at the end of the array.
 
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 place.
 
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 literal if none is found. If index is not an integer literal or is out of bounds, this function returns a null literal.
 
int Toy_findLiteralIndex (Toy_LiteralArray *array, Toy_Literal literal)
 @????@
 

Detailed Description

@????@

Function Documentation

◆ Toy_findLiteralIndex()

int Toy_findLiteralIndex ( Toy_LiteralArray *  array,
Toy_Literal  literal 
)

@????@

Parameters
array
literal
Returns

◆ Toy_freeLiteralArray()

void Toy_freeLiteralArray ( Toy_LiteralArray *  array)

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

Parameters
array

◆ Toy_getLiteralArray()

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 literal if none is found. If index is not an integer literal or is out of bounds, this function returns a null literal.

Parameters
array
index
Returns

◆ Toy_initLiteralArray()

void Toy_initLiteralArray ( Toy_LiteralArray *  array)

initializes a Toy_LiteralArray pointed to by array.

Parameters
array

◆ Toy_popLiteralArray()

Toy_Literal Toy_popLiteralArray ( Toy_LiteralArray *  array)

Removes the literal at the end of the array.

Parameters
array
Returns
index of the deleted value.

◆ Toy_pushLiteralArray()

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.

Parameters
array
literal
Returns
index of the inserted value.

◆ Toy_setLiteralArray()

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

Parameters
array
index
value
Returns
true on success, otherwise it returns false.