SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
header.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <smolrtsp/priv/compiler_attrs.h>
9 #include <smolrtsp/types/error.h>
10 #include <smolrtsp/writer.h>
11 
12 #include <stdbool.h>
13 #include <stdio.h>
14 
15 #include <unistd.h>
16 
17 #include <slice99.h>
18 
22 typedef struct {
26  CharSlice99 key;
27 
31  CharSlice99 value;
33 
46  const SmolRTSP_Header *restrict self,
47  SmolRTSP_Writer w) SMOLRTSP_PRIV_MUST_USE;
48 
54 SmolRTSP_ParseResult SmolRTSP_Header_parse(
55  SmolRTSP_Header *restrict self, CharSlice99 input) SMOLRTSP_PRIV_MUST_USE;
56 
64  const SmolRTSP_Header *restrict lhs,
65  const SmolRTSP_Header *restrict rhs) SMOLRTSP_PRIV_MUST_USE;
66 
70 #define SMOLRTSP_HEADER_ACCEPT (CharSlice99_from_str("Accept"))
71 
75 #define SMOLRTSP_HEADER_ACCEPT_ENCODING \
76  (CharSlice99_from_str("Accept-Encoding"))
77 
81 #define SMOLRTSP_HEADER_ACCEPT_LANGUAGE \
82  (CharSlice99_from_str("Accept-Language"))
83 
87 #define SMOLRTSP_HEADER_ALLOW (CharSlice99_from_str("Allow"))
88 
92 #define SMOLRTSP_HEADER_AUTHORIZATION (CharSlice99_from_str("Authorization"))
93 
97 #define SMOLRTSP_HEADER_BANDWIDTH (CharSlice99_from_str("Bandwidth"))
98 
102 #define SMOLRTSP_HEADER_BLOCKSIZE (CharSlice99_from_str("Blocksize"))
103 
107 #define SMOLRTSP_HEADER_CACHE_CONTROL (CharSlice99_from_str("Cache-Control"))
108 
112 #define SMOLRTSP_HEADER_CONFERENCE (CharSlice99_from_str("Conference"))
113 
117 #define SMOLRTSP_HEADER_CONNECTION (CharSlice99_from_str("Connection"))
118 
122 #define SMOLRTSP_HEADER_CONTENT_BASE (CharSlice99_from_str("Content-Base"))
123 
127 #define SMOLRTSP_HEADER_CONTENT_ENCODING \
128  (CharSlice99_from_str("Content-Encoding"))
129 
133 #define SMOLRTSP_HEADER_CONTENT_LANGUAGE \
134  (CharSlice99_from_str("Content-Language"))
135 
139 #define SMOLRTSP_HEADER_CONTENT_LENGTH (CharSlice99_from_str("Content-Length"))
140 
144 #define SMOLRTSP_HEADER_CONTENT_LOCATION \
145  (CharSlice99_from_str("Content-Location"))
146 
150 #define SMOLRTSP_HEADER_CONTENT_TYPE (CharSlice99_from_str("Content-Type"))
151 
155 #define SMOLRTSP_HEADER_C_SEQ (CharSlice99_from_str("CSeq"))
156 
160 #define SMOLRTSP_HEADER_DATE (CharSlice99_from_str("Date"))
161 
165 #define SMOLRTSP_HEADER_EXPIRES (CharSlice99_from_str("Expires"))
166 
170 #define SMOLRTSP_HEADER_FROM (CharSlice99_from_str("From"))
171 
175 #define SMOLRTSP_HEADER_IF_MODIFIED_SINCE \
176  (CharSlice99_from_str("If-Modified-Since"))
177 
181 #define SMOLRTSP_HEADER_LAST_MODIFIED (CharSlice99_from_str("Last-Modified"))
182 
186 #define SMOLRTSP_HEADER_PROXY_AUTHENTICATE \
187  (CharSlice99_from_str("Proxy-Authenticate"))
188 
192 #define SMOLRTSP_HEADER_PROXY_REQUIRE (CharSlice99_from_str("Proxy-Require"))
193 
197 #define SMOLRTSP_HEADER_PUBLIC (CharSlice99_from_str("Public"))
198 
202 #define SMOLRTSP_HEADER_RANGE (CharSlice99_from_str("Range"))
203 
207 #define SMOLRTSP_HEADER_REFERER (CharSlice99_from_str("Referrer"))
208 
212 #define SMOLRTSP_HEADER_REQUIRE (CharSlice99_from_str("Require"))
213 
217 #define SMOLRTSP_HEADER_RETRY_AFTER (CharSlice99_from_str("Retry-After"))
218 
222 #define SMOLRTSP_HEADER_RTP_INFO (CharSlice99_from_str("RTP-Info"))
223 
227 #define SMOLRTSP_HEADER_SCALE (CharSlice99_from_str("Scale"))
228 
232 #define SMOLRTSP_HEADER_SESSION (CharSlice99_from_str("Session"))
233 
237 #define SMOLRTSP_HEADER_SERVER (CharSlice99_from_str("Server"))
238 
242 #define SMOLRTSP_HEADER_SPEED (CharSlice99_from_str("Speed"))
243 
247 #define SMOLRTSP_HEADER_TRANSPORT (CharSlice99_from_str("Transport"))
248 
252 #define SMOLRTSP_HEADER_UNSUPPORTED (CharSlice99_from_str("Unsupported"))
253 
257 #define SMOLRTSP_HEADER_USER_AGENT (CharSlice99_from_str("User-Agent"))
258 
262 #define SMOLRTSP_HEADER_VIA (CharSlice99_from_str("Via"))
263 
267 #define SMOLRTSP_HEADER_WWW_AUTHENTICATE \
268  (CharSlice99_from_str("WWW-Authenticate"))
Possible parsing errors.
SmolRTSP_ParseResult SmolRTSP_Header_parse(SmolRTSP_Header *restrict self, CharSlice99 input) SMOLRTSP_PRIV_MUST_USE
Parses data to self.
bool SmolRTSP_Header_eq(const SmolRTSP_Header *restrict lhs, const SmolRTSP_Header *restrict rhs) SMOLRTSP_PRIV_MUST_USE
Tests lhs and rhs for equality.
ssize_t SmolRTSP_Header_serialize(const SmolRTSP_Header *restrict self, SmolRTSP_Writer w) SMOLRTSP_PRIV_MUST_USE
Serialises self into w.
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.