basic queue written, still need to test
This commit is contained in:
parent
c3b4a4e209
commit
314f490bef
4 changed files with 140 additions and 6 deletions
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef ARC_STD_QUEUE_H_
|
||||
#define ARC_STD_QUEUE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief a queue type
|
||||
*/
|
||||
typedef struct ARC_Queue ARC_Queue;
|
||||
|
||||
/**
|
||||
* @brief creates ARC_Queue type
|
||||
*
|
||||
* @param queue ARC_Queue to initialize
|
||||
*/
|
||||
void ARC_Queue_Create(ARC_Queue **queue);
|
||||
|
||||
/**
|
||||
* @brief destroyes ARC_Queue type
|
||||
*/
|
||||
void ARC_Queue_Destroy(ARC_Queue *queue);
|
||||
|
||||
/**
|
||||
* @brief pushes value to end of queue
|
||||
*
|
||||
* @param queue ARC_Queue to push to
|
||||
* @param data data that is being pushed
|
||||
*/
|
||||
void ARC_Queue_Push(ARC_Queue *queue, void *data);
|
||||
|
||||
/**
|
||||
* @brief pops the front off of the ARC_Queue
|
||||
*
|
||||
* @param queue ARC_Queue to remove from
|
||||
*
|
||||
* @return the poped data from the queue as a void *
|
||||
*/
|
||||
void *ARC_Queue_Pop(ARC_Queue *queue);
|
||||
|
||||
/**
|
||||
* @brief gets size of queue
|
||||
*
|
||||
* @param vector ARC_Queue to get size from
|
||||
*
|
||||
* @return the queues size
|
||||
*/
|
||||
uint32_t ARC_Queue_Size(ARC_Queue *queue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //ARC_STD_QUEUE_H_
|
||||
|
|
@ -42,9 +42,9 @@ void ARC_Stack_Push(ARC_Stack *stack, void *data);
|
|||
void *ARC_Stack_Pop(ARC_Stack *stack);
|
||||
|
||||
/**
|
||||
* @brief gets size of vector
|
||||
* @brief gets size of stack
|
||||
*
|
||||
* @param vector ARC_Vector to get size from
|
||||
* @param stack ARC_Stack to get size from
|
||||
*
|
||||
* @return the stacks size
|
||||
*/
|
||||
|
|
@ -54,4 +54,4 @@ uint32_t ARC_Stack_Size(ARC_Stack *stack);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif //ARC_STD_STACK_H_
|
||||
#endif //ARC_STD_STACK_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue