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