xref: /haiku/headers/compatibility/bsd/stringlist.h (revision 495060760727dd782c9f8a90db71e5d727f19748)
11d9d47fcSAxel Dörfler /*	$NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $	*/
21d9d47fcSAxel Dörfler 
31d9d47fcSAxel Dörfler /*
41d9d47fcSAxel Dörfler  * Copyright (c) 1994 Christos Zoulas
51d9d47fcSAxel Dörfler  * All rights reserved.
61d9d47fcSAxel Dörfler  *
71d9d47fcSAxel Dörfler  * Redistribution and use in source and binary forms, with or without
81d9d47fcSAxel Dörfler  * modification, are permitted provided that the following conditions
91d9d47fcSAxel Dörfler  * are met:
101d9d47fcSAxel Dörfler  * 1. Redistributions of source code must retain the above copyright
111d9d47fcSAxel Dörfler  *    notice, this list of conditions and the following disclaimer.
121d9d47fcSAxel Dörfler  * 2. Redistributions in binary form must reproduce the above copyright
131d9d47fcSAxel Dörfler  *    notice, this list of conditions and the following disclaimer in the
141d9d47fcSAxel Dörfler  *    documentation and/or other materials provided with the distribution.
151d9d47fcSAxel Dörfler  * 3. All advertising materials mentioning features or use of this software
161d9d47fcSAxel Dörfler  *    must display the following acknowledgement:
171d9d47fcSAxel Dörfler  *	This product includes software developed by Christos Zoulas.
181d9d47fcSAxel Dörfler  * 4. The name of the author may not be used to endorse or promote products
191d9d47fcSAxel Dörfler  *    derived from this software without specific prior written permission.
201d9d47fcSAxel Dörfler  *
211d9d47fcSAxel Dörfler  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
221d9d47fcSAxel Dörfler  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
231d9d47fcSAxel Dörfler  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241d9d47fcSAxel Dörfler  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
251d9d47fcSAxel Dörfler  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261d9d47fcSAxel Dörfler  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271d9d47fcSAxel Dörfler  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281d9d47fcSAxel Dörfler  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291d9d47fcSAxel Dörfler  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301d9d47fcSAxel Dörfler  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311d9d47fcSAxel Dörfler  * SUCH DAMAGE.
321d9d47fcSAxel Dörfler  *
331d9d47fcSAxel Dörfler  * $FreeBSD: src/include/stringlist.h,v 1.3 2003/01/19 01:16:00 obrien Exp $
341d9d47fcSAxel Dörfler  */
351d9d47fcSAxel Dörfler 
361d9d47fcSAxel Dörfler #ifndef _STRINGLIST_H
371d9d47fcSAxel Dörfler #define _STRINGLIST_H
38091a80aeSAdrien Destugues 
39*49506076SAdrien Destugues #include <features.h>
40091a80aeSAdrien Destugues 
41*49506076SAdrien Destugues #ifdef _DEFAULT_SOURCE
42091a80aeSAdrien Destugues 
43091a80aeSAdrien Destugues 
441d9d47fcSAxel Dörfler #include <sys/cdefs.h>
451d9d47fcSAxel Dörfler #include <sys/types.h>
461d9d47fcSAxel Dörfler 
471d9d47fcSAxel Dörfler /*
481d9d47fcSAxel Dörfler  * Simple string list
491d9d47fcSAxel Dörfler  */
501d9d47fcSAxel Dörfler typedef struct _stringlist {
511d9d47fcSAxel Dörfler 	char	**sl_str;
521d9d47fcSAxel Dörfler 	size_t	  sl_max;
531d9d47fcSAxel Dörfler 	size_t	  sl_cur;
541d9d47fcSAxel Dörfler } StringList;
551d9d47fcSAxel Dörfler 
561d9d47fcSAxel Dörfler __BEGIN_DECLS
571d9d47fcSAxel Dörfler StringList *sl_init(void);
581d9d47fcSAxel Dörfler int	 sl_add(StringList *, char *);
591d9d47fcSAxel Dörfler void	 sl_free(StringList *, int);
601d9d47fcSAxel Dörfler char	*sl_find(StringList *, char *);
611d9d47fcSAxel Dörfler __END_DECLS
621d9d47fcSAxel Dörfler 
63091a80aeSAdrien Destugues 
64091a80aeSAdrien Destugues #endif
65091a80aeSAdrien Destugues 
66091a80aeSAdrien Destugues 
671d9d47fcSAxel Dörfler #endif /* _STRINGLIST_H */
68