CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions | Variables
si-common.c File Reference

Some shared functions used by some of the components here. More...

Functions

void runtime_configuration_base_read_in (struct caps_inif_table *runtime_config)
 
void runtime_configuration_class_merge_in (struct caps_inif_table *runtime_config, enum caps_user_class clss)
 
static void runtime_configuration_package_merge_in (struct caps_inif_table *runtime_config, const char *package)
 
void runtime_configuration_apply_verbosity (const struct caps_inif_table *runtime_config)
 
void runtime_configuration_apply (struct caps_inif_table *runtime_config, enum caps_user_class clss, const char *package)
 

Variables

static const char * layer []
 

Detailed Description

Author
Jürgen Borleis

Collection of function shared by some of the components in this package

Todo:
This is a copy of a file from the caps-printing-coordinator. Find a better solution

Function Documentation

◆ runtime_configuration_base_read_in()

void runtime_configuration_base_read_in ( struct caps_inif_table runtime_config)

Read-in the CAPS universe shared 'caps.ini' file for basic run-time configuration

Parameters
[out]runtime_configThe configuration table to fill

Expects the file in CAPS Configuration Directory (e.g. '/etc/caps/caps.ini' for example)

Precondition
The runtime_config must already be initialized but empty!

◆ runtime_configuration_class_merge_in()

void runtime_configuration_class_merge_in ( struct caps_inif_table runtime_config,
enum caps_user_class  clss 
)

Merge-in the shared service dependend INI file for basic run-time configuration

Parameters
[out]runtime_configThe configuration table to merge more content to
[in]clssThe class of the running program (used to identify the corresponding service dependend INI file)

For clss refer layer for the corresponding service INI file.

Precondition
The runtime_config must already be initialized
Todo:

Currently the already collected configuration gets removed if it fails to merge the class INI content

The error message needs more details: Why/What/What now?

◆ runtime_configuration_package_merge_in()

static void runtime_configuration_package_merge_in ( struct caps_inif_table runtime_config,
const char *  package 
)
static

Merge-in the package related INI file (if it exits)

Parameters
[out]runtime_config
[in]packagename of the corresponding INI file (including the trailing '.ini')

The INI file is expected in the main configuration directory (e.g. '/etc/caps' for example)

Precondition
The runtime_config must already be initialized
Todo:

Currently the already collected configuration gets removed if it fails to merge the package's INI content

The error message needs more details: Why/What/What now?

◆ runtime_configuration_apply_verbosity()

void runtime_configuration_apply_verbosity ( const struct caps_inif_table runtime_config)

Apply the verbosity setting if available

Parameters
[out]runtime_configThe configuration to check for the verbosity setting

This function is intended to be used whenever a run-time config is available. It is intended to apply the requested setting as early as possible.

The verbosity setting is always expected at

The new value from the INI file is only applied if it is higher than before. Else it gets ignored to give the application a change to overwrite it locally.

◆ runtime_configuration_apply()

void runtime_configuration_apply ( struct caps_inif_table runtime_config,
enum caps_user_class  clss,
const char *  package 
)

Read in a fixed sequence of INI files as a base run-time configuration

Parameters
[out]runtime_config
[in]clssApplication class (refer enum caps_user_class)
[in]packageUsed for the program's INI file (can be NULL)

This function is intended for the printing coordinator internal tools and printing providers via libcapsprovider (not clients).

Precondition
The runtime_config must already be initialized
Note
Feature is documented in CAPS universe verbosity setup via INI File

Variable Documentation

◆ layer

const char* layer[]
static
Initial value:
= {
[CAPS_CLSS_COORDINATOR] = "capsmanagement.ini",
[CAPS_CLSS_SERVICE] = "capsservice.ini",
[CAPS_CLSS_DRIVER] = "capsdriver.ini",
}
@ CAPS_CLSS_COORDINATOR
Definition: libcapsppcommon.h:338
@ CAPS_CLSS_DRIVER
Definition: libcapsppcommon.h:340
@ CAPS_CLSS_SERVICE
Definition: libcapsppcommon.h:339

Special shared service dependend INI files (service = class), used to overlay the shared 'caps.ini' (runtime_configuration_base_read_in()).

Note
The paths where these INI files are expected depend on the compile-time configuration of the libcapsbase component (Setup the CAPS Configuration Directory)
Todo:
Add docs for the caps_user_class symbols and the corresponding INI file, link it to enum caps_user_class documentation and vice versa.
Todo:
CAPS_CLSS_COORDINATOR and CAPS_CLSS_SERVICE aren't used here!'