// This file is a part of Julia. License is MIT: http://julialang.org/license

#ifndef ARRAYLIST_H
#define ARRAYLIST_H

#define AL_N_INLINE 29

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    size_t len;
    size_t max;
    void **items;
    void *_space[AL_N_INLINE];
} arraylist_t;

arraylist_t *arraylist_new(arraylist_t *a, size_t size);
void arraylist_free(arraylist_t *a);

void arraylist_push(arraylist_t *a, void *elt);
void *arraylist_pop(arraylist_t *a);
void arraylist_grow(arraylist_t *a, size_t n);

#ifdef __cplusplus
}
#endif

#endif
