Lumiera  0.pre.03
»edityourfreedom«
configitem.c File Reference

Go to the source code of this file.

Description

Implementation draft for a configuration system (2008).

Create a configitem from a single line of the config file.

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

Definition in file configitem.c.

#include "include/logging.h"
#include "lib/llist.h"
#include "lib/safeclib.h"
#include "lib/tmpbuf.h"
#include "common/config.h"
#include "common/configitem.h"
#include "common/configentry.h"
#include <ctype.h>
#include <stdint.h>

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 source)
 
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)
 
static LumieraConfigitem parse_configentry (LumieraConfigitem self, char *itr)
 
static LumieraConfigitem parse_directive (LumieraConfigitem self, char *itr)
 
static LumieraConfigitem parse_section (LumieraConfigitem self, char *itr)
 

Function Documentation

◆ parse_directive()

static LumieraConfigitem parse_directive ( LumieraConfigitem  self,
char *  itr 
)
static

Definition at line 215 of file configitem.c.

References LUMIERA_CONFIG_KEY_CHARS, LUMIERA_ERROR_SET, and NULL.

Referenced by lumiera_configitem_parse().

+ Here is the caller graph for this function:

◆ parse_section()

static LumieraConfigitem parse_section ( LumieraConfigitem  self,
char *  itr 
)
static

Definition at line 274 of file configitem.c.

References LUMIERA_CONFIG_KEY_CHARS, LUMIERA_ERROR_SET, and NULL.

Referenced by lumiera_configitem_parse().

+ Here is the caller graph for this function:

◆ parse_configentry()

static LumieraConfigitem parse_configentry ( LumieraConfigitem  self,
char *  itr 
)
static

Definition at line 344 of file configitem.c.

References LUMIERA_CONFIG_KEY_CHARS, lumiera_configentry_funcs, LUMIERA_ERROR_SET, and NULL.

Referenced by lumiera_configitem_parse().

+ Here is the caller graph for this function:

◆ lumiera_configitem_init()

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:

◆ lumiera_configitem_destroy()

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:

◆ lumiera_configitem_new()

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:

◆ lumiera_configitem_delete()

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:

◆ lumiera_configitem_set_value()

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:

◆ lumiera_configitem_move()

LumieraConfigitem lumiera_configitem_move ( LumieraConfigitem  self,
LumieraConfigitem  source 
)

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:

◆ lumiera_configitem_parse()

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: