Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
configitem.h File Reference

Draft for a configuration system (2008). More...

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>

Typedefs

typedef lumiera_configitem * LumieraConfigitem
 

Classes

struct  lumiera_configitem_vtable
 
struct  lumiera_configitem
 

Functions

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

Typedef Documentation

◆ LumieraConfigitem

typedef lumiera_configitem* LumieraConfigitem

Definition at line 53 of file configitem.h.


Class Documentation

◆ lumiera_configitem_struct

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

◆ lumiera_configitem_init()

LumieraConfigitem lumiera_configitem_init ( LumieraConfigitem  self)

Definition at line 47 of file configitem.c.

References NULL.

Referenced by lumiera_config_init(), and lumiera_configitem_new().

+ Here is the caller graph for this function:

◆ lumiera_configitem_destroy()

LumieraConfigitem lumiera_configitem_destroy ( LumieraConfigitem  self,
LumieraConfigLookup  lookup 
)

Definition at line 70 of file configitem.c.

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

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:

◆ lumiera_configitem_new()

LumieraConfigitem lumiera_configitem_new ( const char *  line)

Definition at line 96 of file configitem.c.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_configitem_delete()

void lumiera_configitem_delete ( LumieraConfigitem  self,
LumieraConfigLookup  lookup 
)

Definition at line 114 of file configitem.c.

References lumiera_configitem_destroy(), and lumiera_free().

Referenced by lumiera_configitem_destroy(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_configitem_set_value()

LumieraConfigitem lumiera_configitem_set_value ( LumieraConfigitem  self,
const char *  delim_value 
)

Definition at line 122 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:

◆ lumiera_configitem_parse()

LumieraConfigitem lumiera_configitem_parse ( LumieraConfigitem  self,
const char *  line 
)

Definition at line 165 of file configitem.c.

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

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:

◆ lumiera_configitem_move()

LumieraConfigitem lumiera_configitem_move ( LumieraConfigitem  self,
LumieraConfigitem  dest 
)

Definition at line 135 of file configitem.c.

References NULL.

Referenced by lumiera_configentry_new(), and lumiera_configitem_new().

+ Here is the caller graph for this function: