126924Smsmith/* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */ 226924Smsmith 326924Smsmith/* 426924Smsmith * Copyright (c) 1994 Christos Zoulas 526924Smsmith * All rights reserved. 626924Smsmith * 726924Smsmith * Redistribution and use in source and binary forms, with or without 826924Smsmith * modification, are permitted provided that the following conditions 926924Smsmith * are met: 1026924Smsmith * 1. Redistributions of source code must retain the above copyright 1126924Smsmith * notice, this list of conditions and the following disclaimer. 1226924Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1326924Smsmith * notice, this list of conditions and the following disclaimer in the 1426924Smsmith * documentation and/or other materials provided with the distribution. 1526924Smsmith * 3. All advertising materials mentioning features or use of this software 1626924Smsmith * must display the following acknowledgement: 1726924Smsmith * This product includes software developed by Christos Zoulas. 1826924Smsmith * 4. The name of the author may not be used to endorse or promote products 1926924Smsmith * derived from this software without specific prior written permission. 2026924Smsmith * 2126924Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 2226924Smsmith * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 2326924Smsmith * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2426924Smsmith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 2526924Smsmith * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2626924Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2726924Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2826924Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2926924Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3026924Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3126924Smsmith * SUCH DAMAGE. 3293032Simp * 3393032Simp * $FreeBSD$ 3426924Smsmith */ 3526924Smsmith 3626924Smsmith#ifndef _STRINGLIST_H 3726924Smsmith#define _STRINGLIST_H 3826924Smsmith#include <sys/cdefs.h> 3926924Smsmith#include <sys/types.h> 4026924Smsmith 4126924Smsmith/* 4226924Smsmith * Simple string list 4326924Smsmith */ 4426924Smsmithtypedef struct _stringlist { 4526924Smsmith char **sl_str; 4626924Smsmith size_t sl_max; 4726924Smsmith size_t sl_cur; 4826924Smsmith} StringList; 4926924Smsmith 5026924Smsmith__BEGIN_DECLS 5193032SimpStringList *sl_init(void); 52109508Sobrienint sl_add(StringList *, char *); 5393032Simpvoid sl_free(StringList *, int); 54249802Seadlerchar *sl_find(StringList *, const char *); 5526924Smsmith__END_DECLS 5626924Smsmith 5726924Smsmith#endif /* _STRINGLIST_H */ 58