| 1 | /* stringlist.h,v 1.2 2004/09/14 22:27:36 bird Exp */
|
|---|
| 2 | /** @file
|
|---|
| 3 | * FreeBSD 5.2
|
|---|
| 4 | */
|
|---|
| 5 | /* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */
|
|---|
| 6 |
|
|---|
| 7 | /*
|
|---|
| 8 | * Copyright (c) 1994 Christos Zoulas
|
|---|
| 9 | * All rights reserved.
|
|---|
| 10 | *
|
|---|
| 11 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 12 | * modification, are permitted provided that the following conditions
|
|---|
| 13 | * are met:
|
|---|
| 14 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 15 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 16 | * 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 17 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 18 | * documentation and/or other materials provided with the distribution.
|
|---|
| 19 | * 3. All advertising materials mentioning features or use of this software
|
|---|
| 20 | * must display the following acknowledgement:
|
|---|
| 21 | * This product includes software developed by Christos Zoulas.
|
|---|
| 22 | * 4. The name of the author may not be used to endorse or promote products
|
|---|
| 23 | * derived from this software without specific prior written permission.
|
|---|
| 24 | *
|
|---|
| 25 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
|---|
| 26 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|---|
| 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|---|
| 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|---|
| 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|---|
| 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|---|
| 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|---|
| 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|---|
| 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|---|
| 34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|---|
| 35 | * SUCH DAMAGE.
|
|---|
| 36 | *
|
|---|
| 37 | * $FreeBSD: src/include/stringlist.h,v 1.3 2003/01/19 01:16:00 obrien Exp $
|
|---|
| 38 | */
|
|---|
| 39 |
|
|---|
| 40 | #ifndef _STRINGLIST_H
|
|---|
| 41 | #define _STRINGLIST_H
|
|---|
| 42 | #include <sys/cdefs.h>
|
|---|
| 43 | #include <sys/types.h>
|
|---|
| 44 |
|
|---|
| 45 | /*
|
|---|
| 46 | * Simple string list
|
|---|
| 47 | */
|
|---|
| 48 | typedef struct _stringlist {
|
|---|
| 49 | char **sl_str;
|
|---|
| 50 | size_t sl_max;
|
|---|
| 51 | size_t sl_cur;
|
|---|
| 52 | } StringList;
|
|---|
| 53 |
|
|---|
| 54 | __BEGIN_DECLS
|
|---|
| 55 | StringList *sl_init(void);
|
|---|
| 56 | int sl_add(StringList *, char *);
|
|---|
| 57 | void sl_free(StringList *, int);
|
|---|
| 58 | char *sl_find(StringList *, char *);
|
|---|
| 59 | __END_DECLS
|
|---|
| 60 |
|
|---|
| 61 | #endif /* _STRINGLIST_H */
|
|---|