Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:02

0001 /*  $NetBSD: stringlist.h,v 1.6 2006/07/27 15:37:19 christos Exp $  */
0002 
0003 /*-
0004  * Copyright (c) 1994 The NetBSD Foundation, Inc.
0005  * All rights reserved.
0006  *
0007  * This code is derived from software contributed to The NetBSD Foundation
0008  * by Christos Zoulas.
0009  *
0010  * Redistribution and use in source and binary forms, with or without
0011  * modification, are permitted provided that the following conditions
0012  * are met:
0013  * 1. Redistributions of source code must retain the above copyright
0014  *    notice, this list of conditions and the following disclaimer.
0015  * 2. Redistributions in binary form must reproduce the above copyright
0016  *    notice, this list of conditions and the following disclaimer in the
0017  *    documentation and/or other materials provided with the distribution.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
0020  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
0021  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0022  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
0023  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0024  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0025  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0026  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0027  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0028  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0029  * POSSIBILITY OF SUCH DAMAGE.
0030  */
0031 
0032 #ifndef LIBBSD_STRINGLIST_H
0033 #define LIBBSD_STRINGLIST_H
0034 
0035 #ifdef LIBBSD_OVERLAY
0036 #include <sys/cdefs.h>
0037 #else
0038 #include <bsd/sys/cdefs.h>
0039 #endif
0040 #include <sys/types.h>
0041 
0042 /*
0043  * Simple string list
0044  */
0045 typedef struct _stringlist {
0046     char    **sl_str;
0047     size_t    sl_max;
0048     size_t    sl_cur;
0049 } StringList;
0050 
0051 __BEGIN_DECLS
0052 StringList  *sl_init(void);
0053 int      sl_add(StringList *, char *);
0054 void         sl_free(StringList *, int);
0055 char        *sl_find(StringList *, const char *);
0056 int      sl_delete(StringList *, const char *, int);
0057 __END_DECLS
0058 
0059 #endif /* LIBBSD_STRINGLIST_H */