xref: /freebsd-src/cddl/contrib/opensolaris/tools/ctf/common/list.h (revision 1673e4046da975ab0e2bf67d45499930ebab0dbe)
1*1673e404SJohn Birrell /*
2*1673e404SJohn Birrell  * CDDL HEADER START
3*1673e404SJohn Birrell  *
4*1673e404SJohn Birrell  * The contents of this file are subject to the terms of the
5*1673e404SJohn Birrell  * Common Development and Distribution License, Version 1.0 only
6*1673e404SJohn Birrell  * (the "License").  You may not use this file except in compliance
7*1673e404SJohn Birrell  * with the License.
8*1673e404SJohn Birrell  *
9*1673e404SJohn Birrell  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*1673e404SJohn Birrell  * or http://www.opensolaris.org/os/licensing.
11*1673e404SJohn Birrell  * See the License for the specific language governing permissions
12*1673e404SJohn Birrell  * and limitations under the License.
13*1673e404SJohn Birrell  *
14*1673e404SJohn Birrell  * When distributing Covered Code, include this CDDL HEADER in each
15*1673e404SJohn Birrell  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*1673e404SJohn Birrell  * If applicable, add the following below this CDDL HEADER, with the
17*1673e404SJohn Birrell  * fields enclosed by brackets "[]" replaced with your own identifying
18*1673e404SJohn Birrell  * information: Portions Copyright [yyyy] [name of copyright owner]
19*1673e404SJohn Birrell  *
20*1673e404SJohn Birrell  * CDDL HEADER END
21*1673e404SJohn Birrell  */
22*1673e404SJohn Birrell /*
23*1673e404SJohn Birrell  * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
24*1673e404SJohn Birrell  * Use is subject to license terms.
25*1673e404SJohn Birrell  */
26*1673e404SJohn Birrell 
27*1673e404SJohn Birrell #ifndef _LIST_H
28*1673e404SJohn Birrell #define	_LIST_H
29*1673e404SJohn Birrell 
30*1673e404SJohn Birrell #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*1673e404SJohn Birrell 
32*1673e404SJohn Birrell /*
33*1673e404SJohn Birrell  * Routines for manipulating linked lists
34*1673e404SJohn Birrell  */
35*1673e404SJohn Birrell 
36*1673e404SJohn Birrell #ifdef __cplusplus
37*1673e404SJohn Birrell extern "C" {
38*1673e404SJohn Birrell #endif
39*1673e404SJohn Birrell 
40*1673e404SJohn Birrell typedef struct list list_t;
41*1673e404SJohn Birrell 
42*1673e404SJohn Birrell void list_add(list_t **, void *);
43*1673e404SJohn Birrell void slist_add(list_t **, void *, int (*)(void *, void *));
44*1673e404SJohn Birrell void *list_remove(list_t **, void *, int (*)(void *, void *, void *), void *);
45*1673e404SJohn Birrell void list_free(list_t *, void (*)(void *, void *), void *);
46*1673e404SJohn Birrell void *list_find(list_t *, void *, int (*)(void *, void *));
47*1673e404SJohn Birrell void *list_first(list_t *);
48*1673e404SJohn Birrell int list_iter(list_t *, int (*)(void *, void *), void *);
49*1673e404SJohn Birrell int list_count(list_t *);
50*1673e404SJohn Birrell int list_empty(list_t *);
51*1673e404SJohn Birrell void list_concat(list_t **, list_t *);
52*1673e404SJohn Birrell void slist_merge(list_t **, list_t *, int (*)(void *, void *));
53*1673e404SJohn Birrell 
54*1673e404SJohn Birrell #ifdef __cplusplus
55*1673e404SJohn Birrell }
56*1673e404SJohn Birrell #endif
57*1673e404SJohn Birrell 
58*1673e404SJohn Birrell #endif /* _LIST_H */
59