xref: /titanic_41/usr/src/cmd/fs.d/cachefs/mdbug/flist.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  *
24  *			flist.h
25  *
26  *   Defines a simple fixed size stack oriented list class
27  *
28  */
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 /* Copyright (c) 1994 by Sun Microsystems, Inc. */
31 
32 /*
33  * .LIBRARY Base
34  * .FILE flist.cxx
35  * .FILE flist.h
36  * .NAME flist - simple list manager class
37  *
38  * .DESCRIPTION
39  * The flist class is a simple list manager class designed specifically
40  * for use by the mdbug package.
41  * There is no destuctor for the class, so when an flist object is
42  * deleted any objects still on the list are forgotten.
43  */
44 
45 #ifndef FLIST_H
46 #define	FLIST_H
47 
48 #define	FLIST_SIZE  10	/* The number of items that will fit on list. */
49 
50 typedef struct flist_object {
51 	char	*f_items[FLIST_SIZE];	/* Pointers to the items. */
52 	int	 f_index;		/* Index of item returned by next(). */
53 	int	 f_count;		/* Number of items on list. */
54 
55 } flist_object_t;
56 
57 flist_object_t *flist_create();
58 void	 flist_destroy(flist_object_t *flist_object_p);
59 void	 fl_push(flist_object_t *flist_object_p, void *);
60 void	 fl_pop(flist_object_t *flist_object_p);
61 void	*fl_top(flist_object_t *flist_object_p);
62 void	*fl_next(flist_object_t *flist_object_p);
63 void	 fl_clear(flist_object_t *flist_object_p);
64 int	 fl_space(flist_object_t *flist_object_p);
65 #endif /* FLIST_H */
66