xref: /illumos-gate/usr/src/cmd/man/stringlist.h (revision 95c635efb7c3b86efc493e0447eaec7aecca3f0f)
1*95c635efSGarrett D'Amore /*
2*95c635efSGarrett D'Amore  * Copyright (c) 1994 Christos Zoulas
3*95c635efSGarrett D'Amore  * All rights reserved.
4*95c635efSGarrett D'Amore  *
5*95c635efSGarrett D'Amore  * Redistribution and use in source and binary forms, with or without
6*95c635efSGarrett D'Amore  * modification, are permitted provided that the following conditions
7*95c635efSGarrett D'Amore  * are met:
8*95c635efSGarrett D'Amore  * 1. Redistributions of source code must retain the above copyright
9*95c635efSGarrett D'Amore  *    notice, this list of conditions and the following disclaimer.
10*95c635efSGarrett D'Amore  * 2. Redistributions in binary form must reproduce the above copyright
11*95c635efSGarrett D'Amore  *    notice, this list of conditions and the following disclaimer in the
12*95c635efSGarrett D'Amore  *    documentation and/or other materials provided with the distribution.
13*95c635efSGarrett D'Amore  * 3. All advertising materials mentioning features or use of this software
14*95c635efSGarrett D'Amore  *    must display the following acknowledgement:
15*95c635efSGarrett D'Amore  *	This product includes software developed by Christos Zoulas.
16*95c635efSGarrett D'Amore  * 4. The name of the author may not be used to endorse or promote products
17*95c635efSGarrett D'Amore  *    derived from this software without specific prior written permission.
18*95c635efSGarrett D'Amore  *
19*95c635efSGarrett D'Amore  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
20*95c635efSGarrett D'Amore  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21*95c635efSGarrett D'Amore  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*95c635efSGarrett D'Amore  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23*95c635efSGarrett D'Amore  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*95c635efSGarrett D'Amore  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25*95c635efSGarrett D'Amore  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26*95c635efSGarrett D'Amore  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27*95c635efSGarrett D'Amore  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28*95c635efSGarrett D'Amore  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29*95c635efSGarrett D'Amore  * SUCH DAMAGE.
30*95c635efSGarrett D'Amore  */
31*95c635efSGarrett D'Amore 
32*95c635efSGarrett D'Amore /*
33*95c635efSGarrett D'Amore  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
34*95c635efSGarrett D'Amore  */
35*95c635efSGarrett D'Amore 
36*95c635efSGarrett D'Amore #ifndef _STRINGLIST_H_
37*95c635efSGarrett D'Amore #define	_STRINGLIST_H_
38*95c635efSGarrett D'Amore 
39*95c635efSGarrett D'Amore #include <sys/types.h>
40*95c635efSGarrett D'Amore 
41*95c635efSGarrett D'Amore typedef struct _stringlist {
42*95c635efSGarrett D'Amore 	char	**sl_str;
43*95c635efSGarrett D'Amore 	size_t	sl_max;
44*95c635efSGarrett D'Amore 	size_t	sl_cur;
45*95c635efSGarrett D'Amore } stringlist;
46*95c635efSGarrett D'Amore 
47*95c635efSGarrett D'Amore stringlist	*sl_init(void);
48*95c635efSGarrett D'Amore int		sl_add(stringlist *, char *);
49*95c635efSGarrett D'Amore void		sl_free(stringlist *, int);
50*95c635efSGarrett D'Amore char		*sl_find(stringlist *, char *);
51*95c635efSGarrett D'Amore 
52*95c635efSGarrett D'Amore #endif	/* _STRINGLIST_H_ */
53