summaryrefslogtreecommitdiff
path: root/list.h
blob: a8cb24314082ec65a2db34b9630749c288213054 (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
36
37
38
39
40
41
/* $Id$
 * (c) 2000-2001 IC&S, The Netherlands
 *
 * list.h: list header */

#ifndef  _LIST_H
#define  _LIST_H

#include <sys/types.h>

/*
 * list data types
 */
struct element
{
  void *data;	
  size_t dsize;
  struct element *nextnode;	
};


struct list 
{
  struct element *start;
  long total_nodes;
};


struct element *list_nodeadd(struct list *tlist, const void *data,
				    size_t dsize);

struct element *list_nodedel(struct list *tlist, void *data);
struct element *list_nodepop(struct list *list);
struct element *list_getstart(struct list *tlist);
void list_freelist(struct element **start);
long list_totalnodes(struct list *tlist);
void list_showlist(struct list *tlist);
void list_init(struct list *tlist);
struct element* list_reverse(struct element *start);

#endif