2018-03-28 14:22:07 -05:00
|
|
|
#ifndef __MYLIST_H__
|
|
|
|
#define __MYLIST_H__
|
|
|
|
|
2018-04-08 20:25:43 +02:00
|
|
|
#include <stddef.h>
|
2018-03-29 15:13:33 +02:00
|
|
|
#include <boolean.h>
|
2018-04-08 20:25:43 +02:00
|
|
|
#include <retro_common_api.h>
|
2019-01-20 02:26:33 +01:00
|
|
|
#include <dynamic/dylib.h>
|
2018-03-28 14:22:07 -05:00
|
|
|
|
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
2019-07-09 17:02:10 +02:00
|
|
|
typedef void *(*constructor_t)(void);
|
|
|
|
typedef void (*destructor_t )(void*);
|
2018-03-28 14:22:07 -05:00
|
|
|
|
|
|
|
typedef struct MyList_t
|
|
|
|
{
|
|
|
|
void **data;
|
|
|
|
int capacity;
|
|
|
|
int size;
|
2019-07-09 17:02:10 +02:00
|
|
|
constructor_t constructor;
|
|
|
|
destructor_t destructor;
|
2018-03-28 14:22:07 -05:00
|
|
|
} MyList;
|
|
|
|
|
|
|
|
void *mylist_add_element(MyList *list);
|
2018-04-08 20:25:43 +02:00
|
|
|
|
2019-07-09 17:02:10 +02:00
|
|
|
void mylist_resize(MyList *list, int newSize, bool run_constructor);
|
2018-04-08 20:25:43 +02:00
|
|
|
|
2019-07-09 17:02:10 +02:00
|
|
|
void mylist_create(MyList **list_p, int initial_capacity,
|
2018-04-08 20:25:43 +02:00
|
|
|
constructor_t constructor, destructor_t destructor);
|
|
|
|
|
2018-03-28 14:22:07 -05:00
|
|
|
void mylist_destroy(MyList **list_p);
|
2018-04-08 20:25:43 +02:00
|
|
|
|
2018-03-28 14:22:07 -05:00
|
|
|
void mylist_assign(MyList *list, int index, void *value);
|
2018-04-08 20:25:43 +02:00
|
|
|
|
2018-03-28 14:22:07 -05:00
|
|
|
void mylist_remove_at(MyList *list, int index);
|
2018-04-08 20:25:43 +02:00
|
|
|
|
2018-03-28 14:22:07 -05:00
|
|
|
void mylist_pop_front(MyList *list);
|
|
|
|
|
|
|
|
RETRO_END_DECLS
|
|
|
|
|
|
|
|
#endif
|