-
Notifications
You must be signed in to change notification settings - Fork 10
/
lnklist.h
36 lines (32 loc) · 887 Bytes
/
lnklist.h
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
28
29
30
31
32
33
34
35
36
#ifndef __LNKLIST_H__
#define __LNKLIST_H__
#include <stdio.h>
#include <sys/types.h>
struct lnklist;
extern struct lnklist *
lnklist_create(void);
extern void
lnklist_destroy(struct lnklist *obj);
extern void
lnklist_destroy_with_destructor(struct lnklist *obj, void (*destructor)(void *));
extern ssize_t
lnklist_size(struct lnklist *obj);
extern void *
lnklist_add(struct lnklist *obj, void *data, int index);
extern void *
lnklist_add_tail(struct lnklist *obj, void *data);
extern void *
lnklist_remove(struct lnklist *obj, int index);
extern void *
lnklist_get(struct lnklist *obj, int index);
extern void
lnklist_iter_init(struct lnklist *obj);
extern int
lnklist_iter_hasnext(struct lnklist *obj);
extern void *
lnklist_iter_next(struct lnklist *obj);
extern void *
lnklist_iter_remove(struct lnklist *obj);
extern void *
lnklist_iter_remove_next(struct lnklist *obj);
#endif