~emersion/mrsh

ref: 4da12aae651dac2f0c6818f54d5d8b5f0a9e8bf6 mrsh/include/mrsh/array.h -rw-r--r-- 351 bytes
4da12aaeDrew DeVault Implement 'shift' builtin 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _MRSH_ARRAY_H
#define _MRSH_ARRAY_H

#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>

struct mrsh_array {
	void **data;
	size_t len, cap;
};

bool mrsh_array_reserve(struct mrsh_array *array, size_t size);
ssize_t mrsh_array_add(struct mrsh_array *array, void *value);
void mrsh_array_finish(struct mrsh_array *array);

#endif