Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
controller.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <compy/context.h>
9#include <compy/droppable.h>
10#include <compy/types/request.h>
11#include <compy/writer.h>
12
13#include <stddef.h>
14
15#include <interface99.h>
16
31
39#define Compy_Controller_IFACE \
40 \
41 /* \
42 * Handles `OPTIONS` as defined in \
43 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.1>. \
44 */ \
45 vfunc99( \
46 void, options, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
47 \
48 /* \
49 * Handles `DESCRIBE` as defined in \
50 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.2>. \
51 */ \
52 vfunc99( \
53 void, describe, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
54 \
55 /* \
56 * Handles `SETUP` as defined in \
57 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.4>. \
58 */ \
59 vfunc99( \
60 void, setup, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
61 \
62 /* \
63 * Handles `PLAY` as defined in \
64 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.5>. \
65 */ \
66 vfunc99(void, play, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
67 \
68 /* \
69 * Handles `PAUSE` as defined in \
70 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.6>. \
71 */ \
72 vfunc99( \
73 void, pause_method, VSelf99, Compy_Context *ctx, \
74 const Compy_Request *req) \
75 \
76 /* \
77 * Handles `TEARDOWN` as defined in \
78 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.7>. \
79 */ \
80 vfunc99( \
81 void, teardown, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
82 \
83 /* \
84 * Handles `GET_PARAMETER` as defined in \
85 * <https://datatracker.ietf.org/doc/html/rfc2326#section-10.8>. \
86 */ \
87 vfunc99( \
88 void, get_parameter, VSelf99, Compy_Context *ctx, \
89 const Compy_Request *req) \
90 \
91 /* \
92 * Handles a command that is not one of the above. \
93 */ \
94 vfunc99( \
95 void, unknown, VSelf99, Compy_Context *ctx, const Compy_Request *req) \
96 \
97 /* \
98 * A method that is invoked _before_ the actual request handling. \
99 */ \
100 vfunc99( \
101 Compy_ControlFlow, before, VSelf99, Compy_Context *ctx, \
102 const Compy_Request *req) \
103 \
104 /* \
105 * A method that is invoked _after_ request handling. \
106 */ \
107 vfunc99( \
108 void, after, VSelf99, ssize_t ret, Compy_Context *ctx, \
109 const Compy_Request *req)
110
114#define Compy_Controller_EXTENDS (Compy_Droppable)
115
122interface99(Compy_Controller);
123
152void compy_dispatch(
153 Compy_Writer conn, Compy_Controller controller,
154 const Compy_Request *restrict req);
A request context.
interface99(Compy_Controller)
Defines the Compy_Controller interface.
void compy_dispatch(Compy_Writer conn, Compy_Controller controller, const Compy_Request *restrict req)
Dispatches an incoming request to controller.
Definition controller.c:5
Compy_ControlFlow
Whether to stop or continue some processing.
Definition controller.h:20
@ Compy_ControlFlow_Continue
Continue processing.
Definition controller.h:29
@ Compy_ControlFlow_Break
Break processing.
Definition controller.h:24
Droppable types support.
An RTSP request.
An RTSP request.
Definition request.h:21
The writer interface.