Policy API
Description: C source code API documentation for the Oyranos project.
Keywords: Oyranos,Color Management,Color Management,ICC,CMS,C,doxygen,API,documentation

| Oyranos Color Management System API - Version 0.9.6

Functions
Policy API
Color » Defaults Handling

Set and export policies in Oyranos. More...

Collaboration diagram for Policy API:

## Functions
int | oyPolicySaveActual (oyGROUP_e group, oySCOPE_e scope, 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 | oyPolicySet (const char *policy_file, const char *full_name)

## Detailed Description

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, &current )

Future:
  The policies are abstracted into the backend API oyCMMapi9_s. The layout of these options can be obtained from the according backends. The color management policy module for Oyranos is named "oicc".

Todo:
  define some default policies internally

## Function Documentation

## ◆ oyPolicySaveActual()

int oyPolicySaveActual | ( | oyGROUP_e | group,
|  | oySCOPE_e | scope,
|  | 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.

Parameters

  group | use oyGROUP_ALL for a typical snapshot
  scope | supported are: oySCOPE_USER for HOME install oySCOPE_SYSTEM for system wide install
  name | the name will become part of a filename

Returns
  error

Version
  Oyranos: 0.9.6

Date
  2015/02/13

Since
  2008/07/23 (Oyranos: 0.1.8)

## ◆ oyPolicySet()

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.

Parameters

  policy_file | the policy file, will be locked up in standard paths
  full_name | file name including path

Returns
  errors

## ◆ oyPolicyToXML()

char* oyPolicyToXML | ( | oyGROUP_e | group,
|  | int | add_header,
|  | oyAlloc_f | allocate_func
| ) |  |

Save a group of policy settings.
Write only such variables, which are available and ignore unknown ones. This currently produces pseudo xml configuration files.

Parameters

  group | the policy group
  add_header | add description
  allocate_func | user provided function for allocating the strings memory

Returns
  the configuration as XML to save to file

## ◆ oyReadXMLPolicy()

int oyReadXMLPolicy | ( | oyGROUP_e | group,
|  | const char * | xml
| ) |  |

Load a group of policy settings.
use xml-ish input produced by oyPolicyToXML()

Parameters

  group | the policy group
  xml | xml configuration string

Returns
  errors