|
SmolRTSP 0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
|
The writer interface. More...
#include <stdarg.h>#include <stddef.h>#include <stdio.h>#include <unistd.h>#include <interface99.h>#include <slice99.h>#include <smolrtsp/priv/compiler_attrs.h>

Go to the source code of this file.
Macros | |
| #define | SmolRTSP_Writer_IFACE |
| The user-supplied data writer interface. | |
| #define | SMOLRTSP_WRITE_SLICES(w, ...) |
| The same as smolrtsp_write_slices but calculates an array length from variadic arguments (the syntactically separated items of the array). | |
Functions | |
| interface99 (SmolRTSP_Writer) | |
Defines the SmolRTSP_Writer interface. | |
| ssize_t | smolrtsp_write_slices (SmolRTSP_Writer w, size_t len, const CharSlice99 data[restrict static len]) SMOLRTSP_PRIV_MUST_USE |
Sequentially writes all items in data to w. | |
| SmolRTSP_Writer | smolrtsp_fd_writer (int *fd) SMOLRTSP_PRIV_MUST_USE |
A writer that invokes write on a provided file descriptor. | |
| SmolRTSP_Writer | smolrtsp_file_writer (FILE *stream) SMOLRTSP_PRIV_MUST_USE |
A writer that invokes fwrite on a provided file pointer. | |
| SmolRTSP_Writer | smolrtsp_string_writer (char *buffer) SMOLRTSP_PRIV_MUST_USE |
A writer that invokes strncat on a provided buffer. | |
The writer interface.
| #define SMOLRTSP_WRITE_SLICES | ( | w, | |
| ... | |||
| ) |
The same as smolrtsp_write_slices but calculates an array length from variadic arguments (the syntactically separated items of the array).
| #define SmolRTSP_Writer_IFACE |
The user-supplied data writer interface.
| interface99 | ( | SmolRTSP_Writer | ) |
Defines the SmolRTSP_Writer interface.
See Interface99 for the macro usage.
| SmolRTSP_Writer smolrtsp_fd_writer | ( | int * | fd | ) |
A writer that invokes write on a provided file descriptor.
fd != NULL | SmolRTSP_Writer smolrtsp_file_writer | ( | FILE * | stream | ) |
A writer that invokes fwrite on a provided file pointer.
stream != NULL | SmolRTSP_Writer smolrtsp_string_writer | ( | char * | buffer | ) |
A writer that invokes strncat on a provided buffer.
buffer shall be capable of holding all characters that will be written into it. | ssize_t smolrtsp_write_slices | ( | SmolRTSP_Writer | w, |
| size_t | len, | ||
| const CharSlice99 | data[restrict static len] | ||
| ) |
Sequentially writes all items in data to w.
| [in] | w | The writer to be provided with data. |
| [in] | len | The number of items in data. |
| [in] | data | The data array which will be written to w, one-by-one. |
w.self && w.vptr