CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Configuration related helper functions. More...
Functions | |
const char * | caps_drv_setup_value_get (struct caps_drv *cdrv, const char *section, const char *key) |
int | caps_drv_setup_boolean_get (struct caps_drv *cdrv, const char *section, const char *key) |
Various INI files configure the behaviour of the framework and the specific printer driver. The functions in this section can be used from within the printer driver to retrieve these settings.
They can be used after a call to caps_drv_run()
const char * caps_drv_setup_value_get | ( | struct caps_drv * | cdrv, |
const char * | section, | ||
const char * | key | ||
) |
Read a value of an INI file section/key pair
[in] | cdrv | libcapsdriver handle |
[in] | section | The INI file section to search for the key (can be NULL) |
[in] | key | The INI file key to get its value from |
string | Value of the section/key INI entry |
NULL | If the section or key doesn't exist |
libcapsdriver ensures the regular INI files for printer drivers are already read-in when the caps_generic_driver::printer_adaptions() callback in your driver is called.
Details about already existing sections and keys can be found in Device Description INI files. An overview about the INI files hirarchy can be found in Printing Device INI files hierarchy.
int caps_drv_setup_boolean_get | ( | struct caps_drv * | cdrv, |
const char * | section, | ||
const char * | key | ||
) |
Read a boolean value of an INI file section/key pair
[in] | cdrv | libcapsdriver handle |
[in] | section | The INI file section to search for the key (can be NULL) |
[in] | key | The INI file key to get its value from |
1 | The section/key exists and is somehow true |
0 | The section/key does not exist or is somehow false |
This is a special variant of the caps_drv_setup_value_get() function, which tests internally the boolean type of value.
A boolean section/key is true
if its value is "true", "on", "yes" or "1". And it is false
if its value is "false", "off", "no" or "0".
true
, if its value is empty or contains an unknown keyword (according to caps_helper_boolean_check()).libcapsdriver ensures the regular INI files for printer drivers are already read-in when the caps_generic_driver::printer_adaptions() callback in your driver is called.
Details about already existing sections and keys can be found in Device Description INI files. An overview about the INI files hirarchy can be found in Printing Device INI files hierarchy.