34 lines
793 B
C
34 lines
793 B
C
#ifndef INCLUDED_C_ARRAYQUEUE_H
|
|||
|
|
#define INCLUDED_C_ARRAYQUEUE_H
|
||
|
|
|
||
|
|
#ifndef INCLUDED_C_TYPES_H
|
||
|
|
#include <c_Types.h>
|
||
|
|
#endif /*INCLUDED_C_TYPES_H*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
||
|
|
/* */
|
||
|
|
|
||
|
|
typedef struct {
|
||
|
|
void* array;
|
||
|
|
int obj_size;
|
||
|
|
c_size_t capacity;
|
||
|
|
c_size_t size;
|
||
|
|
}c_ArrayQueue_t;
|
||
|
|
|
||
|
|
|
||
|
|
c_err_t c_ArrayQueue_Init(c_ArrayQueue_t* self, int obj_size, c_size_t capacity);
|
||
|
|
|
||
|
|
void c_ArrayQueue_Destroy(c_ArrayQueue_t* self);
|
||
|
|
|
||
|
|
c_err_t c_ArrayQueue_Push(c_ArrayQueue_t* self, void* obj);
|
||
|
|
|
||
|
|
c_err_t c_ArrayQueue_Pop(c_ArrayQueue_t* self, void* obj);
|
||
|
|
|
||
|
|
void* c_ArrayQueue_Peek(c_ArrayQueue_t* self);
|
||
|
|
|
||
|
|
c_err_t c_ArrayQueue_Remove(c_ArrayQueue_t* self, c_size_t index);
|
||
|
|
|
||
|
|
#endif /*INCLUDED_C_ARRAYQUEUE_H*/
|