2 * UCW Library -- Linked Lists of Simple Items
4 * (c) 2006 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
10 #ifndef _UCW_SIMPLE_LISTS_H
11 #define _UCW_SIMPLE_LISTS_H
13 #include <ucw/clists.h>
15 #ifdef CONFIG_UCW_CLEAN_ABI
16 #define cf_2string_list_config ucw_cf_2string_list_config
17 #define cf_string_list_config ucw_cf_string_list_config
18 #define simp2_append ucw_simp2_append
19 #define simp_append ucw_simp_append
23 * To simplify very common usage of circular linked links, whose nodes can hold only one or two trivial values,
24 * we define some generic node types, called the simple nodes.
26 * To avoid some type casts, values in simple nodes are defined as unions of most frequent types.
30 * Simple node with one value.
32 typedef struct simp_node {
43 * Simple node with two values.
45 typedef struct simp2_node {
64 * Allocate a new one-value node on memory pool @mp and insert it to @l. The value is undefined and should be changed afterwards.
66 simp_node *simp_append(struct mempool *mp, clist *l);
69 * Allocate a new two-value node on memory pool @mp and insert it to @l. The values are undefined and should be changed afterwards.
71 simp2_node *simp2_append(struct mempool *mp, clist *l);
73 /* Configuration sections */
76 * Default definition of the configuration section with one-value string node. Identifier of the value is `String`.
78 extern struct cf_section cf_string_list_config;
81 * Default definition of the configuration section with two-value string node. Identifiers of the values are `Src` and `Dest`.
83 extern struct cf_section cf_2string_list_config;