Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
context.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <compy/droppable.h>
9#include <compy/priv/compiler_attrs.h>
12#include <compy/writer.h>
13
14#include <stdarg.h>
15#include <stdint.h>
16
17#include <interface99.h>
18#include <slice99.h>
19
24
34Compy_Context_new(Compy_Writer w, uint32_t cseq) COMPY_PRIV_MUST_USE;
35
41Compy_Writer
42Compy_Context_get_writer(const Compy_Context *ctx) COMPY_PRIV_MUST_USE;
43
49uint32_t Compy_Context_get_cseq(const Compy_Context *ctx) COMPY_PRIV_MUST_USE;
50
58ssize_t Compy_Context_get_ret(const Compy_Context *ctx) COMPY_PRIV_MUST_USE;
59
74 Compy_Context *ctx, CharSlice99 key, const char *restrict fmt, va_list list)
75 COMPY_PRIV_GCC_ATTR(format(printf, 3, 0));
76
81 Compy_Context *ctx, CharSlice99 key, const char *restrict fmt, ...)
82 COMPY_PRIV_GCC_ATTR(format(printf, 3, 4));
83
93
109ssize_t
110compy_respond(Compy_Context *ctx, Compy_StatusCode code, const char *reason);
111
115ssize_t compy_respond_ok(Compy_Context *ctx);
116
122
ssize_t compy_respond_ok(Compy_Context *ctx)
A shortcut for compy_respond(ctx, COMPY_STATUS_OK, "OK").
Definition context.c:106
ssize_t compy_respond_internal_error(Compy_Context *ctx)
A shortcut for compy_respond(ctx, COMPY_STATUS_INTERNAL_SERVER_ERROR, "Internal error").
Definition context.c:111
void void compy_header(Compy_Context *ctx, CharSlice99 key, const char *restrict fmt,...) COMPY_PRIV_GCC_ATTR(format(printf
The compy_vheader twin.
uint32_t Compy_Context_get_cseq(const Compy_Context *ctx) COMPY_PRIV_MUST_USE
Retrieves cseq specified in Compy_Context_new.
Definition context.c:37
void compy_vheader(Compy_Context *ctx, CharSlice99 key, const char *restrict fmt, va_list list) COMPY_PRIV_GCC_ATTR(format(printf
Appends an RTSP header to the request context.
ssize_t compy_respond(Compy_Context *ctx, Compy_StatusCode code, const char *reason)
Writes an RTSP response to the underlying writer.
Definition context.c:86
declImplExtern99(Compy_Droppable, Compy_Context)
Implements Compy_Droppable_IFACE for Compy_Context.
void void void compy_body(Compy_Context *ctx, Compy_MessageBody body)
Sets an RTSP body in the request context.
Definition context.c:80
ssize_t Compy_Context_get_ret(const Compy_Context *ctx) COMPY_PRIV_MUST_USE
Retrieves the RTSP respond return value.
Definition context.c:42
Compy_Writer Compy_Context_get_writer(const Compy_Context *ctx) COMPY_PRIV_MUST_USE
Retrieves the writer specified in Compy_Context_new.
Definition context.c:32
Compy_Context * Compy_Context_new(Compy_Writer w, uint32_t cseq) COMPY_PRIV_MUST_USE
Creates a new Compy context.
Definition context.c:18
Droppable types support.
An RTSP message body.
CharSlice99 Compy_MessageBody
An RTSP message body.
Definition message_body.h:19
An RTSP status code.
uint16_t Compy_StatusCode
An RTSP status code.
Definition status_code.h:20
Definition context.c:10
The writer interface.