Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
confmap.c File Reference

(/usr/bin/git 2025-03-27, commit: 9ebccc0)

Implementation file related to mapping configuration options and their string representations. More...

#include "confmap.h"
#include <stdlib.h>
#include "common.h"
#include "logio.h"
Include dependency graph for confmap.c:

Functions

static int crinitCompareConfigMappings (const void *a, const void *b)
 
const crinitConfigMapping_tcrinitFindConfigMapping (const crinitConfigMapping_t *map, size_t mapSize, const char *keyStr)
 

Variables

const crinitConfigMapping_t crinitTaskCfgMap []
 
const size_t crinitTaskCfgMapSize = crinitNumElements(crinitTaskCfgMap)
 
const crinitConfigMapping_t crinitSeriesCfgMap []
 
const size_t crinitSeriesCfgMapSize = crinitNumElements(crinitSeriesCfgMap)
 
const crinitConfigMapping_t crinitKCmdlineCfgMap []
 
const size_t crinitKCmdlineCfgMapSize = crinitNumElements(crinitKCmdlineCfgMap)
 

Detailed Description

Implementation file related to mapping configuration options and their string representations.

Function Documentation

◆ crinitCompareConfigMappings()

static int crinitCompareConfigMappings ( const void *  a,
const void *  b 
)
static

Comparison function between two crinitConfigMapping_t, for bsearch()

◆ crinitFindConfigMapping()

const crinitConfigMapping_t * crinitFindConfigMapping ( const crinitConfigMapping_t map,
size_t  mapSize,
const char *  keyStr 
)

Searches for an entry in an array of crinitConfigMapping_t by crinitConfigMapping_t::configKey.

Uses bsearch() with the assumption that the array is lexicographically ordered by crinitConfigMapping_t::configKey.

Parameters
mapThe array of crinitConfigMapping_t to search in.
mapSizeThe number of elements in the array to search.
keyStrThe name of the mapping to search for.

Variable Documentation

◆ crinitKCmdlineCfgMap

const crinitConfigMapping_t crinitKCmdlineCfgMap[]
Initial value:
= {
}
int crinitCfgSigKeyDirHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:906
int crinitCfgSignaturesHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:918
#define CRINIT_CONFIG_KEYSTR_SIGKEYDIR
Definition confparse.h:46
@ CRINIT_CONFIG_SIGNATURES
Definition confparse.h:137
@ CRINIT_CONFIG_SIGKEYDIR
Definition confparse.h:136
#define CRINIT_CONFIG_KEYSTR_SIGNATURES
Definition confparse.h:48

Constant (at compile-time) array of mappings between Kernel cmdline configuration names and their indices and properties.

Must be lexicographically ordered (by crinitConfigMapping_t::configKey), so that crinitFindConfigMapping() works. This is tested by a unit/regression test.

◆ crinitKCmdlineCfgMapSize

const size_t crinitKCmdlineCfgMapSize = crinitNumElements(crinitKCmdlineCfgMap)

Size of crinitKCmdlineCfgMap, known at compile-time.

◆ crinitSeriesCfgMap

