~lattis/muon

ref: f9a8cbad39b665a9496cd3adb4756e85ee5ec97c muon/include/data/darr.h -rw-r--r-- 526 bytes
f9a8cbadStone Tickle print stdout/stderr of failing test 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef MUON_DATA_DARR_H
#define MUON_DATA_DARR_H

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

struct darr {
	size_t len;
	size_t cap;
	size_t item_size;
	uint8_t *e;
};

void darr_init(struct darr *da, size_t initial, size_t item_size);
void darr_destroy(struct darr *da);
size_t darr_push(struct darr *da, const void *item);
void *darr_get(const struct darr *da, size_t i);
void darr_del(struct darr *da, size_t i);
void darr_clear(struct darr *da);
void darr_grow_by(struct darr *da, size_t size);
#endif