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"
16 * To simplify very common usage of circular linked links, whose nodes can hold only one or two trivial values,
17 * we define some generic node types, called the simple nodes.
19 * To avoid some type casts, values in simple nodes are defined as unions of most frequent types.
23 * Simple node with one value.
25 typedef struct simp_node {
36 * Simple node with two values.
38 typedef struct simp2_node {
57 * Allocate a new one-value node on memory pool @mp and insert it to @l. The value is undefined and should be changed afterwards.
59 simp_node *simp_append(struct mempool *mp, clist *l);
62 * Allocate a new two-value node on memory pool @mp and insert it to @l. The values are undefined and should be changed afterwards.
64 simp2_node *simp2_append(struct mempool *mp, clist *l);
66 /* Configuration sections */
69 * Default definition of the configuration section with one-value string node. Identifier of the value is `String`.
71 extern struct cf_section cf_string_list_config;
74 * Default definition of the configuration section with two-value string node. Identifiers of the values are `Src` and `Dest`.
76 extern struct cf_section cf_2string_list_config;