#ifndef ARRAYLIST_H
#define ARRAYLIST_H

#define LIST_INITIAL_CAPACITY 4

typedef struct{
	void *elements;
	int *next;
	int *previous;
	int elemSize;
	int size;
	int capacity;
	int freeList;
	void (*printFn)(void *);
	void (*freeFn)(void *);
}LIST;

//typedef struct LIST LIST;

extern int arrayListCreate( LIST *l, int elemSize, void (*printFn)(void *), void (*freeFn)(void *));
extern int arrayListGetNode(LIST *l, int nodePosition);
extern int arrayListGet(LIST *l, int position, void *d);
extern int arrayListSet (LIST *l, int position, void *toSet, void *whatWasThere);
extern int arrayListAddBefore(LIST *l, int node, void *x);
extern int arrayListAdd(LIST *l, int position, void *x);
extern int arrayListRemoveNode(LIST *l, int node, void *d);
extern int arrayListRemoveAtPosition(LIST *l, int position, void *d);
extern int arrayListDispose(LIST *l);
extern int arrayListPrint(LIST *l);
extern int arrayListNextBigger( LIST *l, void *d, int (*cmpFn)(void *, void *));

#endif
