summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_linklist.h
blob: 6d97899986b4d6b3177f9a147b2b673e74c591c4 (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
28
29
30
31
32
33
34
35

#ifndef _LINKLIST_H_
#define _LINKLIST_H_

struct linklist_node
{
  struct linklist_node *prev;
  struct linklist_node *next;

  void *data;
};

struct linklist
{
  int count;
  struct linklist_node *head;
  struct linklist_node *tail;

  int    (*cmp) (void *, void *);
};

void *linklist_lookup (void *data, struct linklist *linklist);
int   linklist_add (void *data, struct linklist *linklist);
int   linklist_remove (void *data, struct linklist *linklist);
void  linklist_remove_all (struct linklist *linklist);

void linklist_head (struct linklist *linklist, struct linklist_node *node);
int  linklist_end (struct linklist_node *node);
void linklist_next (struct linklist_node *node);

struct linklist *linklist_create ();
void linklist_delete (struct linklist *);

#endif /*_LINKLIST_H_*/