aboutsummaryrefslogtreecommitdiff
path: root/include/array.h
blob: 48d82db33291515c31f154e02ada6f3e701aa75a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef ARRAY_H
#define ARRAY_H
#include <stdlib.h>
#define DEFAULT_ARR_LEN 10
typedef struct {
  void **items;
  size_t size;
  size_t capacity;
} array_t;

array_t *init_array();

void array_push(array_t *a, void *item);

void *array_pop(array_t *a);

void array_free(void *a, void (*freefunc)(void *));
#endif