]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/otherlibs/win32unix/winlist.h
update
[l4.git] / l4 / pkg / ocaml / contrib / otherlibs / win32unix / winlist.h
1 /***********************************************************************/
2 /*                                                                     */
3 /*                           Objective Caml                            */
4 /*                                                                     */
5 /*  Contributed by Sylvain Le Gall for Lexifi                          */
6 /*                                                                     */
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.  */
11 /*                                                                     */
12 /***********************************************************************/
13
14 /* $Id: winlist.h 8961 2008-07-31 12:09:18Z xleroy $ */
15 #ifndef _WINLIST_H
16 #define _WINLIST_H
17
18 /* Basic list function in C. */
19
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.
24  *
25  * See winworker.c for example.
26  */
27 typedef struct _LIST LIST;
28 typedef LIST *LPLIST;
29
30 struct _LIST {
31   LPLIST lpNext;
32 };
33
34 /* Initialize list data structure */
35 void list_init (LPLIST lst);
36
37 /* Cleanup list data structure */
38 void list_cleanup (LPLIST lst);
39
40 /* Set next element */
41 void list_next_set (LPLIST lst, LPLIST next);
42
43 /* Return next element */
44 LPLIST list_next (LPLIST);
45
46 #define LIST_NEXT(T, e) ((T)(list_next((LPLIST)(e))))
47
48 /* Get number of element */
49 int list_length (LPLIST);
50
51 /* Concat two list. */
52 LPLIST list_concat (LPLIST, LPLIST);
53
54 #endif /* _WINLIST_H */