Crinit -- Configurable Rootfs Init
confhdl.h File Reference

(2023-08-28, commit: c9b21e6)

Header defining type- and target-specific handler functions for configuration parsing. More...

#include "task.h"
Include dependency graph for confhdl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* crinitConfigHandler_t) (void *tgt, const char *val, crinitConfigType_t type)
 

Functions

int crinitCfgCmdHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgDepHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgIoRedirHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgNameHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgPrvHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgRespHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgRespRetHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitTaskIncludeHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgDebugHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgInclSuffixHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgInclDirHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgShdGpHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgTaskSuffixHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgTaskDirHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgTaskDirSlHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgTasksHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgSyslogHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgElosHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgElosServerHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgElosPortHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgEnvHandler (void *tgt, const char *val, crinitConfigType_t type)
 
int crinitCfgFilterHandler (void *tgt, const char *val, crinitConfigType_t type)
 

Detailed Description

Header defining type- and target-specific handler functions for configuration parsing.

Typedef Documentation

◆ crinitConfigHandler_t

typedef int(* crinitConfigHandler_t) (void *tgt, const char *val, crinitConfigType_t type)

Function pointer type definition for configuration directive handlers.

Each configuration directive has its own handler function implementation, mapped by crinit{Task,Series}CfgMap. It will use the appropriate parsing/conversion functions (see confconv.h) to extract desired settings and then write them to the target or the global option storage.

Parameters
tgtThe target to write to. In case of a task-specific option, this is a pointer to the relevant crinitTask_t. For the TASKS global option it is a pointer to an array of strings. For TASKDIR and TASK_SUFFIX, it is a pointer to a string. For TASKDIR_FOLLOW_SYMLINKS, it is a pointer to a bool. For all other series file option, it should be NULL.
valThe new setting to parse.
typecrinitConfigType_t indicating if we are parsing a task or a series file.
Returns
0 on success, -1 on error

Function Documentation

◆ crinitCfgCmdHandler()

int crinitCfgCmdHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for COMMAND config directives. See crinitConfigHandler_t.

◆ crinitCfgDebugHandler()

int crinitCfgDebugHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for DEBUG config directives. See crinitConfigHandler_t.

◆ crinitCfgDepHandler()

int crinitCfgDepHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for DEPENDS config directives. See crinitConfigHandler_t.

◆ crinitCfgElosHandler()

int crinitCfgElosHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for USE_ELOS config directives. See crinitConfigHandler_t.

◆ crinitCfgElosPortHandler()

int crinitCfgElosPortHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for ELOS_PORT config directives. See crinitConfigHandler_t.

◆ crinitCfgElosServerHandler()

int crinitCfgElosServerHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for ELOS_SERVER config directives. See crinitConfigHandler_t.

◆ crinitCfgEnvHandler()

int crinitCfgEnvHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for ENV_SET config directives. See crinitConfigHandler_t.

◆ crinitCfgFilterHandler()

int crinitCfgFilterHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for FILTER_DEFINE config directives. See crinitConfigHandler_t.

◆ crinitCfgInclDirHandler()

int crinitCfgInclDirHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for INCLUDEDIR config directives. See crinitConfigHandler_t.

◆ crinitCfgInclSuffixHandler()

int crinitCfgInclSuffixHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for INCLUDE_SUFFIX config directives. See crinitConfigHandler_t.

◆ crinitCfgIoRedirHandler()

int crinitCfgIoRedirHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for IO_REDIRECT config directives. See crinitConfigHandler_t.

◆ crinitCfgNameHandler()

int crinitCfgNameHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for NAME config directives. See crinitConfigHandler_t.

◆ crinitCfgPrvHandler()

int crinitCfgPrvHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for PROVIDES config directives. See crinitConfigHandler_t.

◆ crinitCfgRespHandler()

int crinitCfgRespHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for RESPAWN config directives. See crinitConfigHandler_t.

◆ crinitCfgRespRetHandler()

int crinitCfgRespRetHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for RESPAWN_RETRIES config directives. See crinitConfigHandler_t.

◆ crinitCfgShdGpHandler()

int crinitCfgShdGpHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for SHUTDOWN_GRACE_PERIOD_US config directives. See crinitConfigHandler_t.

◆ crinitCfgSyslogHandler()

int crinitCfgSyslogHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for USE_SYSLOG config directives. See crinitConfigHandler_t.

◆ crinitCfgTaskDirHandler()

int crinitCfgTaskDirHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for TASKDIR config directives. See crinitConfigHandler_t.

◆ crinitCfgTaskDirSlHandler()

int crinitCfgTaskDirSlHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for TASKDIR_FOLLOW_SYMLINKS config directives. See crinitConfigHandler_t.

◆ crinitCfgTasksHandler()

int crinitCfgTasksHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for TASKS config directives. See crinitConfigHandler_t.

◆ crinitCfgTaskSuffixHandler()

int crinitCfgTaskSuffixHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for TASK_SUFFIX config directives. See crinitConfigHandler_t.

◆ crinitTaskIncludeHandler()

int crinitTaskIncludeHandler ( void *  tgt,
const char *  val,
crinitConfigType_t  type 
)

Handler for INCLUDE config directives. See crinitConfigHandler_t.