File: ll.h

package info (click to toggle)
l2tpns 2.1.21-1.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 820 kB
  • ctags: 1,621
  • sloc: ansic: 16,737; makefile: 160; sh: 142; perl: 139
file content (28 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (8)
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
#ifndef __LL_H__
#define __LL_H__

typedef struct s_li
{
    void *data;
    struct s_li *next;
} li;

typedef struct s_ll
{
    li *head;
    li *end;
    li *current;
} linked_list;

linked_list *ll_init();
void ll_done(linked_list *l);
li *ll_push(linked_list *l, void *data);
void ll_delete(linked_list *l, void *data);
void *ll_pop(linked_list *l);
void ll_iterate(linked_list *l, int(*func)(void *));
void ll_reset(linked_list *l);
void *ll_next(linked_list *l);
int ll_size(linked_list *l);
int ll_contains(linked_list *l, void *search);

#endif /* __LL_H__ */