◆ fiftyoneDegreesHeadersGetMethod
typedef long(* fiftyoneDegreesHeadersGetMethod) (void *state, uint32_t index, fiftyoneDegreesCollectionItem *nameItem) |
Gets the unique id and name of the header at the requested index.
- Parameters
-
- state - pointer to data used by the method
- index - of the header to get
- nameItem - pointer to the collection item to populate with the name of the header
- Returns
- unique id of the header
Function Documentation
◆ fiftyoneDegreesHeaderGetIndex()
int fiftyoneDegreesHeaderGetIndex ( fiftyoneDegreesHeaders * headers, const char * httpHeaderName, size_t length ) Provides the integer index of the HTTP header name.
- Parameters
-
- headers - structure created by fiftyoneDegreesHeadersCreate
- httpHeaderName - of the header whose index is required
- length - number of characters in httpHeaderName
- Returns
- the index of the HTTP header name, or -1 if the name does not exist
◆ fiftyoneDegreesHeadersCreate()
fiftyoneDegreesHeaders* fiftyoneDegreesHeadersCreate ( bool useUpperPrefixedHeaders, void * state, fiftyoneDegreesHeadersGetMethod get ) Creates a new headers instance configured with the unique HTTP names needed from evidence.
If the useUpperPrefixedHeaders flag is true then checks for the presence of HTTP headers will also include checking for HTTP_ as a prefix to the header key.
- Parameters
-
- useUpperPrefixedHeaders - true if HTTP_ prefixes should be checked
- state - pointer used by getHeaderMethod to retrieve the header integer
- get - used to return the HTTP header unique integer
- Returns
- a new instance of fiftyoneDegreesHeaders ready to be used to filter HTTP headers.
◆ fiftyoneDegreesHeadersFree()
void fiftyoneDegreesHeadersFree ( fiftyoneDegreesHeaders * headers ) Frees the memory allocated by the fiftyoneDegreesHeadersCreate method.
- Parameters
-
- headers - structure created by fiftyoneDegreesHeadersCreate
◆ fiftyoneDegreesHeadersGetHeaderFromUniqueId()
fiftyoneDegreesHeader* fiftyoneDegreesHeadersGetHeaderFromUniqueId ( fiftyoneDegreesHeaders * headers, uint32_t uniqueId ) Gets a pointer to the header in the headers structure with a unique id matching the one provided.
If the headers structure does not contain a header with the unique id, NULL will be returned. This method assumes that the headers in the structure are unique, if they are not, then the first matching header will be returned.
- Parameters
-
- headers - pointer to the headers structure to search
- uniqueId - id to search for
- Returns
- pointer to the matching header, or NULL
◆ fiftyoneDegreesHeadersIsHttp()
bool fiftyoneDegreesHeadersIsHttp ( void * state, fiftyoneDegreesEvidenceKeyValuePair * pair ) Determines if the key of an evidence pair is an HTTP header.
- Parameters
-
- state - results instance to check against
- pair - the evidence pair to be checked
- Returns
- true if the evidence relates to an HTTP header, otherwise false.
◆ fiftyoneDegreesHeadersSize()
size_t fiftyoneDegreesHeadersSize ( int count ) Returns the number of bytes that will be allocated for a headers structure created using the fiftyoneDegreesHeadersCreate method.
- Parameters
-
- count - number of headers in the structure
- Returns
- number of bytes needed