A device detection library that is used natively or by 51Degrees products

overrides.h

1/* *********************************************************************
2 * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3 * Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
4 * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5 *
6 * This Original Work is licensed under the European Union Public Licence
7 * (EUPL) v.1.2 and is subject to its terms as set out below.
8 *
9 * If a copy of the EUPL was not distributed with this file, You can obtain
10 * one at https://opensource.org/licenses/EUPL-1.2.
11 *
12 * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13 * amended by the European Commission) shall be deemed incompatible for
14 * the purposes of the Work and the provisions of the compatibility
15 * clause in Article 5 of the EUPL shall not apply.
16 *
17 * If using the Work as, or as part of, a network application, by
18 * including the attribution notice(s) required under Article 5 of the EUPL
19 * in the end user terms of the application under an appropriate heading,
20 * such notice(s) shall fulfill the requirements of that article.
21 * ********************************************************************* */
22
23#ifndef FIFTYONE_DEGREES_OVERRIDES_INCLUDED
24#define FIFTYONE_DEGREES_OVERRIDES_INCLUDED
25
26#ifdef FIFTYONE_DEGREES_IPI_SYMBOLS
27#include "ipiSymbols.h"
28#endif
29
73
74#include <stdint.h>
75#include <stdbool.h>
76#include "data.h"
77#include "string.h"
78#include "collection.h"
79#include "properties.h"
80#include "evidence.h"
81#include "array.h"
82#include "status.h"
83#include "common.h"
84
88typedef struct fiftyone_degrees_override_property_t {
93
98typedef struct fiftyone_degrees_override_value_t {
103
106 bool prefix;
108);
109
123);
124
130
138 void *state,
139 uint32_t profileId);
140
150 void *state,
151 uint32_t requiredPropertyIndex);
152
163 uint32_t capacity);
164
178 bool prefix,
179 void *state,
181
188
203
216 uint32_t requiredPropertyIndex);
217
227 uint32_t requiredPropertyIndex,
228 fiftyoneDegreesList *list);
229
245 int requiredPropertyIndex,
246 const char *value);
247
258 uint32_t requiredPropertyIndex,
260
272 uint32_t requiredPropertyIndex);
273
280
290
300 void *state,
302
306
307#endif
#define FIFTYONE_DEGREES_ARRAY_TYPE(t, m)
Simple array structure definition macro used for generic types.
Definition array.h:55
bool fiftyoneDegreesOverrideHasValueForRequiredPropertyIndex(fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex)
Gets whether or not the override values contain an override relating to the property identified by th...
fiftyoneDegreesOverridePropertyArray * fiftyoneDegreesOverridePropertiesCreate(fiftyoneDegreesPropertiesAvailable *available, bool prefix, void *state, fiftyoneDegreesOverridesFilterMethod filter)
Returns a list of the evidence keys that are available to support overriding property values.
uint32_t fiftyoneDegreesOverrideValuesAdd(fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex, fiftyoneDegreesList *list)
Adds values from the overrides data structure into the results.
bool(* fiftyoneDegreesOverridesFilterMethod)(void *state, uint32_t requiredPropertyIndex)
Determines if the required property index is eligible for overriding considering the configuration of...
Definition overrides.h:149
fiftyoneDegreesOverrideValueArray * fiftyoneDegreesOverrideValuesCreate(uint32_t capacity)
Creates a fresh array of override values with the given capacity.
fiftyoneDegreesString * fiftyoneDegreesOverrideValuesGetFirst(fiftyoneDegreesOverrideValueArray *values, uint32_t requiredPropertyIndex, fiftyoneDegreesCollectionItem *item)
Returns the first value for the required property index or NULL of no value exists for the property i...
void(* fiftyoneDegreesOverrideProfileIdMethod)(void *state, uint32_t profileId)
Called when a profile Id has been found and should override the one found from another source such as...
Definition overrides.h:137
void fiftyoneDegreesOverrideValuesFree(fiftyoneDegreesOverrideValueArray *values)
Frees the memory used for the override values.
uint32_t fiftyoneDegreesOverridesExtractFromEvidence(fiftyoneDegreesOverridePropertyArray *properties, fiftyoneDegreesOverrideValueArray *values, fiftyoneDegreesEvidenceKeyValuePairArray *evidence)
Extracts override values from evidence.
int fiftyoneDegreesOverridesGetOverridingRequiredPropertyIndex(fiftyoneDegreesPropertiesAvailable *available, uint32_t requiredPropertyIndex)
Gets the required property index of a property that MIGHT provide logic such as JavaScript or Regular...
void fiftyoneDegreesOverridePropertiesFree(fiftyoneDegreesOverridePropertyArray *properties)
Frees the resources used by the override properties.
bool fiftyoneDegreesOverridesAdd(fiftyoneDegreesOverrideValueArray *values, int requiredPropertyIndex, const char *value)
Add a value override to the override values array.
void fiftyoneDegreesOverrideValuesReset(fiftyoneDegreesOverrideValueArray *values)
Reset override array.
fiftyoneDegreesOverridePropertyArray fiftyoneDegreesOverridable
Array of overridable properties.
Definition overrides.h:129
void fiftyoneDegreesOverrideProfileIds(fiftyoneDegreesEvidenceKeyValuePairArray *evidence, void *state, fiftyoneDegreesOverrideProfileIdMethod callback)
Extracts the profile overrides from the evidence and overrides them using the override method supplie...
fiftyoneDegreesPropertyAvailableArray fiftyoneDegreesPropertiesAvailable
Array of properties which are available in a data set.
Definition properties.h:223
fiftyoneDegreesStatusCode
Status returned from the initialisation of a resource.
Definition status.h:81
Definition GettingStarted.c:67
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition collection.h:315
Data structure used for reusing memory which may have been allocated in a previous operation.
Definition data.h:105
Array of evidence key value pairs and a pointer to the next array if present or NULL of not present.
Definition evidence.h:195
List structure which contains a list of collection items.
Definition list.h:116
Array of items of type fiftyoneDegreesOverrideProperty used to easily access and track the size of th...
Definition overrides.h:107
Index and pointer to a property which can be overridden.
Definition overrides.h:88
fiftyoneDegreesPropertyAvailable * available
Pointer to the property.
Definition overrides.h:91
uint32_t requiredPropertyIndex
Index in the available properties structure.
Definition overrides.h:89
An array of properties and values to use when getting override values.
Definition overrides.h:119
String value which should override the value for the property indicated by the required property inde...
Definition overrides.h:98
uint32_t requiredPropertyIndex
Index in the available properties structure.
Definition overrides.h:99
fiftyoneDegreesData string
Overridden value.
Definition overrides.h:101
Used to access the property item quickly without the need to search.
Definition properties.h:171
Definition string.h:97