1294109Sbapt/* $Id: compat_stringlist.h,v 1.4 2015/11/07 14:01:16 schwarze Exp $ */ 2294109Sbapt/* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */ 3294109Sbapt 4294109Sbapt/* 5294109Sbapt * Copyright (c) 1994 Christos Zoulas <christos@netbsd.org> 6294109Sbapt * All rights reserved. 7294109Sbapt * 8294109Sbapt * Redistribution and use in source and binary forms, with or without 9294109Sbapt * modification, are permitted provided that the following conditions 10294109Sbapt * are met: 11294109Sbapt * 1. Redistributions of source code must retain the above copyright 12294109Sbapt * notice, this list of conditions and the following disclaimer. 13294109Sbapt * 2. Redistributions in binary form must reproduce the above copyright 14294109Sbapt * notice, this list of conditions and the following disclaimer in the 15294109Sbapt * documentation and/or other materials provided with the distribution. 16294109Sbapt * 17294109Sbapt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 18294109Sbapt * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19294109Sbapt * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20294109Sbapt * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 21294109Sbapt * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22294109Sbapt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23294109Sbapt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24294109Sbapt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25294109Sbapt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26294109Sbapt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27294109Sbapt * SUCH DAMAGE. 28294109Sbapt */ 29294109Sbapt 30294109Sbapt#include <sys/types.h> 31294109Sbapt 32294109Sbapt/* 33294109Sbapt * Simple string list 34294109Sbapt */ 35294109Sbapttypedef struct _stringlist { 36294109Sbapt char **sl_str; 37294109Sbapt size_t sl_max; 38294109Sbapt size_t sl_cur; 39294109Sbapt} StringList; 40294109Sbapt 41294109Sbapt 42294109SbaptStringList *sl_init(void); 43294109Sbaptint sl_add(StringList *, char *); 44294109Sbaptvoid sl_free(StringList *, int); 45294109Sbaptchar *sl_find(StringList *, const char *); 46