added stack datatype to std

This commit is contained in:
herbglitch 2024-02-08 02:48:14 -07:00
parent 875b69c407
commit c3b4a4e209
5 changed files with 145 additions and 0 deletions

18
include/arc/std/bool.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef ARC_STD_BOOL_H_
#define ARC_STD_BOOL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#define ARC_Bool bool
#define ARC_True true
#define ARC_False false
#ifdef __cplusplus
}
#endif
#endif //ARC_STD_BOOL_H_

0
include/arc/std/queue.h Normal file
View file

57
include/arc/std/stack.h Normal file
View file

@ -0,0 +1,57 @@
#ifndef ARC_STD_STACK_H_
#define ARC_STD_STACK_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* @brief a stack type
*/
typedef struct ARC_Stack ARC_Stack;
/**
* @brief creates ARC_Stack type
*
* @param stack ARC_Stack to initialize
*/
void ARC_Stack_Create(ARC_Stack **stack);
/**
* @brief destroyes ARC_Stack type
*/
void ARC_Stack_Destroy(ARC_Stack *stack);
/**
* @brief pushes value on stack
*
* @param stack ARC_Stack to push to
* @param data data that is being pushed
*/
void ARC_Stack_Push(ARC_Stack *stack, void *data);
/**
* @brief pops top off of ARC_Stack
*
* @param stack ARC_Stack to remove from
*
* @return the poped data from the stack as a void *
*/
void *ARC_Stack_Pop(ARC_Stack *stack);
/**
* @brief gets size of vector
*
* @param vector ARC_Vector to get size from
*
* @return the stacks size
*/
uint32_t ARC_Stack_Size(ARC_Stack *stack);
#ifdef __cplusplus
}
#endif
#endif //ARC_STD_STACK_H_