Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
configitem.h
Go to the documentation of this file.
1/*
2 CONFIGITEM.h - generalised hierarchy of configuration items
3
4 Copyright (C)
5 2008, Christian Thaeter <ct@pipapo.org>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
45#ifndef COMMON_CONFIGITEM_H
46#define COMMON_CONFIGITEM_H
47
48
49#include "lib/llist.h"
50
51/* Forward declarations */
52typedef struct lumiera_configitem_struct lumiera_configitem;
53typedef lumiera_configitem* LumieraConfigitem;
54
56
58
59#include <nobug.h>
60
61
62
68
70{
71 llist link; // all lines on the same hierarchy level are linked here (see children)
72 LumieraConfigitem parent; // parent section
73 llist children; // root node for all lines below this hierarchy
74
75 llist lookup; // all lines with the same key are stacked up on the lookup
76
77 char* line; // raw line as read in allocated here trailing \n will be replaced with \0
78 char* key; // pointer into line to start of key
79 size_t key_size;
80 char* delim; // delimiter, value starts at delim+1
81 struct lumiera_configitem_vtable* vtable; // functiontable for subclassing
82};
83
84
87
90
92lumiera_configitem_new (const char* line);
93
94void
96
98lumiera_configitem_set_value (LumieraConfigitem self, const char* delim_value);
99
101lumiera_configitem_parse (LumieraConfigitem self, const char* line);
102
105
106
107#endif /*COMMON_CONFIGITEM_H*/
108/*
109// Local Variables:
110// mode: C
111// c-file-style: "gnu"
112// indent-tabs-mode: nil
113// End:
114*/
Lookup of configuration keys in a low-level configuration system.
lumiera_config_lookup * LumieraConfigLookup
lumiera_configitem * LumieraConfigitem
Definition configitem.h:53
LumieraConfigitem lumiera_configitem_set_value(LumieraConfigitem self, const char *delim_value)
Definition configitem.c:122
LumieraConfigitem lumiera_configitem_move(LumieraConfigitem self, LumieraConfigitem dest)
Definition configitem.c:135
LumieraConfigitem lumiera_configitem_new(const char *line)
Definition configitem.c:96
void lumiera_configitem_delete(LumieraConfigitem self, LumieraConfigLookup lookup)
Definition configitem.c:114
LumieraConfigitem lumiera_configitem_parse(LumieraConfigitem self, const char *line)
Definition configitem.c:165
LumieraConfigitem parent
Definition configitem.h:72
LumieraConfigitem lumiera_configitem_destroy(LumieraConfigitem self, LumieraConfigLookup lookup)
Definition configitem.c:70
struct lumiera_configitem_vtable * vtable
Definition configitem.h:81
LumieraConfigitem lumiera_configitem_init(LumieraConfigitem self)
Definition configitem.c:47
Intrusive cyclic double linked list There is only one node type which contains a forward and a backwa...
LumieraConfigitem(* destroy)(LumieraConfigitem)
Definition configitem.h:66
LumieraConfigitem(* newitem)(LumieraConfigitem)
Definition configitem.h:65