aboutsummaryrefslogtreecommitdiff
path: root/src/include/array.h
blob: d3004e3cfe9623f75f723b32b791f5bc428353ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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_del(array_t *a, unsigned int ind);

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

array_t *array_reverse(array_t *a);
#endif