summaryrefslogtreecommitdiff
path: root/src/base/list.h
blob: 3813b35de95a32ccc87280b7ca2c4a98ee4a7f6a (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
25
26
27

#ifndef LIST_H
	#define LIST_H
	#define LIST_ALLOC_LIMIT 16

	#include "main.h"

	typedef struct list_str
	{
		void **list;
		int count;
		int alloc;
	} list_t;

	extern list_t* newList();
	extern list_t* cloneList(list_t *p);
	extern list_t* cloneListItem(list_t *p, void *f);
	extern void addList(list_t *p, void *item);
	extern void insList(list_t *p, int n, void *item);
	extern void *getList(list_t *p,int n);
	extern int searchListItem(list_t *p, void *n);
	extern void delList(list_t *p,int n);
	extern void delListItem(list_t *p,int n,void *f);
	extern void listDoEmpty(list_t *p);
	extern void destroyList(list_t *p);
	extern void destroyListItem(list_t *p,void *f);
#endif