1 /* Generic single linked list to keep various information
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4 Author: Kresten Krab Thorup
6 Modified by Douglas Torrance
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* As a special exception, if you link this library with files compiled with
26 GCC to produce an executable, this does not cause the resulting executable
27 to be covered by the GNU General Public License. This exception does not
28 however invalidate any other reasons why the executable file might be
29 covered by the GNU General Public License. */
34 typedef struct LinkedList
{
36 struct LinkedList
*tail
;
39 LinkedList
* list_cons(void* head
, LinkedList
* tail
);
41 int list_length(LinkedList
* list
);
43 void* list_nth(int index
, LinkedList
* list
);
45 void list_remove_head(LinkedList
** list
);
47 LinkedList
*list_remove_elem(LinkedList
* list
, void* elem
);
49 void list_mapcar(LinkedList
* list
, void(*function
)(void*));
51 LinkedList
*list_find(LinkedList
* list
, void* elem
);
53 void list_free(LinkedList
* list
);