Add generic dynamic array type
This commit is contained in:
parent
89e548eca8
commit
7769f5fd58
6 changed files with 94 additions and 79 deletions
|
|
@ -5,24 +5,19 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "kubo_dynarray.h"
|
||||
#include "kubo_wall.h"
|
||||
|
||||
#define KUBO_CONTEXT_NUM_WALLS_ALLOC 4
|
||||
KUBO_DYNARRAY_REGISTER(kubo_wall_arr, struct kubo_wall *);
|
||||
|
||||
struct kubo_context {
|
||||
bool exit_pending;
|
||||
|
||||
struct kubo_wall **walls;
|
||||
unsigned int num_walls;
|
||||
unsigned int num_walls_alloc;
|
||||
struct kubo_wall_arr walls;
|
||||
};
|
||||
|
||||
struct kubo_context *kubo_context_init();
|
||||
void kubo_context_cleanup(struct kubo_context *context);
|
||||
|
||||
bool kubo_context_add_wall(struct kubo_context *context,
|
||||
struct kubo_wall *wall);
|
||||
|
||||
struct kubo_wall *kubo_context_get_pending_wall(struct kubo_context *context);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue