l8w8jwt
All Classes Files Functions Variables Enumerations Enumerator Macros
claim.h
Go to the documentation of this file.
1/*
2 Copyright 2020 Raphael Beck
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
23#ifndef L8W8JWT_CLAIM_H
24#define L8W8JWT_CLAIM_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include "version.h"
31#include <stdlib.h>
32
33// Forward declare chillbuff
35struct chillbuff;
36
40#define L8W8JWT_CLAIM_TYPE_STRING 0
41
45#define L8W8JWT_CLAIM_TYPE_INTEGER 1
46
50#define L8W8JWT_CLAIM_TYPE_NUMBER 2
51
55#define L8W8JWT_CLAIM_TYPE_BOOLEAN 3
56
60#define L8W8JWT_CLAIM_TYPE_NULL 4
61
65#define L8W8JWT_CLAIM_TYPE_ARRAY 5
66
70#define L8W8JWT_CLAIM_TYPE_OBJECT 6
71
75#define L8W8JWT_CLAIM_TYPE_OTHER 7
76
83{
88 char* key;
89
94 size_t key_length;
95
99 char* value;
100
106
112 int type;
113};
114
120L8W8JWT_API void l8w8jwt_free_claims(struct l8w8jwt_claim* claims, size_t claims_count);
121
130L8W8JWT_API int l8w8jwt_write_claims(struct chillbuff* stringbuilder, struct l8w8jwt_claim* claims, size_t claims_count);
131
140L8W8JWT_API struct l8w8jwt_claim* l8w8jwt_get_claim(struct l8w8jwt_claim* claims, size_t claims_count, const char* key, size_t key_length);
141
142#ifdef __cplusplus
143} // extern "C"
144#endif
145
146#endif // L8W8JWT_CLAIM_H
L8W8JWT_API int l8w8jwt_write_claims(struct chillbuff *stringbuilder, struct l8w8jwt_claim *claims, size_t claims_count)
L8W8JWT_API void l8w8jwt_free_claims(struct l8w8jwt_claim *claims, size_t claims_count)
L8W8JWT_API struct l8w8jwt_claim * l8w8jwt_get_claim(struct l8w8jwt_claim *claims, size_t claims_count, const char *key, size_t key_length)
Definition claim.h:83
size_t key_length
Definition claim.h:94
char * value
Definition claim.h:99
size_t value_length
Definition claim.h:105
char * key
Definition claim.h:88
int type
Definition claim.h:112
l8w8jwt version checking.