SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
request.h File Reference

An RTSP request. More...

#include <smolrtsp/priv/compiler_attrs.h>
#include <smolrtsp/types/error.h>
#include <smolrtsp/types/header_map.h>
#include <smolrtsp/types/message_body.h>
#include <smolrtsp/types/request_line.h>
#include <stdbool.h>
#include <slice99.h>
Include dependency graph for request.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SmolRTSP_Request
 An RTSP request. More...
 

Functions

SmolRTSP_Request SmolRTSP_Request_uninit (void) SMOLRTSP_PRIV_MUST_USE
 Returns an RTSP request suitable for being parsed.
 
ssize_t SmolRTSP_Request_serialize (const SmolRTSP_Request *restrict self, SmolRTSP_Writer w) SMOLRTSP_PRIV_MUST_USE
 Serialises self into w. More...
 
SmolRTSP_ParseResult SmolRTSP_Request_parse (SmolRTSP_Request *restrict self, CharSlice99 input) SMOLRTSP_PRIV_MUST_USE
 Parses data to self. More...
 
bool SmolRTSP_Request_eq (const SmolRTSP_Request *restrict lhs, const SmolRTSP_Request *restrict rhs) SMOLRTSP_PRIV_MUST_USE
 Tests lhs and rhs for equality. More...
 

Detailed Description

An RTSP request.

Function Documentation

◆ SmolRTSP_Request_eq()

bool SmolRTSP_Request_eq ( const SmolRTSP_Request *restrict  lhs,
const SmolRTSP_Request *restrict  rhs 
)

Tests lhs and rhs for equality.

Precondition
lhs != NULL
rhs != NULL

◆ SmolRTSP_Request_parse()

SmolRTSP_ParseResult SmolRTSP_Request_parse ( SmolRTSP_Request *restrict  self,
CharSlice99  input 
)

Parses data to self.

Precondition
self != NULL

◆ SmolRTSP_Request_serialize()

ssize_t SmolRTSP_Request_serialize ( const SmolRTSP_Request *restrict  self,
SmolRTSP_Writer  w 
)

Serialises self into w.

If CSeq and Content-Length are not present in SmolRTSP_Request.header_map, they will be taken from SmolRTSP_Request.cseq and SmolRTSP_Request.body, respectively, and serialised as first headers automatically.

Parameters
[in]selfThe instance to be serialised.
[in]wThe writer to be provided with serialised data.
Returns
The number of bytes written or a negative value on error.
Precondition
self != NULL
w.self && w.vptr