34 lines
866 B
C
34 lines
866 B
C
#ifndef INCLUDED_C_ARRAYLIST_H
|
|||
|
|
#define INCLUDED_C_ARRAYLIST_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_ArrayList_t;
|
||
|
|
|
||
|
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
||
|
|
/* */
|
||
|
|
|
||
|
|
c_err_t c_ArrayList_Init(c_ArrayList_t* self, c_size_t obj_size, c_size_t capacity);
|
||
|
|
|
||
|
|
void c_ArrayList_Destroy(c_ArrayList_t* self);
|
||
|
|
|
||
|
|
c_err_t c_ArrayList_Add(c_ArrayList_t* self, void* obj);
|
||
|
|
|
||
|
|
void* c_ArrayList_Get(c_ArrayList_t* self, c_size_t index);
|
||
|
|
|
||
|
|
c_err_t c_ArrayList_Remove(c_ArrayList_t* self, c_size_t index);
|
||
|
|
|
||
|
|
#endif /*INCLUDED_C_ARRAYLIST_H*/
|