const crinitConfigMapping_t crinitSeriesCfgMap[]
Initial value:
= {
int crinitCfgFilterHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:325
int crinitCfgTasksHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:710
int crinitCfgDebugHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:580
int crinitCfgTaskDirHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:669
int crinitCfgTaskSuffixHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:651
int crinitCfgEnvHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:294
int crinitCfgElosPortHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:845
int crinitCfgShdGpHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:634
int crinitCfgInclSuffixHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:598
int crinitCfgLauncherCmdHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:886
int crinitCfgElosServerHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:827
int crinitCfgElosEventPollIntervalHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:868
int crinitCfgInclDirHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:614
int crinitCfgTaskDirSlHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:691
int crinitCfgSyslogHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:784
int crinitCfgElosHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:801
#define CRINIT_CONFIG_KEYSTR_USE_SYSLOG
Definition confparse.h:29
#define CRINIT_CONFIG_KEYSTR_INCLDIR
Definition confparse.h:25
#define CRINIT_CONFIG_KEYSTR_TASKS
Definition confparse.h:15
#define CRINIT_CONFIG_KEYSTR_ELOS_SERVER
Definition confparse.h:33
#define CRINIT_CONFIG_KEYSTR_ELOS_PORT
Definition confparse.h:35
#define CRINIT_CONFIG_KEYSTR_TASKDIR
Definition confparse.h:23
#define CRINIT_CONFIG_KEYSTR_SHDGRACEP
Definition confparse.h:27
#define CRINIT_CONFIG_KEYSTR_INCL_SUFFIX
Definition confparse.h:41
#define CRINIT_CONFIG_KEYSTR_TASK_FILE_SUFFIX
Definition confparse.h:43
@ CRINIT_CONFIG_DEBUG
Definition confparse.h:119
@ CRINIT_CONFIG_ELOS_EVENT_POLL_INTERVAL
Definition confparse.h:121
@ CRINIT_CONFIG_TASKS
Definition confparse.h:142
@ CRINIT_CONFIG_USE_ELOS
Definition confparse.h:144
@ CRINIT_CONFIG_TASKDIR_FOLLOW_SYMLINKS
Definition confparse.h:141
@ CRINIT_CONFIG_FILTER_DEFINE
Definition confparse.h:125
@ CRINIT_CONFIG_TASKDIR
Definition confparse.h:140
@ CRINIT_CONFIG_ELOS_SERVER
Definition confparse.h:123
@ CRINIT_CONFIG_USE_SYSLOG
Definition confparse.h:143
@ CRINIT_CONFIG_LAUNCHER_CMD
Definition confparse.h:146
@ CRINIT_CONFIG_ELOS_PORT
Definition confparse.h:122
@ CRINIT_CONFIG_INCLUDE_SUFFIX
Definition confparse.h:128
@ CRINIT_CONFIG_INCLUDEDIR
Definition confparse.h:129
@ CRINIT_CONFIG_TASK_FILE_SUFFIX
Definition confparse.h:139
@ CRINIT_CONFIG_SHDGRACEP
Definition confparse.h:135
@ CRINIT_CONFIG_ENV_SET
Definition confparse.h:124
#define CRINIT_CONFIG_KEYSTR_LAUNCHER_CMD
Definition confparse.h:39
#define CRINIT_CONFIG_KEYSTR_ELOS_EVENT_POLL_INTERVAL
Definition confparse.h:37
#define CRINIT_CONFIG_KEYSTR_TASKDIR_SYMLINKS
Definition confparse.h:19
#define CRINIT_CONFIG_KEYSTR_ENV_SET
Definition confparse.h:55
#define CRINIT_CONFIG_KEYSTR_DEBUG
Definition confparse.h:21
#define CRINIT_CONFIG_KEYSTR_FILTER_DEFINE
Definition confparse.h:57
#define CRINIT_CONFIG_KEYSTR_USE_ELOS
Definition confparse.h:31

Constant (at compile-time) array of mappings between series/global configuration names and their indices and properties.

Must be lexicographically ordered (by crinitConfigMapping_t::configKey), so that crinitFindConfigMapping() works. This is tested by a unit/regression test.

◆ crinitSeriesCfgMapSize

const size_t crinitSeriesCfgMapSize = crinitNumElements(crinitSeriesCfgMap)

Size of crinitSeriesCfgMap, known at compile-time.

◆ crinitTaskCfgMap

const crinitConfigMapping_t crinitTaskCfgMap[]
Initial value:
= {
int crinitCfgRespHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:401
int crinitCfgNameHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:389
int crinitCfgUserHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:452
int crinitCfgGroupHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:491
int crinitCfgDepHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:167
int crinitCfgStopCmdHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:144
int crinitCfgIoRedirHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:365
int crinitCfgRespRetHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:412
int crinitTaskIncludeHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:423
int crinitCfgPrvHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:227
int crinitCfgCmdHandler(void *tgt, const char *val, crinitConfigType_t type)
Definition confhdl.c:122
#define CRINIT_CONFIG_KEYSTR_COMMAND
Definition confparse.h:51
#define CRINIT_CONFIG_KEYSTR_NAME
Definition confparse.h:63
#define CRINIT_CONFIG_KEYSTR_IOREDIR
Definition confparse.h:61
@ CRINIT_CONFIG_INCLUDE
Definition confparse.h:127
@ CRINIT_CONFIG_USER
Definition confparse.h:145
@ CRINIT_CONFIG_COMMAND
Definition confparse.h:118
@ CRINIT_CONFIG_NAME
Definition confparse.h:131
@ CRINIT_CONFIG_RESPAWN
Definition confparse.h:133
@ CRINIT_CONFIG_PROVIDES
Definition confparse.h:132
@ CRINIT_CONFIG_DEPENDS
Definition confparse.h:120
@ CRINIT_CONFIG_RESPAWN_RETRIES
Definition confparse.h:134
@ CRINIT_CONFIG_GROUP
Definition confparse.h:126
@ CRINIT_CONFIG_STOP_COMMAND
Definition confparse.h:138
@ CRINIT_CONFIG_IOREDIR
Definition confparse.h:130
#define CRINIT_CONFIG_KEYSTR_GROUP
Definition confparse.h:75
#define CRINIT_CONFIG_KEYSTR_INCLUDE
Definition confparse.h:59
#define CRINIT_CONFIG_KEYSTR_STOP_COMMAND
Definition confparse.h:71
#define CRINIT_CONFIG_KEYSTR_DEPENDS
Definition confparse.h:53
#define CRINIT_CONFIG_KEYSTR_RESPAWN
Definition confparse.h:67
#define CRINIT_CONFIG_KEYSTR_PROVIDES
Definition confparse.h:65
#define CRINIT_CONFIG_KEYSTR_USER
Definition confparse.h:73
#define CRINIT_CONFIG_KEYSTR_RESPAWN_RETRIES
Definition confparse.h:69

Constant (at compile-time) array of mappings between task-specific configuration names and their indices and properties.

Must be lexicographically ordered (by crinitConfigMapping_t::configKey), so that crinitFindConfigMapping() works. This is tested by a unit/regression test.

◆ crinitTaskCfgMapSize

const size_t crinitTaskCfgMapSize = crinitNumElements(crinitTaskCfgMap)

Size of crinitTaskCfgMap, known at compile-time.