1 /***********************************************************************/
5 /* Contributed by Sylvain Le Gall for Lexifi */
7 /* Copyright 2008 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
14 /* $Id: winlist.h 8961 2008-07-31 12:09:18Z xleroy $ */
18 /* Basic list function in C. */
20 /* Singly-linked list data structure.
21 * To transform a C struct into a list structure, you must include
22 * at first position of your C struct a "LIST lst" and call list_init
23 * on this data structure.
25 * See winworker.c for example.
27 typedef struct _LIST LIST;
34 /* Initialize list data structure */
35 void list_init (LPLIST lst);
37 /* Cleanup list data structure */
38 void list_cleanup (LPLIST lst);
40 /* Set next element */
41 void list_next_set (LPLIST lst, LPLIST next);
43 /* Return next element */
44 LPLIST list_next (LPLIST);
46 #define LIST_NEXT(T, e) ((T)(list_next((LPLIST)(e))))
48 /* Get number of element */
49 int list_length (LPLIST);
51 /* Concat two list. */
52 LPLIST list_concat (LPLIST, LPLIST);
54 #endif /* _WINLIST_H */