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

results-dd.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_RESULTS_DEVICE_DETECTION_INCLUDED
24#define FIFTYONE_DEGREES_RESULTS_DEVICE_DETECTION_INCLUDED
25
39
40#include "../common/array.h"
41#include "../common/results.h"
42#include "../common/overrides.h"
43#include "dataset-dd.h"
44
49typedef struct fiftyone_degrees_result_user_agent_t {
62 const char *targetUserAgent;
67
73typedef struct fiftyone_degrees_results_device_detection_t {
87
99 uint32_t overridesCapacity);
100
109
120
131
139
143
144#endif
void fiftyoneDegreesResultsDeviceDetectionInit(fiftyoneDegreesResultsDeviceDetection *results, fiftyoneDegreesDataSetDeviceDetection *dataSet, uint32_t overridesCapacity)
Initialise a set of results by setting the data set they are associated with.
void fiftyoneDegreesResultsUserAgentFree(fiftyoneDegreesResultUserAgent *result)
Free the memory allocated in a single result,.
void fiftyoneDegreesResultsUserAgentInit(const fiftyoneDegreesConfigDeviceDetection *config, fiftyoneDegreesResultUserAgent *result)
Initialise a single result using the configuration provided.
void fiftyoneDegreesResultsDeviceDetectionFree(fiftyoneDegreesResultsDeviceDetection *results)
Free any extra data within the results.
void fiftyoneDegreesResultsUserAgentReset(const fiftyoneDegreesConfigDeviceDetection *config, fiftyoneDegreesResultUserAgent *result)
Reset the matched and target User-Agents in the result.
Device detection configuration structure containing device detection specific configuration options,...
Definition config-dd.h:52
Device detection data set structure which contains the 'must have's for all device detection data set...
Definition dataset-dd.h:52
Singular User-Agent result returned by a device detection process method.
Definition results-dd.h:49
int uniqueHttpHeaderIndex
Index in the headers collection of the data set to the HTTP header fieldi.e.
Definition results-dd.h:50
size_t matchedUserAgentLength
Number of characters in the matched User-Agent.
Definition results-dd.h:60
size_t targetUserAgentLength
Number of characters in the target User-Agent.
Definition results-dd.h:64
char * matchedUserAgent
Pointer to the matched User-Agent if requested by setting the updateMatchedUserAgent config option to...
Definition results-dd.h:52
const char * targetUserAgent
Pointer to the string containing the User-Agent for processing.
Definition results-dd.h:62
Base results structure which any processing results should extend.
Definition results.h:158
Device detection specific results structure which any device detection processing results should exte...
Definition results-dd.h:73
char * bufferTransform
Working memory used to transform evidence.
Definition results-dd.h:84
int bufferTransformLength
Number of bytes in bufferTransform.
Definition results-dd.h:85
fiftyoneDegreesResultsBase b
Base results, which hold the override values.
Definition results-dd.h:74
int bufferPseudoLength
Number of bytes in bufferPseudo, being the maxMatchedUserAgentLength configuration value plus one for...
Definition results-dd.h:80
char * bufferPseudo
Working memory used for pseudo headers, allocated when the results are created and not grown during d...
Definition results-dd.h:76