![]() |
Oyranos
git-devel
Oyranos is a full featured Color Management System
|
generic Options More...
#include <oyOptions_s.h>
Public Member Functions | |
OYAPI oyOptions_s *OYEXPORT | oyOptions_New (oyObject_s object) |
allocate a new Options object More... | |
OYAPI oyOptions_s *OYEXPORT | oyOptions_Copy (oyOptions_s *options, oyObject_s object) |
Copy or Reference a Options object. More... | |
OYAPI int OYEXPORT | oyOptions_Release (oyOptions_s **options) |
release and possibly deallocate a oyOptions_s object More... | |
OYAPI int OYEXPORT | oyOptions_MoveIn (oyOptions_s *list, oyOption_s **obj, int pos) |
add an element to a Options list More... | |
OYAPI int OYEXPORT | oyOptions_ReleaseAt (oyOptions_s *list, int pos) |
release a element from a Options list More... | |
OYAPI oyOption_s *OYEXPORT | oyOptions_Get (oyOptions_s *list, int pos) |
get a element of a Options list More... | |
OYAPI int OYEXPORT | oyOptions_Count (oyOptions_s *list) |
count the elements in a Options list More... | |
OYAPI int OYEXPORT | oyOptions_Clear (oyOptions_s *list) |
clear the elements in a Options list More... | |
OYAPI int OYEXPORT | oyOptions_Sort (oyOptions_s *list, int32_t *rank_list) |
sort a list according to a rank_list More... | |
oyOptions_s * | oyOptions_FromBoolean (oyOptions_s *set_a, oyOptions_s *set_b, oyBOOLEAN_e type, oyObject_s object) |
boolean operations on two sets of options More... | |
int | oyOptions_FromJSON (const char *json_text, oyOptions_s *options, oyOptions_s **result, const char *xformat,...) |
deserialise a text file to oyOptions_s data More... | |
oyOptions_s * | oyOptions_FromText (const char *text, uint32_t flags OY_UNUSED, oyObject_s object) |
deserialise a text file to oyOptions_s data More... | |
int | oyOptions_Add (oyOptions_s *options, oyOption_s *option, int pos, oyObject_s object) |
add a element to a Options list More... | |
int | oyOptions_Set (oyOptions_s *options, oyOption_s *option, int pos, oyObject_s object) |
set a element in a Options list More... | |
int | oyOptions_SetOpts (oyOptions_s *list, oyOptions_s *add) |
set options in a Options list More... | |
int | oyOptions_AppendOpts (oyOptions_s *list, oyOptions_s *append) |
Basic reference options from one list into an other. More... | |
int | oyOptions_CopyFrom (oyOptions_s **list, oyOptions_s *from, oyBOOLEAN_e type, oyFILTER_REG_e fields, oyObject_s object) |
copy from one option set to an other option set More... | |
int | oyOptions_Filter (oyOptions_s **add_list, int32_t *count, uint32_t flags, oyBOOLEAN_e type, const char *registration, oyOptions_s *src_list) |
filter options More... | |
const char * | oyOptions_GetText (oyOptions_s *options, oyNAME_e type) |
dump options to text More... | |
int | oyOptions_CountType (oyOptions_s *options, const char *registration, oyOBJECT_e type) |
search for options with special attributes More... | |
oyOption_s * | oyOptions_Find (oyOptions_s *options, const char *registration, uint32_t type) |
search for a certain option key More... | |
const char * | oyOptions_FindString (oyOptions_s *options, const char *registration, const char *value) |
search for a certain option key and possibly value More... | |
int | oyOptions_SetFromString (oyOptions_s **obj, const char *registration, const char *value, uint32_t flags) |
change a value More... | |
int | oyOptions_FindInt (oyOptions_s *options, const char *registration, int pos, int32_t *result) |
get a value More... | |
int | oyOptions_SetFromInt (oyOptions_s **obj, const char *registration, int32_t value, int pos, uint32_t flags) |
change a value More... | |
int | oyOptions_FindDouble (oyOptions_s *options, const char *registration, int pos, double *result) |
get a value More... | |
int | oyOptions_SetFromDouble (oyOptions_s **obj, const char *registration, double value, int pos, uint32_t flags) |
change a value More... | |
int | oyOptions_GetType2 (oyOptions_s *options, int pos, const char *pattern, uint32_t pattern_type, oyOBJECT_e object_type, oyStruct_s **result, oyOption_s **option) |
select from options with special attributes More... | |
oyStruct_s * | oyOptions_GetType (oyOptions_s *options, int pos, const char *pattern, oyOBJECT_e type) |
select from options with special attribute More... | |
int | oyOptions_MoveInStruct (oyOptions_s **obj, const char *registration, oyStruct_s **oy_struct, uint32_t flags) |
change a value More... | |
int | oyOptions_SetFromData (oyOptions_s **options, const char *registration, oyPointer ptr, size_t size, uint32_t flags) |
set a data blob or plain pointer More... | |
int | oyOptions_FindData (oyOptions_s *options, const char *registration, oyPointer *result, size_t *size, oyAlloc_f allocateFunc) |
get a value More... | |
int | oyOptions_SetSource (oyOptions_s *options, oyOPTIONSOURCE_e source) |
set source attribute More... | |
OYAPI int OYEXPORT | oyOptions_ObserverAdd (oyOptions_s *object, oyStruct_s *observer, oyStruct_s *user_data, oyObserver_Signal_f signalFunc) |
observe options and its elements More... | |
OYAPI int OYEXPORT | oyOptions_ObserversDisable (oyOptions_s *object) |
disable signaling More... | |
OYAPI int OYEXPORT | oyOptions_ObserversEnable (oyOptions_s *object) |
disable signaling More... | |
OYAPI int OYEXPORT | oyOptions_SetDriverContext (oyOptions_s **options, oyPointer driver_context, const char *driver_context_type, size_t driver_context_size, oyObject_s object) |
set a device option from a given external context More... | |
void | oyOptions_Release__Members (oyOptions_s_ *options) |
Custom Options destructor. More... | |
int | oyOptions_Init__Members (oyOptions_s_ *options OY_UNUSED) |
Custom Options constructor. More... | |
int | oyOptions_Copy__Members (oyOptions_s_ *dst, oyOptions_s_ *src) |
Custom Options copy constructor. More... | |
oyOptions_s * | oyOptions_ForFilter (const char *registration, uint32_t flags, oyObject_s object) |
provide Oyranos behaviour settings More... | |
oyOptions_s * | oyOptions_ForFilter_ (oyFilterCore_s_ *core, oyFilterNode_s_ *node, uint32_t flags, oyObject_s object) |
Provide Oyranos behaviour settings. More... | |
OYAPI int OYEXPORT | oyOptions_SaveToDB (oyOptions_s *options, oySCOPE_e scope, const char *registration, char **new_reg, oyAlloc_f allocateFunc) |
store a oyOptions_s in DB More... | |
int | oyOptions_DoFilter (oyOptions_s *opts, uint32_t flags, const char *filter_type) |
filter the options More... | |
int | oyOptions_Handle (const char *registration, oyOptions_s *options, const char *command, oyOptions_s **result) |
Handle a request by a module. More... | |
![]() | |
const char * | oyStruct_GetTextFromModule (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
get object infos from a module More... | |
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
Get a text dump. More... | |
int | oyStruct_RegisterStaticMessageFunc (int type, oyStruct_RegisterStaticMessageFunc_f msg, oyStruct_RegisterStaticFreeFunc_f free_func) |
register a function for verbosity More... | |
const char * | oyStruct_GetInfo (oyPointer context_object, oyNAME_e type, int flags) |
get a additional string from a object More... | |
const char * | oyStructTypeToText (oyOBJECT_e type) |
Objects type to small string. More... | |
Data Fields | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
![]() | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
generic Options
Options can be any flag or rendering intent and other informations needed to configure a process. The object contains a list of oyOption_s objects.
int oyOptions_Add | ( | oyOptions_s * | options, |
oyOption_s * | option, | ||
int | pos, | ||
oyObject_s | object | ||
) |
add a element to a Options list
Function oyOptions_Add
We must not add any already listed option. (oyFILTER_REG_TOP)
Adding a new element without any checks is as simple as following code:
[in,out] | options | options to manipulate |
[in] | option | the option to eventually add |
[in] | pos | the position where to add; use -1 for append |
[in] | object | the optional object |
int oyOptions_AppendOpts | ( | oyOptions_s * | list, |
oyOptions_s * | append | ||
) |
Basic reference options from one list into an other.
Function oyOptions_AppendOpts
References oyOptions_Count(), oyOptions_Get(), and oyOptions_MoveIn().
OYAPI int OYEXPORT oyOptions_Clear | ( | oyOptions_s * | list | ) |
clear the elements in a Options list
Function oyOptions_Clear
[in,out] | list | the list |
OYAPI oyOptions_s *OYEXPORT oyOptions_Copy | ( | oyOptions_s * | options, |
oyObject_s | object | ||
) |
Copy or Reference a Options object.
Function oyOptions_Copy
The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.
[in] | options | Options struct object |
object | NULL - means reference, the optional object triggers a real copy |
int oyOptions_Copy__Members | ( | oyOptions_s_ * | dst, |
oyOptions_s_ * | src | ||
) |
Custom Options copy constructor.
Function oyOptions_Copy__Members
int oyOptions_CopyFrom | ( | oyOptions_s ** | list, |
oyOptions_s * | from, | ||
oyBOOLEAN_e | type, | ||
oyFILTER_REG_e | fields, | ||
oyObject_s | object | ||
) |
copy from one option set to an other option set
Function oyOptions_CopyFrom
[out] | list | target |
[in] | from | source |
type | boolean operation before copy | |
fields | registration fields of each option | |
object | the optional object |
References oyBOOLEAN_UNION, and oyOptions_New().
OYAPI int OYEXPORT oyOptions_Count | ( | oyOptions_s * | list | ) |
count the elements in a Options list
Function oyOptions_Count
[in,out] | list | the list |
Referenced by oyDeviceToJSON(), oyOptions_AppendOpts(), oyOptions_GetText(), oyOptions_ObserversDisable(), oyOptions_ObserversEnable(), oyOptions_Set(), oyOptions_SetOpts(), and oyOptions_SetSource().
int oyOptions_CountType | ( | oyOptions_s * | options, |
const char * | registration, | ||
oyOBJECT_e | type | ||
) |
search for options with special attributes
Function oyOptions_CountType
int oyOptions_DoFilter | ( | oyOptions_s * | opts, |
uint32_t | flags, | ||
const char * | filter_type | ||
) |
filter the options
Function oyOptions_DoFilter
The returned options are read in from the Elektra settings and if thats not available from the inbuild defaults. The later can explicitely selected with oyOPTIONSOURCE_FILTER passed as flags argument. advanced options can be filtered out by adding oyOPTIONATTRIBUTE_ADVANCED.
Modules should handle the advanced options as well but shall normally not act upon them. The convention to set them zero, keeps them inactive.
On the front end side the CMM cache has to include them, as they will influence the hash sum generation. The question arrises, whether to include these options marked as non visible along the path or require the CMM cache code to check each time for them on cache lookup. The oyOption_s::flags is already in place. So we use it and do inclusion. Front end options can be filtered as they do not affect the CMM cache.
opts | the options | |
[in] | flags | select particular options:
|
filter_type | the type level from a registration |
int oyOptions_Filter | ( | oyOptions_s ** | add_list, |
int32_t * | count, | ||
uint32_t | flags, | ||
oyBOOLEAN_e | type, | ||
const char * | registration, | ||
oyOptions_s * | src_list | ||
) |
filter options
Function oyOptions_Filter
Each option added to the add_list is a cheaply linked one.
[out] | add_list | the options list to add to |
[out] | count | the number of matching options |
[in] | flags | for inbuild defaults | oyOPTIONSOURCE_FILTER |
[in] | type | support are oyBOOLEAN_INTERSECTION and oyBOOLEAN_DIFFERENZ |
[in] | registration | a registration which shall be matched |
[in] | src_list | the options to select from |
oyOption_s * oyOptions_Find | ( | oyOptions_s * | options, |
const char * | registration, | ||
uint32_t | type | ||
) |
search for a certain option key
Function oyOptions_Find
This function returns the first found option for a given key. The key is represented by a registrations option level.
options | set of options |
registration | registration or key |
type | allowed are:
|
Referenced by oyOptions_FromJSON().
int oyOptions_FindData | ( | oyOptions_s * | options, |
const char * | registration, | ||
oyPointer * | result, | ||
size_t * | size, | ||
oyAlloc_f | allocateFunc | ||
) |
get a value
Function oyOptions_FindData
options | the options list or set to manipulate | |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" or simply a key, e.g. "my_opt" | |
[out] | result | the data; With size == zero, the pointer is static and owned somewhere else. With size set, the pointer is owned my
|
[out] | size | the data size |
[in] | allocateFunc | user allocator |
int oyOptions_FindDouble | ( | oyOptions_s * | options, |
const char * | registration, | ||
int | pos, | ||
double * | result | ||
) |
get a value
Function oyOptions_FindDouble
options | the options list or set to manipulate |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" or simple key, e.g. "my_opt" |
result | the double |
pos | the value position |
int oyOptions_FindInt | ( | oyOptions_s * | options, |
const char * | registration, | ||
int | pos, | ||
int32_t * | result | ||
) |
get a value
Function oyOptions_FindInt
options | the options list or set to manipulate |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" or simple key, e.g. "my_opt" |
pos | the values position in a possible list |
result | the integer |
const char * oyOptions_FindString | ( | oyOptions_s * | options, |
const char * | registration, | ||
const char * | value | ||
) |
search for a certain option key and possibly value
Function oyOptions_FindString
This function returns the first found value for a given key. The key is represented by the oyOption_s::name::nick The returned string is valid along the livetime of the particular option value.
Referenced by oyConfig_s::oyConfig_FromJSON(), oyDeviceToJSON(), oyObject_GetName(), oyOptions_FromJSON(), oyProfile_s::oyProfile_AddDevice(), oyConfig_s::oyRankMapList(), and oyConfig_s::oyRankMapToJSON().
oyOptions_s * oyOptions_ForFilter | ( | const char * | registration, |
uint32_t | flags, | ||
oyObject_s | object | ||
) |
provide Oyranos behaviour settings
Function oyOptions_ForFilter
The returned options are read in from the Elektra settings and if thats not available from the inbuild defaults. The later can explicitely selected with oyOPTIONSOURCE_FILTER passed as flags argument. The key names map to the registration and XML syntax.
To obtain all advanced front end options from a meta module use:
[in] | registration | the filter registration to search for |
[in] | flags | select particular options:
|
object | the optional object |
oyOptions_s * oyOptions_ForFilter_ | ( | oyFilterCore_s_ * | core, |
oyFilterNode_s_ * | node, | ||
uint32_t | flags, | ||
oyObject_s | object | ||
) |
Provide Oyranos behaviour settings.
Function oyOptions_ForFilter_
oyOptions_s * oyOptions_FromBoolean | ( | oyOptions_s * | set_a, |
oyOptions_s * | set_b, | ||
oyBOOLEAN_e | type, | ||
oyObject_s | object | ||
) |
boolean operations on two sets of options
Function oyOptions_FromBoolean
[in] | set_a | options set A |
[in] | set_b | options set B |
[in] | type | the operation to perform; oyBOOLEAN_UNION is supported |
object | the optional object |
int oyOptions_FromJSON | ( | const char * | json_text, |
oyOptions_s * | options, | ||
oyOptions_s ** | result, | ||
const char * | xformat, | ||
... | |||
) |
deserialise a text file to oyOptions_s data
Function oyOptions_FromJSON
This function is based on oyjl. Arrays are ignored except the index is specified in the xpath with the xformat + ... arguments. The xpath is build from xformat + optional following printf style arguments.
The following code sample comes from tutorial_json_options.c. The "key_path" options is here set to demonstrate path substitution:
[in] | json_text | the text to process |
[in] | options | optional
|
[out] | result | the result; A existing object will be merged. |
[in] | xformat | the xpath format string |
[in] | ... | variable argument list for xpath |
References oyNAME_PATTERN, oyOptions_Find(), and oyOptions_FindString().
oyOptions_s * oyOptions_FromText | ( | const char * | text, |
uint32_t flags | OY_UNUSED, | ||
oyObject_s | object | ||
) |
deserialise a text file to oyOptions_s data
Function oyOptions_FromText
This function is based on libxml2.
[in] | text | the text to process |
[in] | flags | for future use |
object | the optional object |
OYAPI oyOption_s *OYEXPORT oyOptions_Get | ( | oyOptions_s * | list, |
int | pos | ||
) |
get a element of a Options list
Function oyOptions_Get
[in,out] | list | the list |
pos | position |
Referenced by oyDeviceToJSON(), oyOptions_AppendOpts(), oyOptions_ObserversDisable(), oyOptions_ObserversEnable(), oyOptions_Set(), oyOptions_SetOpts(), and oyOptions_SetSource().
const char * oyOptions_GetText | ( | oyOptions_s * | options, |
oyNAME_e | type | ||
) |
dump options to text
The type argument should select the following string in return:
[in,out] | options | the option |
type | oyNAME_NICK is equal to an ID |
References oyjlTreeNew(), oyNAME_JSON, and oyOptions_Count().
Referenced by oyFormsArgs_s::oyFormsArgs_ModelGet().
oyStruct_s * oyOptions_GetType | ( | oyOptions_s * | options, |
int | pos, | ||
const char * | pattern, | ||
oyOBJECT_e | type | ||
) |
select from options with special attribute
Function oyOptions_GetType
References oyNAME_PATTERN, and oyOptions_GetType2().
int oyOptions_GetType2 | ( | oyOptions_s * | options, |
int | pos, | ||
const char * | pattern, | ||
uint32_t | pattern_type, | ||
oyOBJECT_e | object_type, | ||
oyStruct_s ** | result, | ||
oyOption_s ** | option | ||
) |
select from options with special attributes
Function oyOptions_GetType2
[in] | options | the options to scan |
[in] | pos | the position if the result appears multiple times |
[in] | pattern | the registration pattern to search for; optional |
[in] | pattern_type | supported types of registration matching:
|
[in] | object_type | the acceptable object type or oyOBJECT_NONE |
[out] | result | the found object; optional |
[out] | option | the belonging option; optional |
Referenced by oyOptions_GetType().
int oyOptions_Handle | ( | const char * | registration, |
oyOptions_s * | options, | ||
const char * | command, | ||
oyOptions_s ** | result | ||
) |
Handle a request by a module.
[in] | registration | the module selector |
[in] | options | options |
[in] | command | the command to handle |
[out] | result | options to the policy module |
int oyOptions_Init__Members | ( | oyOptions_s_ *options | OY_UNUSED | ) |
Custom Options constructor.
Function oyOptions_Init__Members
OYAPI int OYEXPORT oyOptions_MoveIn | ( | oyOptions_s * | list, |
oyOption_s ** | obj, | ||
int | pos | ||
) |
add an element to a Options list
Function oyOptions_MoveIn
[in] | list | list |
[in,out] | obj | list element |
pos | position |
Referenced by oyOptions_AppendOpts().
int oyOptions_MoveInStruct | ( | oyOptions_s ** | obj, |
const char * | registration, | ||
oyStruct_s ** | oy_struct, | ||
uint32_t | flags | ||
) |
change a value
[in,out] | obj | the options list or set to manipulate |
[in] | registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" |
[in] | oy_struct | the Oyranos style object to move in |
[in] | flags | can be OY_CREATE_NEW for a new option, OY_ADD_ALWAYS, OY_MATCH_KEY |
Add a new option if the OY_CREATE_NEW flag is present.
OYAPI oyOptions_s *OYEXPORT oyOptions_New | ( | oyObject_s | object | ) |
OYAPI int OYEXPORT oyOptions_ObserverAdd | ( | oyOptions_s * | object, |
oyStruct_s * | observer, | ||
oyStruct_s * | user_data, | ||
oyObserver_Signal_f | signalFunc | ||
) |
observe options and its elements
Function oyOptions_ObserverAdd
[in] | object | the options |
[in] | observer | the in observation intereressted object |
[in] | user_data | additional static informations |
[in] | signalFunc | the signal handler |
References oyStructList_s::oyStructList_ObserverAdd().
OYAPI int OYEXPORT oyOptions_ObserversDisable | ( | oyOptions_s * | object | ) |
disable signaling
Function oyOptions_ObserversDisable
[in] | object | the options |
References oyOption_s::oyOption_Release(), oyOptions_Count(), oyOptions_Get(), and oyObserver_s::oyStruct_DisableSignalSend().
OYAPI int OYEXPORT oyOptions_ObserversEnable | ( | oyOptions_s * | object | ) |
disable signaling
Function oyOptions_ObserversEnable
[in] | object | the options |
References oyOption_s::oyOption_Release(), oyOptions_Count(), oyOptions_Get(), and oyObserver_s::oyStruct_EnableSignalSend().
OYAPI int OYEXPORT oyOptions_Release | ( | oyOptions_s ** | options | ) |
release and possibly deallocate a oyOptions_s object
Function oyOptions_Release
[in,out] | options | Options struct object |
Referenced by oyPixelAccess_s::oyPixelAccess_SetFromString().
void oyOptions_Release__Members | ( | oyOptions_s_ * | options | ) |
Custom Options destructor.
Function oyOptions_Release__Members
OYAPI int OYEXPORT oyOptions_ReleaseAt | ( | oyOptions_s * | list, |
int | pos | ||
) |
release a element from a Options list
Function oyOptions_ReleaseAt
[in,out] | list | the list |
pos | position |
OYAPI int OYEXPORT oyOptions_SaveToDB | ( | oyOptions_s * | options, |
oySCOPE_e | scope, | ||
const char * | registration, | ||
char ** | new_reg, | ||
oyAlloc_f | allocateFunc | ||
) |
store a oyOptions_s in DB
Function oyOptions_SaveToDB
[in] | options | the options |
scope | oySCOPE_USER and oySCOPE_SYS are possible | |
[in] | registration | the registration |
[out] | new_reg | the new registration; optional |
[in] | allocateFunc | the user allocator for new_reg; optional |
int oyOptions_Set | ( | oyOptions_s * | options, |
oyOption_s * | option, | ||
int | pos, | ||
oyObject_s | object | ||
) |
set a element in a Options list
Function oyOptions_Set
Already listed options are replaced by the new option. A option new to the existing set will be referenced if no object argument is given.
Adding a new element without any checks is as simple as following code:
References oyFilterRegistrationMatchKey(), oyOptions_Count(), and oyOptions_Get().
Referenced by oyOptions_SetOpts().
OYAPI int OYEXPORT oyOptions_SetDriverContext | ( | oyOptions_s ** | options, |
oyPointer | driver_context, | ||
const char * | driver_context_type, | ||
size_t | driver_context_size, | ||
oyObject_s | object | ||
) |
set a device option from a given external context
Function oyOptions_SetDriverContext
The options will be created in case they do not exist. The driver_context_type accepts "xml". The data in driver_context will be converted to a options set following the Oyranos options XML schemes with the help oyOptions_FromText(). Any other pointer will be converted to a oyBlob_s object. The name of that object will come from driver_context_type.
[in,out] | options | options for the device |
[in] | driver_context | driver context |
[in] | driver_context_type | "xml" or something related to the driver |
[in] | driver_context_size | size of driver_context |
[in] | object | a optional object |
int oyOptions_SetFromData | ( | oyOptions_s ** | options, |
const char * | registration, | ||
oyPointer | ptr, | ||
size_t | size, | ||
uint32_t | flags | ||
) |
set a data blob or plain pointer
Function oyOptions_SetFromData
options | the options list or set to manipulate |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" |
ptr | the pointer |
size | the pointer size |
flags | can be OY_CREATE_NEW for a new option, OY_ADD_ALWAYS, OY_MATCH_KEY |
Add a new option if the OY_CREATE_NEW flag is present.
int oyOptions_SetFromDouble | ( | oyOptions_s ** | obj, |
const char * | registration, | ||
double | value, | ||
int | pos, | ||
uint32_t | flags | ||
) |
change a value
Function oyOptions_SetFromDouble
obj | the options list or set to manipulate |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" |
value | the value to set |
pos | the position in a value list |
flags | can be OY_CREATE_NEW for a new option, OY_ADD_ALWAYS, OY_MATCH_KEY |
Add a new option if the OY_CREATE_NEW flag is present.
int oyOptions_SetFromInt | ( | oyOptions_s ** | obj, |
const char * | registration, | ||
int32_t | value, | ||
int | pos, | ||
uint32_t | flags | ||
) |
change a value
Function oyOptions_SetFromInt
obj | the options list or set to manipulate |
registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" |
value | the value to set |
pos | the position in a value list |
flags | can be OY_CREATE_NEW for a new option, OY_MATCH_KEY, OY_ADD_ALWAYS |
Add a new option if the OY_CREATE_NEW flag is present.
int oyOptions_SetFromString | ( | oyOptions_s ** | obj, |
const char * | registration, | ||
const char * | value, | ||
uint32_t | flags | ||
) |
change a value
[in,out] | obj | the options list or set to manipulate |
[in] | registration | the options registration name, e.g. "org/my_org/openicc/my_app/my_opt" |
[in] | value | the value to set |
[in] | flags | can be OY_CREATE_NEW for a new option, OY_STRING_LIST, OY_ADD_ALWAYS, OY_MATCH_KEY |
Add a new option if the OY_CREATE_NEW flag is present.
Flags are passed on to oyOption_SetFromString, e.g. OY_STRING_LIST.
Referenced by oyPixelAccess_s::oyPixelAccess_SetFromString().
int oyOptions_SetOpts | ( | oyOptions_s * | list, |
oyOptions_s * | add | ||
) |
set options in a Options list
Function oyOptions_SetOpts
Already listed options are replaced by the new options.
References oy_, oyOption_s::oyOption_Release(), oyOptions_Count(), oyOptions_Get(), and oyOptions_Set().
int oyOptions_SetSource | ( | oyOptions_s * | options, |
oyOPTIONSOURCE_e | source | ||
) |
set source attribute
Function oyOptions_SetSource
options | the options list or set to manipulate |
source | the options new source attribute |
References oyOBJECT_OPTIONS_S, oyOptions_Count(), oyOptions_Get(), and type_.
OYAPI int OYEXPORT oyOptions_Sort | ( | oyOptions_s * | list, |
int32_t * | rank_list | ||
) |
sort a list according to a rank_list
Function oyOptions_Sort
oyStruct_Copy_f oyOptions_s::copy |
Copy function.
oyObject_s oyOptions_s::oy_ |
Oyranos internal object.
Features name and hash. Do not change during object life time.
Referenced by oyOptions_SetOpts().
oyStruct_Release_f oyOptions_s::release |
Release function.
const oyOBJECT_e oyOptions_s::type_ |
Type of object.
The struct type tells Oyranos how to interprete hidden fields.
Referenced by oyOptions_SetSource().