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 | int32_t fiftyoneDegreesGetSignatureRank(fiftyoneDegreesWorkset *ws) { |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | const char* fiftyoneDegreesGetPropertyName( |
| 28 | const fiftyoneDegreesDataSet *dataSet, |
| 29 | const fiftyoneDegreesProperty *property) { |
| 30 | return "dummy-property"; |
| 31 | } |
| 32 | |
| 33 | int32_t fiftyoneDegreesSetValues( |
| 34 | fiftyoneDegreesWorkset *ws, |
| 35 | int32_t requiredPropertyIndex) { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | const char* fiftyoneDegreesGetValueName( |
| 40 | const fiftyoneDegreesDataSet *dataSet, |
| 41 | const fiftyoneDegreesValue *value) { |
| 42 | return "dummy-value"; |
| 43 | } |
| 44 | |
| 45 | static fiftyoneDegreesDataSet dummyDataSet = { |
| 46 | 0, |
| 47 | (fiftyoneDegreesHttpHeader*)NULL, |
| 48 | 0, |
| 49 | (const fiftyoneDegreesProperty**)NULL |
| 50 | }; |
| 51 | |
| 52 | static fiftyoneDegreesWorkset dummyWorkset = { |
| 53 | &dummyDataSet, |
| 54 | 0, |
| 55 | (fiftyoneDegreesHttpHeaderWorkset*)NULL, |
| 56 | EXACT, |
| 57 | 0, |
| 58 | (const fiftyoneDegreesValue **)NULL |
| 59 | }; |
| 60 | |
| 61 | fiftyoneDegreesWorkset *fiftyoneDegreesWorksetPoolGet( |
| 62 | fiftyoneDegreesWorksetPool *pool) { |
| 63 | return &dummyWorkset; |
| 64 | } |
| 65 | |
| 66 | void fiftyoneDegreesWorksetPoolRelease( |
| 67 | fiftyoneDegreesWorksetPool *pool, |
| 68 | fiftyoneDegreesWorkset *ws) { |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | void fiftyoneDegreesMatchForHttpHeaders(fiftyoneDegreesWorkset *ws) { |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | void fiftyoneDegreesMatch( |
| 77 | fiftyoneDegreesWorkset *ws, |
| 78 | const char* userAgent) { |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | fiftyoneDegreesDataSetInitStatus fiftyoneDegreesInitWithPropertyArray( |
| 83 | const char *fileName, |
| 84 | fiftyoneDegreesDataSet *dataSet, |
| 85 | const char** properties, |
| 86 | int32_t count) { |
| 87 | return DATA_SET_INIT_STATUS_SUCCESS; |
| 88 | } |
| 89 | |
| 90 | static fiftyoneDegreesWorksetPool dummyWorksetPool; |
| 91 | |
| 92 | fiftyoneDegreesWorksetPool *fiftyoneDegreesWorksetPoolCreate( |
| 93 | fiftyoneDegreesDataSet *dataSet, |
| 94 | fiftyoneDegreesResultsetCache *cache, |
| 95 | int32_t size) { |
| 96 | return &dummyWorksetPool; |
| 97 | } |
| 98 | |
| 99 | void fiftyoneDegreesWorksetPoolFree( |
| 100 | const fiftyoneDegreesWorksetPool *pool) { |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | void fiftyoneDegreesDataSetFree(const fiftyoneDegreesDataSet *dataSet) { |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | static fiftyoneDegreesAsciiString dummyAsciiString = {0, 0}; |
| 109 | |
| 110 | const fiftyoneDegreesAsciiString* fiftyoneDegreesGetString( |
| 111 | const fiftyoneDegreesDataSet *dataSet, |
| 112 | int32_t offset) { |
| 113 | return &dummyAsciiString; |
| 114 | } |