cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
h2_wire.h
Go to the documentation of this file.
1
10
#ifndef CWIST_NET_HTTP_H2_WIRE_H
11
#define CWIST_NET_HTTP_H2_WIRE_H
12
13
#include <stdint.h>
14
15
static
inline
void
h2_put_u24(
unsigned
char
*
p
,
uint32_t
v
) {
16
p
[0] = (
unsigned
char
)(
v
>> 16);
17
p
[1] = (
unsigned
char
)(
v
>> 8);
18
p
[2] = (
unsigned
char
)
v
;
19
}
20
21
static
inline
void
h2_put_u32(
unsigned
char
*
p
,
uint32_t
v
) {
22
p
[0] = (
unsigned
char
)(
v
>> 24);
23
p
[1] = (
unsigned
char
)(
v
>> 16);
24
p
[2] = (
unsigned
char
)(
v
>> 8);
25
p
[3] = (
unsigned
char
)
v
;
26
}
27
29
static
inline
void
h2_put_u31(
unsigned
char
*
p
,
uint32_t
v
) {
30
h2_put_u32(
p
,
v
& 0x7fffffffu);
31
}
32
33
static
inline
uint16_t
h2_get_u16(
const
unsigned
char
*
p
) {
34
return
(
uint16_t
)(((
uint16_t
)
p
[0] << 8) |
p
[1]);
35
}
36
37
static
inline
uint32_t
h2_get_u24(
const
unsigned
char
*
p
) {
38
return
((
uint32_t
)
p
[0] << 16) | ((
uint32_t
)
p
[1] << 8) |
p
[2];
39
}
40
41
static
inline
uint32_t
h2_get_u32(
const
unsigned
char
*
p
) {
42
return
((
uint32_t
)
p
[0] << 24) | ((
uint32_t
)
p
[1] << 16) | ((
uint32_t
)
p
[2] << 8) |
p
[3];
43
}
44
46
static
inline
uint32_t
h2_get_u31(
const
unsigned
char
*
p
) {
47
return
h2_get_u32(
p
) & 0x7fffffffu;
48
}
49
50
#endif
/* CWIST_NET_HTTP_H2_WIRE_H */
cap
size_t cap
Definition
otel.c:56
src
net
http
h2_wire.h
Generated by
1.9.8