![]() |
Oyranos Color Management System API |
Set and export policies in Oyranos. More...
![]() |
Functions | |
int | oyPolicySaveActual (oyGROUP_e group, const char *name) |
save a options group to a file More... | |
char * | oyPolicyToXML (oyGROUP_e group, int add_header, oyAlloc_f allocate_func) |
int | oyReadXMLPolicy (oyGROUP_e group, const char *xml) |
int | oyPolicyFileNameGet (const char *policy_name, char **full_name, oyAlloc_f allocateFunc) |
resolve the file name of a policy More... | |
int | oyPolicySet (const char *policy_file, const char *full_name) |
Set and export policies in Oyranos.
Policies are a set of options used to group color management settings.
The core API consists of oyReadXMLPolicy() and its reversal oyPolicyToXML().
Additional oyPolicySaveActual() is used to store the actual options into a policy, oyPolicyFileNameGet() to obtain the file name for a given policy name and oyPolicySet() to import the actual policy from a file.
For getting the count, names and actual one of the installed policy files use oyOptionChoicesGet() e.g. oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, ¤t )
int oyPolicyFileNameGet | ( | const char * | policy_name, |
char ** | full_name, | ||
oyAlloc_f | allocateFunc | ||
) |
resolve the file name of a policy
oyPolicyFileNameGet The resolving is done by weak string matching. So it is possible to use short hands, e.g. "Photo" for "Photographer". The first letter is ignored. A convenience function.
[in] | policy_name | the selected policy |
[out] | full_name | the full file name of policy_name |
[in] | allocateFunc | optional user allocator |
int oyPolicySaveActual | ( | oyGROUP_e | group, |
const char * | name | ||
) |
save a options group to a file
The function is basically a wrapper for oyPolicyToXML() and will write the resulting XML to a file somewhere in XDG_CONFIG_HOME.
A convenience function.
group | use oyGROUP_ALL for a typical snapshot |
name | the name will become part of a filename |
int oyPolicySet | ( | const char * | policy_file, |
const char * | full_name | ||
) |
Load a group of policy settings.
use xml-ish file input produced by oyPolicyToXML()
A convenience function.
policy_file | the policy file, will be locked up in standard paths |
full_name | file name including path |
Save a group of policy settings.
Write only such variables, which are available and ignore unknown ones. This currently produces pseudo xml configuration files.
group | the policy group |
add_header | add description |
allocate_func | user provided function for allocating the strings memory |
int oyReadXMLPolicy | ( | oyGROUP_e | group, |
const char * | xml | ||
) |
Load a group of policy settings.
use xml-ish input produced by oyPolicyToXML()
group | the policy group |
xml | xml configuration string |