Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <compy/priv/compiler_attrs.h>
9#include <compy/types/error.h>
10#include <compy/writer.h>
11
12#include <stdbool.h>
13#include <stdio.h>
14
15#include <unistd.h>
16
17#include <slice99.h>
18
22typedef struct {
26 CharSlice99 key;
27
31 CharSlice99 value;
33
46 const Compy_Header *restrict self, Compy_Writer w) COMPY_PRIV_MUST_USE;
47
53Compy_ParseResult Compy_Header_parse(
54 Compy_Header *restrict self, CharSlice99 input) COMPY_PRIV_MUST_USE;
55
63 const Compy_Header *restrict lhs,
64 const Compy_Header *restrict rhs) COMPY_PRIV_MUST_USE;
65
69#define COMPY_HEADER_ACCEPT (CharSlice99_from_str("Accept"))
70
74#define COMPY_HEADER_ACCEPT_ENCODING (CharSlice99_from_str("Accept-Encoding"))
75
79#define COMPY_HEADER_ACCEPT_LANGUAGE (CharSlice99_from_str("Accept-Language"))
80
84#define COMPY_HEADER_ALLOW (CharSlice99_from_str("Allow"))
85
89#define COMPY_HEADER_AUTHORIZATION (CharSlice99_from_str("Authorization"))
90
94#define COMPY_HEADER_BANDWIDTH (CharSlice99_from_str("Bandwidth"))
95
99#define COMPY_HEADER_BLOCKSIZE (CharSlice99_from_str("Blocksize"))
100
104#define COMPY_HEADER_CACHE_CONTROL (CharSlice99_from_str("Cache-Control"))
105
109#define COMPY_HEADER_CONFERENCE (CharSlice99_from_str("Conference"))
110
114#define COMPY_HEADER_CONNECTION (CharSlice99_from_str("Connection"))
115
119#define COMPY_HEADER_CONTENT_BASE (CharSlice99_from_str("Content-Base"))
120
124#define COMPY_HEADER_CONTENT_ENCODING (CharSlice99_from_str("Content-Encoding"))
125
129#define COMPY_HEADER_CONTENT_LANGUAGE (CharSlice99_from_str("Content-Language"))
130
134#define COMPY_HEADER_CONTENT_LENGTH (CharSlice99_from_str("Content-Length"))
135
139#define COMPY_HEADER_CONTENT_LOCATION (CharSlice99_from_str("Content-Location"))
140
144#define COMPY_HEADER_CONTENT_TYPE (CharSlice99_from_str("Content-Type"))
145
149#define COMPY_HEADER_C_SEQ (CharSlice99_from_str("CSeq"))
150
154#define COMPY_HEADER_DATE (CharSlice99_from_str("Date"))
155
159#define COMPY_HEADER_EXPIRES (CharSlice99_from_str("Expires"))
160
164#define COMPY_HEADER_FROM (CharSlice99_from_str("From"))
165
169#define COMPY_HEADER_IF_MODIFIED_SINCE \
170 (CharSlice99_from_str("If-Modified-Since"))
171
175#define COMPY_HEADER_LAST_MODIFIED (CharSlice99_from_str("Last-Modified"))
176
180#define COMPY_HEADER_PROXY_AUTHENTICATE \
181 (CharSlice99_from_str("Proxy-Authenticate"))
182
186#define COMPY_HEADER_PROXY_REQUIRE (CharSlice99_from_str("Proxy-Require"))
187
191#define COMPY_HEADER_PUBLIC (CharSlice99_from_str("Public"))
192
196#define COMPY_HEADER_RANGE (CharSlice99_from_str("Range"))
197
201#define COMPY_HEADER_REFERER (CharSlice99_from_str("Referrer"))
202
206#define COMPY_HEADER_REQUIRE (CharSlice99_from_str("Require"))
207
211#define COMPY_HEADER_RETRY_AFTER (CharSlice99_from_str("Retry-After"))
212
216#define COMPY_HEADER_RTP_INFO (CharSlice99_from_str("RTP-Info"))
217
221#define COMPY_HEADER_SCALE (CharSlice99_from_str("Scale"))
222
226#define COMPY_HEADER_SESSION (CharSlice99_from_str("Session"))
227
231#define COMPY_HEADER_SERVER (CharSlice99_from_str("Server"))
232
236#define COMPY_HEADER_SPEED (CharSlice99_from_str("Speed"))
237
241#define COMPY_HEADER_TRANSPORT (CharSlice99_from_str("Transport"))
242
246#define COMPY_HEADER_UNSUPPORTED (CharSlice99_from_str("Unsupported"))
247
251#define COMPY_HEADER_USER_AGENT (CharSlice99_from_str("User-Agent"))
252
256#define COMPY_HEADER_VIA (CharSlice99_from_str("Via"))
257
261#define COMPY_HEADER_WWW_AUTHENTICATE (CharSlice99_from_str("WWW-Authenticate"))
Possible parsing errors.
ssize_t Compy_Header_serialize(const Compy_Header *restrict self, Compy_Writer w) COMPY_PRIV_MUST_USE
Serialises self into w.
Definition header.c:10
Compy_ParseResult Compy_Header_parse(Compy_Header *restrict self, CharSlice99 input) COMPY_PRIV_MUST_USE
Parses data to self.
Definition header.c:24
bool Compy_Header_eq(const Compy_Header *restrict lhs, const Compy_Header *restrict rhs) COMPY_PRIV_MUST_USE
Tests lhs and rhs for equality.
Definition header.c:50
An RTSP header.
Definition header.h:22
CharSlice99 key
The key of this header.
Definition header.h:26
CharSlice99 value
The value of this header.
Definition header.h:31
The writer interface.