]> mj.ucw.cz Git - libucw.git/blob - ucw/simple-lists.c
Conf: Introduced cf_set_journalling()
[libucw.git] / ucw / simple-lists.c
1 /*
2  *      UCW Library -- Linked Lists of Simple Items
3  *
4  *      (c) 2006 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include <ucw/lib.h>
11 #include <ucw/mempool.h>
12 #include <ucw/conf.h>
13 #include <ucw/simple-lists.h>
14
15 simp_node *
16 simp_append(struct mempool *mp, clist *l)
17 {
18   simp_node *n = mp_alloc_fast(mp, sizeof(*n));
19   clist_add_tail(l, &n->n);
20   return n;
21 }
22
23 simp2_node *
24 simp2_append(struct mempool *mp, clist *l)
25 {
26   simp2_node *n = mp_alloc_fast(mp, sizeof(*n));
27   clist_add_tail(l, &n->n);
28   return n;
29 }
30
31 /* Configuration sections for common lists */
32
33 struct cf_section cf_string_list_config = {
34   CF_TYPE(simp_node),
35   CF_ITEMS {
36     CF_STRING("String", PTR_TO(simp_node, s)),
37     CF_END
38   }
39 };
40
41 struct cf_section cf_2string_list_config = {
42   CF_TYPE(simp2_node),
43   CF_ITEMS {
44     CF_STRING("Src", PTR_TO(simp2_node, s1)),
45     CF_STRING("Dest", PTR_TO(simp2_node, s2)),
46     CF_END
47   }
48 };