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