Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
configitem.h File Reference

Go to the source code of this file.

Description

Draft for a configuration system (2008).

Todo:
as of 2016 this code is unused and likely to be replaced by a different approach.

Hierarchy of configuration items.

configitems form a 3 level hierarchy:

** 1. file:
**      contain sections
**
** 2.   section:
**        [prefix suffix]
**        contain lines
**
** 3.     lines are
**        comment:
**          empty line or line only containing spaces and tabs
**          line starting with spaces and tabs followed by a #
**        directive:
**          '@include name' or '@readonly'
**          directives are only valid at the toplevel section []
**        configurationentry:
**          'key = value' or 'key < redirect'
**        erroneous:
**          any line which can't be parsed
** 

Definition in file configitem.h.

#include "lib/llist.h"
#include "common/config-lookup.h"
#include <nobug.h>

Classes

struct  lumiera_configitem
 
struct  lumiera_configitem_vtable
 

Typedefs

typedef lumiera_configitem * LumieraConfigitem
 

Functions

void lumiera_configitem_delete (LumieraConfigitem self, LumieraConfigLookup lookup)
 
LumieraConfigitem lumiera_configitem_destroy (LumieraConfigitem self, LumieraConfigLookup lookup)
 
LumieraConfigitem lumiera_configitem_init (LumieraConfigitem self)
 
LumieraConfigitem lumiera_configitem_move (LumieraConfigitem self, LumieraConfigitem dest)
 
LumieraConfigitem lumiera_configitem_new (const char *line)
 
LumieraConfigitem lumiera_configitem_parse (LumieraConfigitem self, const char *line)
 
LumieraConfigitem lumiera_configitem_set_value (LumieraConfigitem self, const char *delim_value)
 

Typedef Documentation

typedef lumiera_configitem* LumieraConfigitem

Definition at line 62 of file configitem.h.


Class Documentation

struct lumiera_configitem_struct
Class Members
llist link
LumieraConfigitem parent
llist children
llist lookup
char * line
char * key
size_t key_size
char * delim
struct lumiera_configitem_vtable * vtable
+ Collaboration diagram for lumiera_configitem:

Function Documentation

LumieraConfigitem lumiera_configitem_init ( LumieraConfigitem  self)

Definition at line 56 of file configitem.c.

References NULL, and TRACE().

Referenced by lumiera_config_init(), and lumiera_configitem_new().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraConfigitem lumiera_configitem_destroy ( LumieraConfigitem  self,
LumieraConfigLookup  lookup 
)

Definition at line 79 of file configitem.c.

References ENSURE(), LLIST_WHILE_HEAD, lumiera_config_lookup_remove(), lumiera_configitem_delete(), lumiera_free(), and TRACE().

Referenced by lumiera_config_destroy(), and lumiera_configitem_delete().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraConfigitem lumiera_configitem_new ( const char *  line)

Definition at line 105 of file configitem.c.

References lumiera_configitem_init(), lumiera_configitem_move(), lumiera_configitem_parse(), lumiera_malloc(), and TRACE().

Referenced by lumiera_config_set(), lumiera_config_setdefault(), and TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lumiera_configitem_delete ( LumieraConfigitem  self,
LumieraConfigLookup  lookup 
)

Definition at line 123 of file configitem.c.

References lumiera_configitem_destroy(), lumiera_free(), and TRACE().

Referenced by lumiera_configitem_destroy(), and TEST().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraConfigitem lumiera_configitem_set_value ( LumieraConfigitem  self,
const char *  delim_value 
)

Definition at line 131 of file configitem.c.

References lumiera_configitem_parse(), and lumiera_tmpbuf_snprintf().

Referenced by lumiera_config_set().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraConfigitem lumiera_configitem_parse ( LumieraConfigitem  self,
const char *  line 
)

Definition at line 174 of file configitem.c.

References lumiera_free(), lumiera_strndup(), parse_configentry(), parse_directive(), parse_section(), and TRACE().

Referenced by lumiera_configitem_new(), and lumiera_configitem_set_value().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraConfigitem lumiera_configitem_move ( LumieraConfigitem  self,
LumieraConfigitem  dest 
)

Definition at line 144 of file configitem.c.

References NULL, and TRACE().

Referenced by lumiera_configentry_new(), and lumiera_configitem_new().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: