summaryrefslogtreecommitdiffstats
path: root/addons/51degrees/dummy/trie/51Degrees.c
blob: 7453061bed8ec1b636eddd8b54edc0daa0500977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* *********************************************************************
 * This Source Code Form is copyright of 51Degrees Mobile Experts Limited.
 * Copyright 2019 51Degrees Mobile Experts Limited, 5 Charlotte Close,
 * Caversham, Reading, Berkshire, United Kingdom RG4 7BY
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain
 * one at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as
 * defined by the Mozilla Public License, v. 2.0.
 * *********************************************************************/

/* *********************************************************************
 * Dummy library for HAProxy. This does not function, and is designed
 * solely for HAProxy testing purposes.
 * *********************************************************************/
#include "51Degrees.h"
#include <stdlib.h>

int fiftyoneDegreesGetDeviceOffset(
	fiftyoneDegreesDataSet *dataSet,
	const char *userAgent) {
    return 0;
}

const char** fiftyoneDegreesGetRequiredPropertiesNames(
	fiftyoneDegreesDataSet *dataSet) {
    return NULL;
}

int fiftyoneDegreesGetRequiredPropertiesCount(
	fiftyoneDegreesDataSet *dataSet) {
    return 0;
}

int fiftyoneDegreesGetValueFromOffsets(
	fiftyoneDegreesDataSet *dataSet,
	fiftyoneDegreesDeviceOffsets* deviceOffsets,
	int requiredPropertyIndex,
	char* values,
	int size) {
    return 0;
}

static fiftyoneDegreesDeviceOffset dummyOffset = { 0, 0, "dummy-user-agent" };

static fiftyoneDegreesDeviceOffsets dummyOffsets = { 1, &dummyOffset, NULL };

fiftyoneDegreesDeviceOffsets* fiftyoneDegreesCreateDeviceOffsets(
	fiftyoneDegreesDataSet *dataSet) {
    return &dummyOffsets;
}

void fiftyoneDegreesFreeDeviceOffsets(
	fiftyoneDegreesDeviceOffsets* offsets) {
    return;
}

int fiftyoneDegreesGetHttpHeaderCount(
	fiftyoneDegreesDataSet *dataSet) {
    return 0;
}

int fiftyoneDegreesGetHttpHeaderNameOffset(
	fiftyoneDegreesDataSet *dataSet,
	int httpHeaderIndex) {
    return 0;
}

const char* fiftyoneDegreesGetHttpHeaderNamePointer(
	fiftyoneDegreesDataSet *dataSet,
	int httpHeaderIndex) {
    return "dummy-header-name";
}

fiftyoneDegreesDataSetInitStatus fiftyoneDegreesInitWithPropertyArray(
	const char* fileName,
	fiftyoneDegreesDataSet *dataSet,
	const char** properties,
	int propertyCount) {
    return DATA_SET_INIT_STATUS_SUCCESS;
}

void fiftyoneDegreesDataSetFree(fiftyoneDegreesDataSet *dataSet) {
    return;
}