blob: 8421d32d3fa1d83fa64925211cc5088ccf4c4eae (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#pragma once
#include <stddef.h>
typedef struct ast_node ast_node_t;
typedef struct {
ast_node_t **_data;
size_t _cap;
size_t len;
} node_vec;
void node_vec_free(node_vec *v);
size_t node_vec_push(node_vec *v, ast_node_t *data);
ast_node_t *node_vec_get(node_vec *v, size_t idx);
ast_node_t *node_vec_rem_shift(node_vec *v, size_t idx);
ast_node_t *node_vec_rem(node_vec *v, size_t idx);
ast_node_t *node_vec_has(node_vec *v, ast_node_t *x,
int (*comp)(const ast_node_t *, const ast_node_t *));
void node_vec_shrink(node_vec *v);
|