RetroArch/runahead/mylist.h

41 lines
787 B
C
Raw Normal View History

2018-03-28 19:22:07 +00:00
#ifndef __MYLIST_H__
#define __MYLIST_H__
2018-04-08 18:25:43 +00:00
#include <stddef.h>
#include <boolean.h>
2018-04-08 18:25:43 +00:00
#include <retro_common_api.h>
2018-03-28 19:22:07 +00:00
RETRO_BEGIN_DECLS
typedef void* (*constructor_t)(void);
typedef void(*destructor_t)(void*);
typedef struct MyList_t
{
void **data;
int capacity;
int size;
constructor_t Constructor;
destructor_t Destructor;
} MyList;
void *mylist_add_element(MyList *list);
2018-04-08 18:25:43 +00:00
2018-03-28 19:22:07 +00:00
void mylist_resize(MyList *list, int newSize, bool runConstructor);
2018-04-08 18:25:43 +00:00
void mylist_create(MyList **list_p, int initialCapacity,
constructor_t constructor, destructor_t destructor);
2018-03-28 19:22:07 +00:00
void mylist_destroy(MyList **list_p);
2018-04-08 18:25:43 +00:00
2018-03-28 19:22:07 +00:00
void mylist_assign(MyList *list, int index, void *value);
2018-04-08 18:25:43 +00:00
2018-03-28 19:22:07 +00:00
void mylist_remove_at(MyList *list, int index);
2018-04-08 18:25:43 +00:00
2018-03-28 19:22:07 +00:00
void mylist_pop_front(MyList *list);
RETRO_END_DECLS
#endif