core/config

configuration file support library

Dependency Graph

core/config: Library Dependencies

View the full-size SVG (svg) or PDF (pdf) image or graphviz source (dot)

View color source code (raw) for this file

View reStructuredText (rst) source code for this page

Library Initialization

core_config_lib_init()

Other libs use config_init, so use lib_init.

$config_load_late

Set to true by config_load(), signaling that all future configuration files must be loaded immediately (rather than being deferred). Internal use only.

Default: false

$config_types[]

List of valid types of configuration files

Default: sys user pkg

$sys_configs[]

Lists the system configurations to load.

Default: ${script_name}.conf ${script_name}.local

$user_configs[]

Lists the user configurations to load.

Default: ${script_name}.conf

$pkg_configs[]

Lists the package configurations to load.

Default: none

$config_debug

If set to true true, permits errors in the configuration to allow debugging.

Default: false

$config_init_check

Set to true to in order to perform early checking of configuration settings, after initialization but prior to loading any configuration files.

Default: false

Library Configuration

Configuration Files

config_filename()

Prints system configuration filename (located in $confdir)

config_user_filename()

Prints user configuration filename (located in $user_confdir)

config_pkg_filename()

Prints package configuration filename (located in $srcdir)

config_files_add()

Inserts or appends ($2) configuration files "$@" to the named configuration file list ($1).

The remaining functions in this section encapsulate all valid permutations of the first two arguments and should be used in preference to direct calls to this function.

$1 - Configuration file type

$2 - List function: insert or append

$@ - Configuration file names

config_sys_files_insert()

Inserts system configuration files ($@) to start of system configuration file list.

config_sys_files_append()

Appends system configuration files ($@) to end of system configuration file list.

config_user_files_insert()

Inserts user configuration files ($@) to start of user configuration file list.

config_user_files_append()

Appends user configuration files ($@) to end of user configuration file list.

config_pkg_files_insert()

Inserts package configuration files ($@) to start of package configuration file list.

config_pkg_files_append()

Appends package configuration files ($@) to end of package configuration file list.

Public Functions

config_error()

Generates a warning or error, depending on whether $config_debug is true or false respectively.

Configuration Initialization

config_init()

Initializes all library and tool settings, prior to loading any configuration files.

TODO: fix config_check callbacks to permit checking here

config_init_lib()

Initializes configuration settings for the named library ($1).

Configuration Validation

config_check()

Ensures all configuration settings are valid

config_check_lib()

Ensures configuration settings are valid for the name library ($1).

Configuration File Reading

config_read()

Reads a single configuration file ($1)

$1 - filename

config_read_files()

Reads a list of configuration files ($@)

Configuration File Loading

config_load()

Reads all known configuration files by calling config_load_kind() for each type of configuration file. Sets $config_load_late to ensure all future configuration files are loaded immediately by config_files_add().

config_load_kind()

Reads configuration files of the given type ($1). See $config_types[] for available types.

Config CLI

config_usage()

Prints usage for the config command namespace.

config_files()

Prints the named list ($1) of configuration files.

$1 - Type of configuration files: all, sys, user, or pkg.

config_files_all()

Prints a list of all configuration files.

config_names()

Prints list of active configuration settings.

config_values()

Prints list of configuration settings name/value pairs for the given list of setting names ($@).

config_show()

Prints active configuration settings for a given library ($1) or all active scripts (if none given).

$1 - Library name (optional). If null, prints all script settings.


View the Developer Guide Index

View the Reference Manual Index


Generated on Wed Jun 28 07:41:04 PDT 2017 by mcsh d14 v0.20.0.