Files
Toy/source/toy_stack.h
Kayne Ruse 0504f4af8b Began writing Toy_VM, read more
Toy_VM and Toy_Stack are both considered WIP, and neither has any tests
yet.
2024-09-26 17:17:18 +10:00

19 lines
502 B
C

#pragma once
#include "toy_common.h"
#include "toy_value.h"
typedef struct Toy_Stack {
Toy_Value* ptr;
int capacity;
int count;
} Toy_Stack;
TOY_API void Toy_initStack(Toy_Stack* stack); //null memory
TOY_API void Toy_preallocateStack(Toy_Stack* stack); //non-null memory, ready to go
TOY_API void Toy_freeStack(Toy_Stack* stack);
TOY_API void Toy_pushStack(Toy_Stack* stack, Toy_Value value);
TOY_API Toy_Value Toy_peekStack(Toy_Stack* stack);
TOY_API Toy_Value Toy_popStack(Toy_Stack* stack);