]>
Commit | Line | Data |
---|---|---|
d7ce7006 | 1 | /** @file contains all the stringlist types and functions.\r |
2 | \r | |
3 | Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r | |
4 | This program and the accompanying materials are licensed and made available under\r | |
5 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
6 | The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php.\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | \r | |
13 | \r | |
14 | * Copyright (c) 1994 The NetBSD Foundation, Inc.\r | |
15 | * All rights reserved.\r | |
16 | *\r | |
17 | * This code is derived from software contributed to The NetBSD Foundation\r | |
18 | * by Christos Zoulas.\r | |
19 | *\r | |
20 | * Redistribution and use in source and binary forms, with or without\r | |
21 | * modification, are permitted provided that the following conditions\r | |
22 | * are met:\r | |
23 | * 1. Redistributions of source code must retain the above copyright\r | |
24 | * notice, this list of conditions and the following disclaimer.\r | |
25 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
26 | * notice, this list of conditions and the following disclaimer in the\r | |
27 | * documentation and/or other materials provided with the distribution.\r | |
28 | *\r | |
29 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r | |
30 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r | |
31 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r | |
32 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r | |
33 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r | |
34 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r | |
35 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r | |
36 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r | |
37 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r | |
38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r | |
39 | * POSSIBILITY OF SUCH DAMAGE.\r | |
40 | $NetBSD: stringlist.h,v 1.7 2008/04/28 20:22:54 martin Exp $\r | |
41 | **/\r | |
42 | \r | |
43 | #ifndef _STRINGLIST_H\r | |
44 | #define _STRINGLIST_H \r | |
45 | #include <sys/cdefs.h>\r | |
46 | #include <sys/types.h>\r | |
47 | \r | |
48 | /*\r | |
49 | * Simple string list\r | |
50 | */\r | |
51 | typedef struct _stringlist {\r | |
52 | char **sl_str;\r | |
53 | size_t sl_max;\r | |
54 | size_t sl_cur;\r | |
55 | } StringList;\r | |
56 | \r | |
57 | __BEGIN_DECLS\r | |
58 | StringList *sl_init(void);\r | |
59 | int sl_add(StringList *, char *);\r | |
60 | void sl_free(StringList *, int);\r | |
61 | char *sl_find(StringList *, const char *);\r | |
62 | int sl_delete(StringList *, const char *, int);\r | |
63 | __END_DECLS\r | |
64 | \r | |
65 | #endif /* _STRINGLIST_H */\r |