Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
sdp.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <compy/priv/compiler_attrs.h>
10#include <compy/writer.h>
11
12#include <slice99.h>
13
17typedef char Compy_SdpType;
18
22typedef struct {
27
31 CharSlice99 value;
33
46 const Compy_SdpLine *restrict self, Compy_Writer w) COMPY_PRIV_MUST_USE;
47
61 Compy_Writer w, Compy_SdpType ty, const char *restrict fmt,
62 ...) COMPY_PRIV_MUST_USE COMPY_PRIV_GCC_ATTR(format(printf, 3, 4));
63
112#define COMPY_SDP_DESCRIBE(ret, w, ...) \
113 COMPY_PRIV_SDP_DESCRIBE(ret, w, __VA_ARGS__)
114
115#ifndef DOXYGEN_IGNORE
116
117#include <metalang99.h>
118
119#define COMPY_PRIV_SDP_DESCRIBE(ret, w, ...) \
120 do { \
121 ssize_t compy_priv_sdp_ret = 0; \
122 ML99_EVAL(ML99_variadicsForEach( \
123 ML99_compose( \
124 ML99_appl(v(COMPY_PRIV_genSdpPrintf), v(ret, w)), \
125 v(ML99_untuple)), \
126 v(__VA_ARGS__))) \
127 } while (0)
128
129#define COMPY_PRIV_genSdpPrintf_IMPL(ret, w, ty, ...) \
130 v({ \
131 compy_priv_sdp_ret = compy_sdp_printf(w, ty, __VA_ARGS__); \
132 if (compy_priv_sdp_ret < 0) { \
133 break; \
134 } \
135 ret += compy_priv_sdp_ret; \
136 })
137
138#define COMPY_PRIV_genSdpPrintf_ARITY 2
139
140#endif // DOXYGEN_IGNORE
141
145#define COMPY_SDP_VERSION 'v'
146
150#define COMPY_SDP_ORIGIN 'o'
151
155#define COMPY_SDP_SESSION_NAME 's'
156
160#define COMPY_SDP_INFO 'i'
161
165#define COMPY_SDP_URI 'u'
166
170#define COMPY_SDP_EMAIL 'e'
171
175#define COMPY_SDP_PHONE 'p'
176
180#define COMPY_SDP_CONNECTION 'c'
181
185#define COMPY_SDP_BANDWIDTH 'b'
186
190#define COMPY_SDP_TIME 't'
191
195#define COMPY_SDP_REPEAT 'r'
196
200#define COMPY_SDP_TIME_ZONES 'z'
201
205#define COMPY_SDP_ENCRYPTION_KEYS 'k'
206
210#define COMPY_SDP_ATTR 'a'
211
215#define COMPY_SDP_MEDIA 'm'
ssize_t Compy_SdpLine_serialize(const Compy_SdpLine *restrict self, Compy_Writer w) COMPY_PRIV_MUST_USE
Serialises self into w.
Definition sdp.c:12
char Compy_SdpType
An SDP type (one character).
Definition sdp.h:17
ssize_t compy_sdp_printf(Compy_Writer w, Compy_SdpType ty, const char *restrict fmt,...) COMPY_PRIV_MUST_USE COMPY_PRIV_GCC_ATTR(format(printf
Printfs a single SDP line to w.
An SDP line.
Definition sdp.h:22
Compy_SdpType ty
The type of this line.
Definition sdp.h:26
CharSlice99 value
The value of this line.
Definition sdp.h:31
The writer interface.