| Oyranos Colour Management System API

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
oyConfig_s Struct Reference
Miscellaneous » Values Handling

A group of options for a device. More...

`#include <oyConfig_s.h>`

Inheritance diagram for oyConfig_s:
Collaboration diagram for oyConfig_s:

## Public Member Functions
OYAPI oyConfig_s *OYEXPORT | oyConfig_New (oyObject_s object)
| allocate a new Config object More...
OYAPI oyConfig_s *OYEXPORT | oyConfig_Copy (oyConfig_s *config, oyObject_s object)
| copy or reference a Config object More...
OYAPI int OYEXPORT | oyConfig_Release (oyConfig_s **config)
| release and possibly deallocate a oyConfig_s object More...
OYAPI int OYEXPORT | oyConfig_AddDBData (oyConfig_s *config, const char *key, const char *value, uint32_t flags)
| add a key value pair to a oyConfig_s::db More...
OYAPI int OYEXPORT | oyConfig_ClearDBData (oyConfig_s *config)
| Remove all additional data from the oyConfig_s::db object cache. More...
OYAPI int OYEXPORT | oyConfig_GetDB (oyConfig_s *device, int32_t *rank_value)
| search a configuration in the DB for a configuration from module More...
OYAPI int OYEXPORT | oyConfig_GetFromDB (oyConfig_s *device, oyConfigs_s *configs, int32_t *rank_value)
| search a configuration in the DB for a configuration from module More...
OYAPI int OYEXPORT | oyConfig_SaveToDB (oyConfig_s *config)
| Store a oyConfig_s in DB. More...
OYAPI int OYEXPORT | oyConfig_EraseFromDB (oyConfig_s *config)
| Remove a oyConfig_s from DB. More...
int | oyConfig_Compare (oyConfig_s *module_device, oyConfig_s *db_pattern, int32_t *rank_value)
| Check for matching to a given pattern. More...
OYAPI int OYEXPORT | oyConfig_DomainRank (oyConfig_s *config)
| Check for being recognised by a given module. More...
OYAPI const char *OYEXPORT | oyConfig_FindString (oyConfig_s *config, const char *key, const char *value)
| Search in data sets for a key/value. More...
OYAPI int OYEXPORT | oyConfig_Has (oyConfig_s *config, const char *key)
| Search in data sets for a key. More...
OYAPI oyOption_s *OYEXPORT | oyConfig_Find (oyConfig_s *config, const char *key)
| Search in data sets for a key. More...
OYAPI int OYEXPORT | oyConfig_Count (oyConfig_s *config)
| Number of all options. More...
OYAPI oyOption_s *OYEXPORT | oyConfig_Get (oyConfig_s *config, int pos)
| Get one option. More...
OYAPI oyOptions_s **OYEXPORT | oyConfig_GetOptions (oyConfig_s *config, const char *source)
| Get options from a source. More...
OYAPI int OYEXPORT | oyConfig_SetRankMap (oyConfig_s *config, const oyRankMap *rank_map)
| Set the ranking table. More...
OYAPI const oyRankMap *OYEXPORT | oyConfig_GetRankMap (oyConfig_s *config)
| Get the ranking table. More...
oyRankMap * | oyRankMapCopy (const oyRankMap *rank_map, oyAlloc_f allocateFunc)
| Copy a rank map. More...
OYAPI void OYEXPORT | oyRankMapRelease (oyRankMap **rank_map, oyDeAlloc_f deAllocateFunc)
| Release a Rank Map. More...
OYAPI oyConfig_s *OYEXPORT | oyConfig_FromRegistration (const char *registration, oyObject_s object)
| New config with registration. More...
OYAPI int OYEXPORT | oyConfig_GetBestMatchFromTaxiDB (oyConfig_s *device, int32_t *rank_value)
| search a profile ID in the Taxi DB for a configuration More...
OYAPI const char *OYEXPORT | oyConfig_GetRegistration (oyConfig_s *config)
| Get the registration string registration. More...
OYAPI int OYEXPORT | oyConfig_Set (oyConfig_s *config, const char *registration_domain, oyOptions_s *options, oyBlob_s *data)
| Unimplemented! More...
Public Member Functions inherited from oyStruct_s
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags)
| get a text dump More...

## Data Fields
oyStruct_Copy_f | copy
oyStruct_Release_f | release
Data Fields inherited from oyStruct_s
oyStruct_Copy_f | copy
oyStruct_Release_f | release

## Detailed Description

A group of options for a device.

Version
  Oyranos: 0.1.10

Since
  2009/01/15 (Oyranos: 0.1.10)

Date
  2009/01/15

## Member Function Documentation

OYAPI int OYEXPORT oyConfig_AddDBData | ( | oyConfig_s * | config,
|  | const char * | key,
|  | const char * | value,
|  | uint32_t | flags
| ) |  |

add a key value pair to a oyConfig_s::db

Function oyConfig_AddDBData

This functions handles canonical user side settings. The keys added with this function can later be stored in the DB. A call to oyConfig_GetDB() or oyConfig_ClearDBData() overwrite the added entries.
Modules should add informations to oyConfig_s::data.

Parameters

  [in] | config | the configuration
  [in] | key | a key name, e.g. "my_key"
  [in] | value | a value, e.g. "my_value"
  [in] | flags | see oyOptions_s::oyOptions_SetFromText(.., flags,..)

Returns
  0 - good, 1 >= error

Version
  Oyranos: 0.1.10

Since
  2009/01/21 (Oyranos: 0.1.10)

Date
  2009/02/08

We provide basically a wrapper for oyOptions_SetFromText().

References oyOBJECT_CONFIG_S, and oyOptions_s::oyOptions_SetFromText().

Referenced by oyConfig_SaveToDB(), oyConfigs_s::oyConfigs_FromDB(), oyDeviceFromJSON(), oyDeviceSetProfile(), and oyDevicesFromTaxiDB().

OYAPI int OYEXPORT oyConfig_ClearDBData | ( | oyConfig_s * | config | ) |

Remove all additional data from the oyConfig_s::db object cache.

Function oyConfig_ClearDBData

Clear the local DB cache. The function will be called as well from oyConfig_GetDB().

Parameters

  [in] | config | the configuration

Returns
  0 - good, 1 >= error

Version
  Oyranos: 0.1.10

Since
  2009/02/08 (Oyranos: 0.1.10)

Date
  2009/02/08

References oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_New(), and oyOptions_s::oyOptions_Release().

Referenced by oyDeviceSetProfile().

int oyConfig_Compare | ( | oyConfig_s * | module_device,
|  | oyConfig_s * | db_pattern,
|  | int32_t * | rank_value
| ) |  |

Check for matching to a given pattern.

Function oyConfig_Compare

Parameters

  [in] | module_device | the to be checked configuration from oyConfigs_FromPattern_f; Additional allowed are DB configs.
  [in] | db_pattern | the to be compared configuration from elsewhere, e.g. ICC dict tag
  [out] | rank_value | the number of matches between config and pattern, -1 means invalid

Returns
  0 - good, >= 1 - error + a message should be sent

Version
  Oyranos: 0.1.13

Since
  2009/01/26 (Oyranos: 0.1.10)

Date
  2010/11/21

Option name is equal and and value matches : increase rank value

      we need a comparision mechanism here. The pattern value
      should be expandable to several values.
      Do we need more than the ICC dict style syntax here?

References oyConfig_DomainRank(), oyFilterRegistrationToText(), oyOBJECT_CONFIG_S, oyOption_s::oyOption_GetRegistration(), oyOption_s::oyOption_GetValueText(), oyOption_s::oyOption_Release(), oyOptions_s::oyOptions_Count(), and oyOptions_s::oyOptions_Get().

Referenced by oyConfig_GetFromDB(), oyDevicesFromTaxiDB(), and oyProfiles_s::oyProfiles_DeviceRank().

OYAPI oyConfig_s *OYEXPORT oyConfig_Copy | ( | oyConfig_s * | config,
|  | oyObject_s | object
| ) |  |

copy or reference a Config object

Function oyConfig_Copy

The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.

Parameters

  [in] | config | Config struct object
  | object | NULL - means reference, the optional object triggers a real copy

References oyOBJECT_CONFIG_S.

Referenced by oyConfig_GetFromDB(), and oyDeviceBackendCall().

OYAPI int OYEXPORT oyConfig_Count | ( | oyConfig_s * | config | ) |

Number of all options.

Function oyConfig_Count

Parameters

  [in] | config | the configuration

Returns
  the options count

Version
  Oyranos: 0.1.10

Since
  2009/02/08 (Oyranos: 0.1.10)

Date
  2009/02/08

References oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_AppendOpts(), oyOptions_s::oyOptions_Count(), oyOptions_s::oyOptions_New(), and oyOptions_s::oyOptions_Release().

Referenced by oyDeviceSelectSimiliar(), oyDeviceToJSON(), and oyProfile_s::oyProfile_AddDevice().

OYAPI int OYEXPORT oyConfig_DomainRank | ( | oyConfig_s * | config | ) |

Check for being recognised by a given module.

Function oyConfig_DomainRank

Parameters

  [in] | config | the configuration to be checked wether or not the module can make sense of it and support the data

Returns
  0 - indifferent, <= -1 - no fit

Version
  Oyranos: 0.1.10

Since
  2009/01/26 (Oyranos: 0.1.10)

Date
  2009/01/26

Ask the module if it wants later on to accept this configuration.

References oyOBJECT_CMM_API8_S, and oyOBJECT_CONFIG_S.

Referenced by oyConfig_Compare().

OYAPI int OYEXPORT oyConfig_EraseFromDB | ( | oyConfig_s * | config | ) |

Remove a oyConfig_s from DB.

Function oyConfig_EraseFromDB

Parameters

  [in] | config | the configuration

Returns
  0 - good, 1 >= error

Version
  Oyranos: 0.1.10

Since
  2009/01/27 (Oyranos: 0.1.10)

Date
  2009/01/27

References oyOBJECT_CONFIG_S, oyOption_s::oyOption_GetRegistration(), oyOption_s::oyOption_Release(), and oyOptions_s::oyOptions_Get().

Referenced by oyDeviceSetProfile().

OYAPI oyOption_s *OYEXPORT oyConfig_Find | ( | oyConfig_s * | config,
|  | const char * | key
| ) |  |

Search in data sets for a key.

Function oyConfig_Find

Parameters

  [in] | config | the configuration to be checked wether or not the module can make sense of it and support the data
  [in] | key | the key name

Returns
  the found value

Version
  Oyranos: 0.1.10

Since
  2009/02/08 (Oyranos: 0.1.10)

Date
  2009/02/08

References oyOBJECT_CONFIG_S, and oyOptions_s::oyOptions_Find().

Referenced by oyDeviceAskProfile2(), and oyDeviceProfileFromDB().

OYAPI const char *OYEXPORT oyConfig_FindString | ( | oyConfig_s * | config,
|  | const char * | key,
|  | const char * | value
| ) |  |

Search in data sets for a key/value.

Function oyConfig_FindString

Parameters

  [in] | config | the configuration to be checked wether or not the module can make sense of it and support the data
  [in] | key | the key name
  [in] | value | the optional value

Returns
  the found value

Version
  Oyranos: 0.1.10

Since
  2009/02/08 (Oyranos: 0.1.10)

Date
  2009/02/08

References oyOBJECT_CONFIG_S, and oyOptions_s::oyOptions_FindString().

Referenced by oyConfigs_s::oyConfigs_FromDeviceClass(), oyConfigs_s::oyConfigs_SelectSimilars(), oyDeviceProfileFromDB(), oyDeviceSelectSimiliar(), oyDeviceSetProfile(), oyDeviceSetup(), oyDevicesFromTaxiDB(), oyDeviceUnset(), oyProfile_s::oyProfile_AddDevice(), and oyProfiles_s::oyProfiles_DeviceRank().

OYAPI oyConfig_s *OYEXPORT oyConfig_FromRegistration | ( | const char * | registration,
|  | oyObject_s | object
| ) |  |

New config with registration.

Function oyConfig_FromRegistration

Parameters

  registration | no or full qualified registration
  object | the optional object

Returns
  the config

Version
  Oyranos: 0.1.11

Since
  2010/08/09 (Oyranos: 0.1.11)

Date
  2010/08/09

References oyConfig_New().

Referenced by oyConfigs_s::oyConfigs_FromDB(), oyDeviceFromJSON(), and oyProfiles_s::oyProfiles_DeviceRank().

OYAPI oyOption_s *OYEXPORT oyConfig_Get | ( | oyConfig_s * | config,
|  | int | pos
| ) |  |

Get one option.

Function oyConfig_Get

Parameters

  [in] | config | the configuration
  [in] | pos | option position

Returns
  the selected option

Version
  Oyranos: 0.1.10

Since
  2009/02/08 (Oyranos: 0.1.10)

Date
  2009/02/08

References oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_AppendOpts(), oyOptions_s::oyOptions_Get(), oyOptions_s::oyOptions_New(), and oyOptions_s::oyOptions_Release().

Referenced by oyDeviceSelectSimiliar(), oyDeviceToJSON(), and oyProfile_s::oyProfile_AddDevice().

OYAPI int OYEXPORT oyConfig_GetBestMatchFromTaxiDB | ( | oyConfig_s * | device,
|  | int32_t * | rank_value
| ) |  |

search a profile ID in the Taxi DB for a configuration

Function oyConfig_GetBestMatchFromTaxiDB

Parameters

  [in] | device | the to be checked configuration from oyConfigs_FromPattern_f
  [out] | rank_value | the number of matches between config and pattern, -1 means invalid

Returns
  0 - good, >= 1 - error + a message should be sent

Version
  Oyranos: 0.3.2

Since
  2009/01/26 (Oyranos: 0.3.2)

Date
  2011/09/14

References oyConfig_GetFromDB(), oyConfigs_s::oyConfigs_Release(), oyDevicesFromTaxiDB(), oyOBJECT_CONFIG_S, and oyOptions_s::oyOptions_Release().

OYAPI int OYEXPORT oyConfig_GetDB | ( | oyConfig_s * | device,
|  | int32_t * | rank_value
| ) |  |

search a configuration in the DB for a configuration from module

Function oyConfig_GetDB

Parameters

  [in] | device | the to be checked configuration from oyConfigs_FromPattern_f
  [out] | rank_value | the number of matches between config and pattern, -1 means invalid

Returns
  0 - good, >= 1 - error + a message should be sent

Version
  Oyranos: 0.3.0

Since
  2009/01/26 (Oyranos: 0.1.10)

Date
  2012/09/15

References oyConfig_GetFromDB(), oyConfigs_s::oyConfigs_FromDB(), oyConfigs_s::oyConfigs_Release(), and oyOBJECT_CONFIG_S.

Referenced by oyDeviceProfileFromDB(), and oyDeviceSetProfile().

OYAPI int OYEXPORT oyConfig_GetFromDB | ( | oyConfig_s * | device,
|  | oyConfigs_s * | configs,
|  | int32_t * | rank_value
| ) |  |

search a configuration in the DB for a configuration from module

Function oyConfig_GetFromDB

Parameters

  [in] | device | the to be checked configuration from oyConfigs_FromPattern_f
  [out] | rank_value | the number of matches between config and pattern, -1 means invalid

Returns
  0 - good, >= 1 - error + a message should be sent

Version
  Oyranos: 0.3.2

Since
  2009/01/26 (Oyranos: 0.3.2)

Date
  2011/09/14

References oyConfig_Compare(), oyConfig_Copy(), oyConfig_Release(), oyConfigs_s::oyConfigs_Count(), oyConfigs_s::oyConfigs_Get(), oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_Copy(), and oyOptions_s::oyOptions_Release().

Referenced by oyConfig_GetBestMatchFromTaxiDB(), and oyConfig_GetDB().

OYAPI oyOptions_s **OYEXPORT oyConfig_GetOptions | ( | oyConfig_s * | config,
|  | const char * | source
| ) |  |

Get options from a source.

Function oyConfig_GetOptions

This API allows low level operations on a Config object. Do not release the returned Options without replacement inside the Config object.

A Config object has three kind of options.

The data base "db" properties are for persistent storage in a DB, e.g. "org/freedesktop/imaging/config.monitor.xorg/1/manufacturer=EIZO"

The "backend_core" options are the module core properties, the ones to identify the device and store in DB. They must be filled by the module. e.g. "org/freedesktop/imaging/config.monitor.xorg/manufacturer=EIZO"

The "data" properties are additional options without identification purpose and not intended for DB storage, e.g. "org/freedesktop/imaging/config.monitor.xorg/edid=oyBlob_s*"

Parameters

  [in] | config | the configuration
  [in] | source | use of the options, "db" for persistent options "backend_core" for module options "data" for module options without identification purpose

Returns
  the selected options, in the domain of the config

Version
  Oyranos: 0.5.0

Date
  2012/10/03

Since
  2012/10/03 (Oyranos: 0.5.0)

References oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_Clear(), and oyOptions_s::oyOptions_New().

OYAPI const oyRankMap *OYEXPORT oyConfig_GetRankMap | ( | oyConfig_s * | config | ) |

Get the ranking table.

Function oyConfig_GetRankMap

Parameters

  [in] | config | the configuration

Returns
  rank_map the rank map

Version
  Oyranos: 0.5.0

Date
  2012/10/03

Since
  2012/10/03 (Oyranos: 0.5.0)

References oyOBJECT_CONFIG_S.

OYAPI const char *OYEXPORT oyConfig_GetRegistration | ( | oyConfig_s * | config | ) |

Get the registration string registration.

Function oyConfig_GetRegistration

Parameters

  [in] | config | the config

Returns
  the registration string

Version
  Oyranos: 0.5.0

Date
  2012/09/19

Since
  2012/09/19 (Oyranos: 0.5.0)

References oyOBJECT_CONFIG_S.

OYAPI int OYEXPORT oyConfig_Has | ( | oyConfig_s * | config,
|  | const char * | key
| ) |  |

Search in data sets for a key.

Function oyConfig_Has

Parameters

  [in] | config | the configuration to be checked wether or not the module can make sense of it and support the data
  [in] | key | the key name

Returns
  0 - not found; 1 - key found

Version
  Oyranos: 0.1.10

Since
  2009/12/10 (Oyranos: 0.1.10)

Date
  2009/12/10

References oyOBJECT_CONFIG_S, oyOption_s::oyOption_Release(), and oyOptions_s::oyOptions_Find().

Referenced by oyDeviceSetup().

OYAPI oyConfig_s *OYEXPORT oyConfig_New | ( | oyObject_s | object | ) |

allocate a new Config object

Function oyConfig_New

References oyOBJECT_OBJECT_S.

Referenced by oyConfig_FromRegistration().

OYAPI int OYEXPORT oyConfig_Release | ( | oyConfig_s ** | config | ) |

release and possibly deallocate a oyConfig_s object

Function oyConfig_Release

Parameters

  [in,out] | config | Config struct object

References oyOBJECT_CONFIG_S.

Referenced by oyConfig_GetFromDB(), oyConfigs_s::oyConfigs_FromDeviceClass(), oyConfigs_s::oyConfigs_FromDomain(), oyConfigs_s::oyConfigs_Modify(), oyConfigs_s::oyConfigs_SelectSimilars(), oyDeviceGet(), oyDeviceGetInfo(), oyDeviceSelectSimiliar(), oyDeviceSetProfile(), and oyDevicesFromTaxiDB().

OYAPI int OYEXPORT oyConfig_SaveToDB | ( | oyConfig_s * | config | ) |

Store a oyConfig_s in DB.

Function oyConfig_SaveToDB

The new key set name is stored inside the key "key_set_name".

Parameters

  [in] | config | the configuration

Returns
  0 - good, 1 >= error

Version
  Oyranos: 0.1.10

Since
  2009/01/21 (Oyranos: 0.1.10)

Date
  2011/01/29

References oyConfig_AddDBData(), oyOBJECT_CONFIG_S, oyOptions_s::oyOptions_AppendOpts(), oyOptions_s::oyOptions_New(), oyOptions_s::oyOptions_Release(), and oyOptions_s::oyOptions_SaveToDB().

Referenced by oyDeviceSetProfile().

OYAPI int OYEXPORT oyConfig_Set | ( | oyConfig_s * | config,
|  | const char * | registration_domain,
|  | oyOptions_s * | options,
|  | oyBlob_s * | data
| ) |  |

Unimplemented!

Function oyConfig_Set

OYAPI int OYEXPORT oyConfig_SetRankMap | ( | oyConfig_s * | config,
|  | const oyRankMap * | rank_map
| ) |  |

Set the ranking table.

Function oyConfig_SetRankMap

Parameters

  [in,out] | config | the configuration
  [in] | rank_map | the new rank map

Returns
  error

Version
  Oyranos: 0.5.0

Date
  2012/10/03

Since
  2012/10/03 (Oyranos: 0.5.0)

References oyOBJECT_CONFIG_S, oyRankMapCopy(), and oyRankMapRelease().

oyRankMap * oyRankMapCopy | ( | const oyRankMap * | rank_map,
|  | oyAlloc_f | allocateFunc
| ) |  |

Copy a rank map.

Function oyRankMapCopy

Version
  Oyranos: 0.1.10

Since
  2009/01/27 (Oyranos: 0.1.10)

Date
  2009/01/27

Referenced by oyConfig_SetRankMap(), and oyConfigs_s::oyConfigs_FromDB().

OYAPI void OYEXPORT oyRankMapRelease | ( | oyRankMap ** | rank_map,
|  | oyDeAlloc_f | deAllocateFunc
| ) |  |

Release a Rank Map.

Function oyRankMapRelease

Parameters

  [in,out] | rank_map | the rank map
  [in] | deAllocateFunc | the memory release function

Returns
  error

Version
  Oyranos: 0.5.0

Date
  2012/10/03

Since
  2012/10/03 (Oyranos: 0.5.0)

Referenced by oyConfig_SetRankMap().

## Field Documentation

oyStruct_Copy_f oyConfig_s::copy

copy function

oyStruct_Release_f oyConfig_s::release

release function