CAPS Universe documentation  1.0.4
All you need to know to be successful
Macros | Functions
caps-si-local.h File Reference

Some declarations used internally only. More...

Go to the source code of this file.

Macros

#define DSO_VISIBLE
 
#define ARRAY_SIZE(x)   (sizeof(x)/sizeof(x[0]))
 
#define caps_invalidate_pointer(pointer)
 
#define caps_print_debug(fmt, ...)
 
#define _(string)   (string)
 
#define NLS_(string)   (string)
 
#define CAPS_DRIVER_INI_NAME   "driver-ini"
 
#define CAPS_DRIVER_INI_NAME_SHORT   'f'
 
#define CAPS_PARAM_DIRECTORY_NAME   "parameter-dir"
 
#define CAPS_PARAM_DIRECTORY_NAME_SHORT   'd'
 
#define CAPS_RUNTIME_CONFIG_LEVEL   "base"
 
#define RETVAL_BAD   1
 
#define RETVAL_FAIL   1
 
#define RETVAL_OK   0
 

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)
 
void runtime_configuration_apply (struct caps_inif_table *runtime_config, enum caps_user_class clss, const char *package)
 
void runtime_configuration_apply_verbosity (const struct caps_inif_table *runtime_config)
 

Detailed Description

Author
Jürgen Borleis
Warning
Use as experimental

Macro Definition Documentation

◆ DSO_VISIBLE

#define DSO_VISIBLE

@ ingroup FIXME @ defgroup coordinator_only_api Internally used API

This API is used inside the Printing Coordinator only. @ {

◆ ARRAY_SIZE

#define ARRAY_SIZE (   x)    (sizeof(x)/sizeof(x[0]))

◆ caps_invalidate_pointer

#define caps_invalidate_pointer (   pointer)

◆ caps_print_debug

#define caps_print_debug (   fmt,
  ... 
)

◆ _

#define _ (   string)    (string)

◆ NLS_

#define NLS_ (   string)    (string)

◆ CAPS_DRIVER_INI_NAME

#define CAPS_DRIVER_INI_NAME   "driver-ini"

This is the long command line parameter handled by libcapsprovider in caps_pp_instance_runtime_prepare().
This parameter defines the name of the driver's INI file at run-time, expected in the CAPS Printer Driver Database Directory directory (usually /usr/share/caps/drivers).

Note
This is a copy from the caps-printing-coordinator package and must be kept in sync

◆ CAPS_DRIVER_INI_NAME_SHORT

#define CAPS_DRIVER_INI_NAME_SHORT   'f'

Same usage than CAPS_DRIVER_INI_NAME, but the short form

Note
This is a copy from the caps-printing-coordinator package and must be kept in sync

◆ CAPS_PARAM_DIRECTORY_NAME

#define CAPS_PARAM_DIRECTORY_NAME   "parameter-dir"

This is the long command line parameter handled by libcapsprovider in caps_pp_instance_runtime_prepare().
This parameter defines the name of the device's parameter directory, expected in the CAPS Printer Device Database Directory directory (usually /var/lib/caps).

Note
This is a copy from the caps-printing-coordinator package and must be kept in sync

◆ CAPS_PARAM_DIRECTORY_NAME_SHORT

#define CAPS_PARAM_DIRECTORY_NAME_SHORT   'd'

Same usage than CAPS_PARAM_DIRECTORY_NAME, but the short form

Note
This is a copy from the caps-printing-coordinator package and must be kept in sync

◆ CAPS_RUNTIME_CONFIG_LEVEL

#define CAPS_RUNTIME_CONFIG_LEVEL   "base"

Define the INI file 'level', all run-time related settings should be at

This value is important to have all read and merged settings at the expected 'level' to make retrieving these settings successful.

◆ RETVAL_BAD

#define RETVAL_BAD   1

◆ RETVAL_FAIL

#define RETVAL_FAIL   1

◆ RETVAL_OK

#define RETVAL_OK   0

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 and empty!
Note
Behaviour is documented in INI file set used by printer drivers

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?

Note
Behaviour is documented in INI file set used by printer drivers

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_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

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

◆ 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.