Ben51Degrees | 31c3d51 | 2019-06-12 15:42:53 +0100 | [diff] [blame] | 1 | /* ********************************************************************* |
| 2 | * This Source Code Form is copyright of 51Degrees Mobile Experts Limited. |
| 3 | * Copyright 2019 51Degrees Mobile Experts Limited, 5 Charlotte Close, |
| 4 | * Caversham, Reading, Berkshire, United Kingdom RG4 7BY |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 7 | * License, v. 2.0. |
| 8 | * |
| 9 | * If a copy of the MPL was not distributed with this file, You can obtain |
| 10 | * one at http://mozilla.org/MPL/2.0/. |
| 11 | * |
| 12 | * This Source Code Form is "Incompatible With Secondary Licenses", as |
| 13 | * defined by the Mozilla Public License, v. 2.0. |
| 14 | * *********************************************************************/ |
| 15 | |
| 16 | /* ********************************************************************* |
| 17 | * Dummy library for HAProxy. This does not function, and is designed |
| 18 | * solely for HAProxy testing purposes. |
| 19 | * *********************************************************************/ |
| 20 | #include "51Degrees.h" |
| 21 | #include <stdlib.h> |
| 22 | |
| 23 | int fiftyoneDegreesGetDeviceOffset( |
| 24 | fiftyoneDegreesDataSet *dataSet, |
| 25 | const char *userAgent) { |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | const char** fiftyoneDegreesGetRequiredPropertiesNames( |
| 30 | fiftyoneDegreesDataSet *dataSet) { |
| 31 | return NULL; |
| 32 | } |
| 33 | |
| 34 | int fiftyoneDegreesGetRequiredPropertiesCount( |
| 35 | fiftyoneDegreesDataSet *dataSet) { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | int fiftyoneDegreesGetValueFromOffsets( |
| 40 | fiftyoneDegreesDataSet *dataSet, |
| 41 | fiftyoneDegreesDeviceOffsets* deviceOffsets, |
| 42 | int requiredPropertyIndex, |
| 43 | char* values, |
| 44 | int size) { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static fiftyoneDegreesDeviceOffset dummyOffset = { 0, 0, "dummy-user-agent" }; |
| 49 | |
| 50 | static fiftyoneDegreesDeviceOffsets dummyOffsets = { 1, &dummyOffset, NULL }; |
| 51 | |
| 52 | fiftyoneDegreesDeviceOffsets* fiftyoneDegreesCreateDeviceOffsets( |
| 53 | fiftyoneDegreesDataSet *dataSet) { |
| 54 | return &dummyOffsets; |
| 55 | } |
| 56 | |
| 57 | void fiftyoneDegreesFreeDeviceOffsets( |
| 58 | fiftyoneDegreesDeviceOffsets* offsets) { |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | int fiftyoneDegreesGetHttpHeaderCount( |
| 63 | fiftyoneDegreesDataSet *dataSet) { |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | int fiftyoneDegreesGetHttpHeaderNameOffset( |
| 68 | fiftyoneDegreesDataSet *dataSet, |
| 69 | int httpHeaderIndex) { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | const char* fiftyoneDegreesGetHttpHeaderNamePointer( |
| 74 | fiftyoneDegreesDataSet *dataSet, |
| 75 | int httpHeaderIndex) { |
| 76 | return "dummy-header-name"; |
| 77 | } |
| 78 | |
| 79 | fiftyoneDegreesDataSetInitStatus fiftyoneDegreesInitWithPropertyArray( |
| 80 | const char* fileName, |
| 81 | fiftyoneDegreesDataSet *dataSet, |
| 82 | const char** properties, |
| 83 | int propertyCount) { |
| 84 | return DATA_SET_INIT_STATUS_SUCCESS; |
| 85 | } |
| 86 | |
| 87 | void fiftyoneDegreesDataSetFree(fiftyoneDegreesDataSet *dataSet) { |
| 88 | return; |
| 89 | } |