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