1189251Ssam/*	$Id: compat_stringlist.h,v 1.5 2020/06/15 21:48:09 schwarze Exp $ */
2189251Ssam/*	$NetBSD: stringlist.h,v 1.7 2008/04/28 20:22:54 martin Exp $	*/
3189251Ssam
4189251Ssam/*-
5252726Srpaulo * Copyright (c) 1994 The NetBSD Foundation, Inc.
6252726Srpaulo * All rights reserved.
7189251Ssam *
8189251Ssam * This code is derived from software contributed to The NetBSD Foundation
9189251Ssam * by Christos Zoulas.
10189251Ssam *
11189251Ssam * Redistribution and use in source and binary forms, with or without
12214734Srpaulo * modification, are permitted provided that the following conditions
13214734Srpaulo * are met:
14214734Srpaulo * 1. Redistributions of source code must retain the above copyright
15189251Ssam *    notice, this list of conditions and the following disclaimer.
16189251Ssam * 2. Redistributions in binary form must reproduce the above copyright
17189251Ssam *    notice, this list of conditions and the following disclaimer in the
18189251Ssam *    documentation and/or other materials provided with the distribution.
19189251Ssam *
20189251Ssam * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21189251Ssam * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22189251Ssam * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23189251Ssam * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24189251Ssam * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25189251Ssam * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26189251Ssam * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27189251Ssam * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28189251Ssam * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29189251Ssam * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30189251Ssam * POSSIBILITY OF SUCH DAMAGE.
31189251Ssam */
32189251Ssam
33189251Ssam#include <sys/types.h>
34189251Ssam
35189251Ssam/*
36189251Ssam * Simple string list
37189251Ssam */
38189251Ssamtypedef struct _stringlist {
39189251Ssam	char	**sl_str;
40189251Ssam	size_t	  sl_max;
41189251Ssam	size_t	  sl_cur;
42189251Ssam} StringList;
43189251Ssam
44189251SsamStringList	*sl_init(void);
45189251Ssamint		 sl_add(StringList *, char *);
46189251Ssamvoid		 sl_free(StringList *, int);
47189251Ssamchar		*sl_find(StringList *, const char *);
48189251Ssamint		 sl_delete(StringList *, const char *, int);
49189251Ssam