3 ** FACILITY: linklist.h
7 ** header file for the functions from linklist.c
11 ** Kurt Van den Branden
13 ** CREATION DATE: 22/01/97
18 ** Copyright (C) 1998 Kurt Van den Branden
20 ** This program is free software; you can redistribute it and/or modify
21 ** it under the terms of the GNU General Public License as published by
22 ** the Free Software Foundation; either version 2 of the License, or
23 ** (at your option) any later version.
25 ** This program is distributed in the hope that it will be useful,
26 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
27 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ** GNU General Public License for more details.
30 ** You should have received a copy of the GNU General Public License
31 ** along with this program; if not, write to the Free Software
32 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 #define _LINKLIST_H_ 1
39 ** use the following define to include some improvements for making
40 ** some functions faster (llitembynr en pushll)
44 typedef struct _listitem
{
45 void * itemptr
; /* pointer to user data structure */
46 struct _listitem
* next
;
50 ** header for a list, this is what the user will use to call
67 int newlist (listheader
* head
);
69 #define newlist(x) x->firstitem = NULL;
72 int insertll (listheader
* head
, void * newitem
, int (* compfunction
)());
73 void * searchll (listheader
* head
, void * item
, int (* compfunction
)());
74 int emptyll (listheader
* head
, void (* delfunction
)(void *));
75 int doll (listheader
* head
, void (* dofunction
)());
76 void * getnextll (listheader
* head
, void * item
);
77 listheader
* copyll (listheader
* head
, void * (* copyfunction
)());
78 void * llitembynr (listheader
* head
, int nr
);
79 void * llrembynr (listheader
* head
, int nr
);
80 int pushll (listheader
* head
, void * newitem
);
81 int unshiftll (listheader
* head
, void * newitem
);
82 void * llremitem (listheader
* head
, void * newitem
, int (* compfunction
)());
83 int findlastll (listheader
* head
, int (* checkfunction
)(void*));
84 int lllength (listheader
* head
);