\r\n

51Degrees Device Detection C/C++  4.5

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

indices.h

1 /* *********************************************************************
2  * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2023 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_INDICES_H_INCLUDED
24 #define FIFTYONE_DEGREES_INDICES_H_INCLUDED
25 
87 #include <stdint.h>
88 #ifdef _MSC_VER
89 #pragma warning (push)
90 #pragma warning (disable: 5105)
91 #include <windows.h>
92 #pragma warning (default: 5105)
93 #pragma warning (pop)
94 #endif
95 #include "array.h"
96 #include "data.h"
97 #include "exceptions.h"
98 #include "collection.h"
99 #include "property.h"
100 #include "properties.h"
101 #include "common.h"
102 
109 typedef struct fiftyone_degrees_index_property_profile{
110  uint32_t* valueIndexes; // array of value indexes
111  uint32_t availablePropertyCount; // number of available properties
112  uint32_t minProfileId; // minimum profile id
113  uint32_t maxProfileId; // maximum profile id
114  uint32_t profileCount; // total number of profiles
115  uint32_t size; // number elements in the valueIndexes array
116  uint32_t filled; // number of elements with values
118 
133  fiftyoneDegreesCollection* profiles,
134  fiftyoneDegreesCollection* profileOffsets,
137  fiftyoneDegreesException* exception);
138 
146 
163  uint32_t profileId,
164  uint32_t availablePropertyIndex);
165 
170 #endif
fiftyoneDegreesIndicesPropertyProfile * fiftyoneDegreesIndicesPropertyProfileCreate(fiftyoneDegreesCollection *profiles, fiftyoneDegreesCollection *profileOffsets, fiftyoneDegreesPropertiesAvailable *available, fiftyoneDegreesCollection *values, fiftyoneDegreesException *exception)
Create an index for the profiles, available properties, and values provided such that given the index...
void fiftyoneDegreesIndicesPropertyProfileFree(fiftyoneDegreesIndicesPropertyProfile *index)
Frees an index previously created by fiftyoneDegreesIndicesPropertyProfileCreate.
Array of items of type fiftyoneDegreesPropertyAvailable used to easily access and track the size of t...
Definition: properties.h:165
Maps the profile index and the property index to the first value index of the profile for the propert...
Definition: indices.h:109
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:111
uint32_t fiftyoneDegreesIndicesPropertyProfileLookup(fiftyoneDegreesIndicesPropertyProfile *index, uint32_t profileId, uint32_t availablePropertyIndex)
For a given profile id and available property index returns the first value index,...
All the shared methods and fields required by file, memory and cached collections.
Definition: collection.h:402