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

transform.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_TRANSFORM_H_INCLUDED
24#define FIFTYONE_DEGREES_TRANSFORM_H_INCLUDED
25
26#include <stdbool.h>
27#include "../common/pair.h"
28#include "../common/exceptions.h"
29
73
79typedef struct fiftyone_degrees_transform_iterate_result {
84 uint32_t iterations;
85
89 size_t written;
90
97
110EXTERNAL typedef bool (*fiftyoneDegreesTransformCallback)
111(void *state, fiftyoneDegreesKeyValuePair header);
112
144fiftyoneDegreesTransformIterateGhevFromJson
145(const char *json, char *const buffer, size_t length,
146 fiftyoneDegreesTransformCallback callback, void *state,
147 fiftyoneDegreesException *const exception);
148
181fiftyoneDegreesTransformIterateGhevFromBase64
182(const char *base64, char *buffer, size_t length,
183 fiftyoneDegreesTransformCallback callback, void *state,
184 fiftyoneDegreesException *const exception);
185
216fiftyoneDegreesTransformIterateSua
217(const char *json, char *buffer, size_t length,
218 fiftyoneDegreesTransformCallback callback, void *state,
219 fiftyoneDegreesException *const exception);
220
257fiftyoneDegreesTransformGhevFromJson
258(const char *json, char *buffer, size_t length,
260 fiftyoneDegreesException *const exception);
261
299fiftyoneDegreesTransformGhevFromBase64
300(const char *base64, char *buffer, size_t length,
302 fiftyoneDegreesException *const exception);
303
339fiftyoneDegreesTransformSua
340(const char *json, char *buffer, size_t length,
342 fiftyoneDegreesException *const exception);
343
344#endif /* FIFTYONE_DEGREES_TRANSFORM_H_INCLUDED */
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition exceptions.h:115
Array of items of type fiftyoneDegreesKeyValuePair used to easily access and track the size of the ar...
Definition pair.h:40
Definition pair.h:33
User-Agent Client Hints (UACH) Representation Conversion Routines.
Definition transform.h:79
uint32_t iterations
number of pairs of evidence extracted or would have been extracted and correspondingly calls to the c...
Definition transform.h:84
size_t written
number of characters written or that would have been written to the buffer, reflects required buffer ...
Definition transform.h:89
bool bufferTooSmall
the caller should check this flag and reallocate the buffer to be of at least written size if this fl...
Definition transform.h:95