Lumiera  0.pre.03
»edit your freedom«
config-typed.c File Reference

Go to the source code of this file.

Description

Implementation draft for a configuration system (2008).

This file implements high level typed configuration interfaces.

Note
unfinished draft from 2008
Todo:
as of 2016 this code is unused and likely to be replaced by a different approach.

Definition in file config-typed.c.

#include "include/logging.h"
#include "lib/tmpbuf.h"
#include "common/config.h"
#include <stdint.h>

Functions

const char * lumiera_config_bool_get (const char *key, int *value)
 Bool Bool in various formats, (0,1(!1), yes/no, true/false, on/off, set/clear)
 
LumieraConfigitem lumiera_config_bool_set (const char *key, int *value)
 
const char * lumiera_config_link_get (const char *key, const char **value)
 
LumieraConfigitem lumiera_config_link_set (const char *key, const char **value)
 
const char * lumiera_config_number_get (const char *key, long long *value)
 Number signed integer numbers, in different formats (decimal, hex, oct, binary(for masks))
 
LumieraConfigitem lumiera_config_number_set (const char *key, long long *value)
 
const char * lumiera_config_real_get (const char *key, long double *value)
 Real floating point number in standard formats (see printf/scanf)
 
LumieraConfigitem lumiera_config_real_set (const char *key, long double *value)
 
const char * lumiera_config_string_get (const char *key, const char **value)
 
LumieraConfigitem lumiera_config_string_set (const char *key, const char **value)
 
const char * lumiera_config_word_get (const char *key, const char **value)
 
LumieraConfigitem lumiera_config_word_set (const char *key, const char **value)
 
const char * lumiera_config_wordlist_get (const char *key, const char **value)
 Wordlist words delimited by any of " \t,;".
 
LumieraConfigitem lumiera_config_wordlist_set (const char *key, const char **value)
 
static char * scan_string (const char *in)
 String unquoted string which covers the whole value area and gets chopped or quoted string which preserves leading/trailing spaces either single or double quotes are allowed, doubling the quote in a string escapes it. More...
 
static char * scan_word (const char *in)
 helper function, takes a raw input string and give a tmpbuf with the word parsed back. More...
 

Variables

LumieraConfig lumiera_global_config
 

Function Documentation

◆ scan_string()

static char* scan_string ( const char *  in)
static

String unquoted string which covers the whole value area and gets chopped or quoted string which preserves leading/trailing spaces either single or double quotes are allowed, doubling the quote in a string escapes it.

helper function, takes a raw input string and give a tmpbuf with the string parsed back.

Definition at line 140 of file config-typed.c.

◆ scan_word()

static char* scan_word ( const char *  in)
static

helper function, takes a raw input string and give a tmpbuf with the word parsed back.

Remarks
'Word' is a single word, no quotes, chopped

Definition at line 284 of file config-typed.c.

References lumiera_tmpbuf_strndup().

+ Here is the call graph for this function: