| 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
oyConfigs_s Struct Reference
Values Handling

A Configs list. More...

`#include <oyConfigs_s.h>`

Inheritance diagram for oyConfigs_s:
Collaboration diagram for oyConfigs_s:

## Public Member Functions

OYAPI oyConfigs_s *OYEXPORT | oyConfigs_New (oyObject_s object)
| allocate a new Configs object More...
OYAPI oyConfigs_s *OYEXPORT | oyConfigs_Copy (oyConfigs_s *configs, oyObject_s object)
| copy or reference a Configs object More...
OYAPI int OYEXPORT | oyConfigs_Release (oyConfigs_s **configs)
| release and possibly deallocate a oyConfigs_s object More...
OYAPI int OYEXPORT | oyConfigs_MoveIn (oyConfigs_s *list, oyConfig_s **obj, int pos)
| add an element to a Configs list More...
OYAPI int OYEXPORT | oyConfigs_ReleaseAt (oyConfigs_s *list, int pos)
| release a element from a Configs list More...
OYAPI oyConfig_s *OYEXPORT | oyConfigs_Get (oyConfigs_s *list, int pos)
| get a element of a Configs list More...
OYAPI int OYEXPORT | oyConfigs_Count (oyConfigs_s *list)
| count the elements in a Configs list More...
OYAPI int OYEXPORT | oyConfigs_Clear (oyConfigs_s *list)
| clear the elements in a Configs list More...
OYAPI int OYEXPORT | oyConfigs_Sort (oyConfigs_s *list, int32_t *rank_list)
| sort a list according to a rank_list More...
OYAPI int OYEXPORT | oyConfigs_FromDomain (const char *registration_domain, oyOptions_s *options, oyConfigs_s **configs, oyObject_s object)
| Send a request to a configuration module. More...
OYAPI int OYEXPORT | oyConfigs_FromDeviceClass (const char *device_type, const char *device_class, oyOptions_s *options, oyConfigs_s **devices, oyObject_s object)
| Ask a module for device informations or other direct calls. More...
OYAPI int OYEXPORT | oyConfigs_SelectSimilars (oyConfigs_s *list, const char *pattern[][2], oyConfigs_s **filtered)
| filter similiar configs compared by a pattern More...
OYAPI int OYEXPORT | oyConfigs_FromDB (const char *registration, oyConfigs_s **configs, oyObject_s object)
| Get all oyConfigs_s from DB. More...
OYAPI int OYEXPORT | oyConfigs_Modify (oyConfigs_s *configs, oyOptions_s *options)
| Ask a module for device informations or other direct calls. More...
OYAPI int OYEXPORT | oyConfigDomainList (const char *registration_pattern, char ***list, uint32_t *count, uint32_t **rank_list, oyAlloc_f allocateFunc)
| Count and show the global oyConfigs_s suppliers. 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 Configs list.

Managing the plural of oyConfig_s for the sake of typesafety.

Note
  This class holds a list of objects [list]

Version
  Oyranos: 0.1.10

Since
  2009/01/19 (Oyranos: 0.1.10)

Date
  2009/01/19

## Member Function Documentation

OYAPI int OYEXPORT oyConfigDomainList | ( | const char * | registration_pattern,
|  | char *** | list,
|  | uint32_t * | count,
|  | uint32_t ** | rank_list,
|  | oyAlloc_f | allocateFunc
| ) |  |

Count and show the global oyConfigs_s suppliers.

Function oyConfigDomainList

    uint32_t count = 0,
           * rank_list = 0;
    char ** texts = 0,
          * temp = 0,
         ** attributes = 0,
          * device_class = 0;
    int i,j, attributes_n;

    // get all configuration filters
    oyConfigDomainList("//"OY_TYPE_STD"/config", &texts, &count,&rank_list ,0 );
    for( i = 0; i < count; ++i )
    {
      attributes_n = 0;

      // pick the filters name and remove the common config part
      temp = oyFilterRegistrationToText( texts[i], oyFILTER_REG_APPLICATION,
                                         malloc );
      attributes = oyStringSplit_( temp, '.', &attributes_n, malloc );
      free(temp);
      temp = malloc(1024); temp[0] = 0;
      for(j = 0; j < attributes_n; ++j)
      {
        if(strcmp(attributes[j], "config") == 0)
          continue;

        if(j && temp[0])
          sprintf( &temp[strlen(temp)], "." );
        sprintf( &temp[strlen(temp)], "%s", attributes[j]);
      }

      // The string in temp can be passed as the device_class argument to
      // oyDevicesGet()
      printf("%d: %s \"%s\"\n", i, texts[i], temp);

      oyStringListRelease_( &attributes, attributes_n, free );
      free (device_class);
      free(temp);
    }

Parameters

  [in] | registration_pattern | a optional filter
  [out] | list | the list with full filter registrations
  [out] | count | the list count
  [out] | rank_list | the rank fitting to list
  [in] | allocateFunc | the user allocator for list

Returns
  0 - good, >= 1 - error, <= -1 unknown

Version
  Oyranos: 0.1.10

Since
  2009/01/19 (Oyranos: 0.1.10)

Date
  2009/01/19

References oyOBJECT_CMM_API8_S.

Referenced by oyConfigs_FromDB(), oyConfigs_FromDeviceClass(), and oyConfigs_Modify().

OYAPI int OYEXPORT oyConfigs_Clear | ( | oyConfigs_s * | list | ) |

clear the elements in a Configs list

Function oyConfigs_Clear

Parameters

  [in,out] | list | the list

Returns
  0 - success; otherwise - error

Version
  Oyranos: 0.3.0

Since
  2011/02/01 (Oyranos: 0.3.0)

Date
  2011/02/01

References oyOBJECT_CONFIGS_S, and oyStructList_s::oyStructList_Clear().

OYAPI oyConfigs_s *OYEXPORT oyConfigs_Copy | ( | oyConfigs_s * | configs,
|  | oyObject_s | object
| ) |  |

copy or reference a Configs object

Function oyConfigs_Copy

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

Parameters

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

References oyOBJECT_CONFIGS_S.

OYAPI int OYEXPORT oyConfigs_Count | ( | oyConfigs_s * | list | ) |

count the elements in a Configs list

Function oyConfigs_Count

Parameters

  [in,out] | list | the list

Returns
  element count

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_CONFIGS_S, and oyStructList_s::oyStructList_Count().

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

OYAPI int OYEXPORT oyConfigs_FromDB | ( | const char * | registration,
|  | oyConfigs_s ** | configs,
|  | oyObject_s | object
| ) |  |

Get all oyConfigs_s from DB.

Function oyConfigs_FromDB

Parameters

  [in] | registration | the filter
  [out] | configs | the found configuration list
  [in] | object | a optional user object

Returns
  error

Version
  Oyranos: 0.1.10

Since
  2009/01/23 (Oyranos: 0.1.10)

Date
  2010/02/25

0. setup Elektra

1. get all module names for the registration pattern

1. obtain the directory structure for configurations

1. obtain all keys from one configuration directory

1. create a oyOption_s for each Elektra DB key/value pair

References oyConfig_s::oyConfig_AddDBData(), oyConfig_s::oyConfig_FromRegistration(), oyConfigDomainList(), oyConfigs_MoveIn(), oyConfigs_New(), oyConfigs_Release(), oyOBJECT_CMM_API8_S, oyOption_s::oyOption_FromDB(), oyOption_s::oyOption_Release(), oyOptions_s::oyOptions_Add(), and oyConfig_s::oyRankMapCopy().

Referenced by oyConfig_s::oyConfig_GetDB(), and oyDeviceSetProfile().

OYAPI int OYEXPORT oyConfigs_FromDeviceClass | ( | const char * | device_type,
|  | const char * | device_class,
|  | oyOptions_s * | options,
|  | oyConfigs_s ** | devices,
|  | oyObject_s | object
| ) |  |

Ask a module for device informations or other direct calls.

Function oyConfigs_FromDeviceClass

Parameters

  [in] | device_type | the device type oyFILTER_REG_TYPE, defaults to OY_TYPE_STD (optional)
  [in] | device_class | the device class, e.g. "monitor", oyFILTER_REG_APPLICATION
  [in] | options | options to pass to the module, for zero the usage instructions are requested, a option "device_name" can be used as filter
  [out] | devices | the devices
  [in] | object | the optional object

Returns
  0 - good, >= 1 - error

    // pass empty options to the module to get a usage message
    oyOptions_s * options = 0;
    int error = oyConfigs_FromDeviceClass( OY_TYPE_STD, "monitor",
                                              options, 0, 0 );

Version
  Oyranos: 0.1.10

Since
  2009/01/28 (Oyranos: 0.1.10)

Date
  2009/01/30

1. obtain detailed and expensive device informations

1.2.1 build a device class registration string

1.2.2 get all device class module names

1.3 ask each module

1.3.1 call into module

1.3.1.1 Compare the device_name with the device_name option and collect the matching devices.

1.3.1.2 ... or collect all device configurations

The basic call on how to obtain the configuration is added here as the objects name. "properties" and "list" are known.

References oyConfig_s::oyConfig_FindString(), oyConfig_s::oyConfig_Release(), oyConfigDomainList(), oyConfigs_Count(), oyConfigs_FromDomain(), oyConfigs_Get(), oyConfigs_MoveIn(), oyConfigs_New(), oyConfigs_Release(), oyNAME_NAME, oyOptions_s::oyOptions_Copy(), oyOptions_s::oyOptions_FindString(), and oyOptions_s::oyOptions_Release().

Referenced by oyDeviceGet(), and oyDevicesGet().

OYAPI int OYEXPORT oyConfigs_FromDomain | ( | const char * | registration_domain,
|  | oyOptions_s * | options,
|  | oyConfigs_s ** | configs,
|  | oyObject_s | object
| ) |  |

Send a request to a configuration module.

Function oyConfigs_FromDomain

The convention an empty options argument should be send an Warning message containing intructions on how to talk with the module as a fallback for programmers. Otherwise the calls are pure convention and depend on the usage and agreement of the partners.

For the convention to call to colour devices

See Also
  oyX1Configs_FromPatternUsage().

Parameters

  [in] | registration_domain | the module to call to
  [in] | options | options to specify the calling into modules messages are bound to this object
  [out] | configs | the returned configurations
  [in] | object | a optional user object

Returns
  0 - good, 1 <= error, -1 >= issues, look for messages

Version
  Oyranos: 0.1.10

Since
  2009/01/16 (Oyranos: 0.1.10)

Date
  2009/01/19

1. first we search for oyCMMapi8_s complex config support matching to our registration_domain
2. if we find a module, we ask for the options
3. add the options to the config (in the module)

References oyConfig_s::oyConfig_Release(), oyConfigs_Count(), oyConfigs_Get(), oyConfigs_Release(), oyOBJECT_CMM_API8_S, oyOptions_s::oyOptions_SetSource(), and oyOPTIONSOURCE_FILTER.

Referenced by oyConfigs_FromDeviceClass(), and oyDeviceUnset().

OYAPI oyConfig_s *OYEXPORT oyConfigs_Get | ( | oyConfigs_s * | list,
|  | int | pos
| ) |  |

get a element of a Configs list

Function oyConfigs_Get

Parameters

  [in,out] | list | the list
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_CONFIG_S, oyOBJECT_CONFIGS_S, and oyStructList_s::oyStructList_GetRefType().

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

OYAPI int OYEXPORT oyConfigs_Modify | ( | oyConfigs_s * | configs,
|  | oyOptions_s * | options
| ) |  |

Ask a module for device informations or other direct calls.

Function oyConfigs_Modify

Parameters

  [in,out] | configs | The passed configs first member is used to obtain a registration string and select a appropriate module. Regarding the module the configs need to be homogenous. All configs are passed at once to the module. Mixing configs from different modules is not defined.
  [in] | options | options to pass to the module; With zero the usage instructions are requested.

Returns
  0 - good, >= 1 - error, issue <= -1

Version
  Oyranos: 0.1.10

Since
  2009/08/21 (Oyranos: 0.1.10)

Date
  2009/08/25

1. pick the first device to select a registration

1.2 get all device class module names from the firsts oyConfig_s registration

1. call each modules oyCMMapi8_s::oyConfigs_Modify

References oyConfig_s::oyConfig_Release(), oyConfigDomainList(), oyConfigs_Count(), oyConfigs_Get(), oyOBJECT_CMM_API8_S, and oyOBJECT_CONFIGS_S.

Referenced by oyDeviceBackendCall().

OYAPI int OYEXPORT oyConfigs_MoveIn | ( | oyConfigs_s * | list,
|  | oyConfig_s ** | obj,
|  | int | pos
| ) |  |

add an element to a Configs list

Function oyConfigs_MoveIn

Parameters

  [in] | list | list
  [in,out] | obj | list element
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_CONFIG_S, oyOBJECT_CONFIGS_S, oyStructList_s::oyStructList_Create(), and oyStructList_s::oyStructList_MoveIn().

Referenced by oyConfigs_FromDB(), oyConfigs_FromDeviceClass(), oyConfigs_SelectSimilars(), oyDeviceBackendCall(), oyDeviceSelectSimiliar(), and oyDevicesFromTaxiDB().

OYAPI oyConfigs_s *OYEXPORT oyConfigs_New | ( | oyObject_s | object | ) |

allocate a new Configs object

Function oyConfigs_New

References oyOBJECT_OBJECT_S.

Referenced by oyConfigs_FromDB(), oyConfigs_FromDeviceClass(), oyConfigs_SelectSimilars(), oyDeviceBackendCall(), oyDeviceSelectSimiliar(), and oyDevicesFromTaxiDB().

OYAPI int OYEXPORT oyConfigs_Release | ( | oyConfigs_s ** | configs | ) |

release and possibly deallocate a oyConfigs_s object

Function oyConfigs_Release

Parameters

  [in,out] | configs | Configs struct object

References oyOBJECT_CONFIGS_S.

Referenced by oyConfig_s::oyConfig_GetBestMatchFromTaxiDB(), oyConfig_s::oyConfig_GetDB(), oyConfigs_FromDB(), oyConfigs_FromDeviceClass(), oyConfigs_FromDomain(), oyDeviceBackendCall(), oyDeviceGet(), oyDeviceSelectSimiliar(), oyDeviceSetProfile(), and oyDevicesFromTaxiDB().

OYAPI int OYEXPORT oyConfigs_ReleaseAt | ( | oyConfigs_s * | list,
|  | int | pos
| ) |  |

release a element from a Configs list

Function oyConfigs_ReleaseAt

Parameters

  [in,out] | list | the list
  | pos | position

Version
  Oyranos: 0.1.10

Since
  2010/07/05 (Oyranos: 0.1.10)

Date
  2010/07/05

References oyOBJECT_CONFIGS_S, oyStructList_s::oyStructList_GetParentObjType(), and oyStructList_s::oyStructList_ReleaseAt().

OYAPI int OYEXPORT oyConfigs_SelectSimilars | ( | oyConfigs_s * | list,
|  | const char * | pattern[][2],
|  | oyConfigs_s ** | filtered
| ) |  |

filter similiar configs compared by a pattern

Function oyConfigs_SelectSimilars

This is a simple convenience function to select from a list existing configurations.

       const char * pattern[][2] = {{"device_name",0},
                                    {"manufacturer",0},
                                    {"model",0},
                                    {"serial",0},
                                    {0,0}};
       oyConfigs_s * devices = 0, * filtered = 0;
       int error = oyConfigs_FromDB( registration, &devices, 0 );
       error = oyConfigs_SelectSimilars( devices, pattern, &filtered )
    *

Parameters

  [in] | list | the list
  [in] | pattern | user supplied zero terminated pattern list; The first element is a mandadory key to meet. The second element is the optional value. Each
  [out] | filtered | the result

Returns
  error

Version
  Oyranos: 0.1.10

Since
  2009/02/26 (Oyranos: 0.1.10)

Date
  2009/02/26

0. setup Elektra

References oyConfig_s::oyConfig_FindString(), oyConfig_s::oyConfig_Release(), oyConfigs_Count(), oyConfigs_Get(), oyConfigs_MoveIn(), oyConfigs_New(), and oyOBJECT_CONFIGS_S.

OYAPI int OYEXPORT oyConfigs_Sort | ( | oyConfigs_s * | list,
|  | int32_t * | rank_list
| ) |  |

sort a list according to a rank_list

Function oyConfigs_Sort

Version
  Oyranos: 0.3.0

Since
  2011/02/01 (Oyranos: 0.3.0)

Date
  2011/02/01

References oyOBJECT_CONFIGS_S, and oyStructList_s::oyStructList_Sort().

## Field Documentation

oyStruct_Copy_f oyConfigs_s::copy

copy function

oyStruct_Release_f oyConfigs_s::release

release function