|
Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
|
The writer interface. More...
#include <stdarg.h>#include <stddef.h>#include <stdio.h>#include <unistd.h>#include <interface99.h>#include <slice99.h>#include <compy/priv/compiler_attrs.h>

Go to the source code of this file.
Macros | |
| #define | Compy_Writer_IFACE |
| The user-supplied data writer interface. | |
| #define | COMPY_WRITE_SLICES(w, ...) |
| The same as compy_write_slices but calculates an array length from variadic arguments (the syntactically separated items of the array). | |
Functions | |
| interface99 (Compy_Writer) | |
Defines the Compy_Writer interface. | |
| ssize_t | compy_write_slices (Compy_Writer w, size_t len, const CharSlice99 data[restrict static len]) COMPY_PRIV_MUST_USE |
Sequentially writes all items in data to w. | |
| Compy_Writer | compy_fd_writer (int *fd) COMPY_PRIV_MUST_USE |
A writer that invokes write on a provided file descriptor. | |
| Compy_Writer | compy_file_writer (FILE *stream) COMPY_PRIV_MUST_USE |
A writer that invokes fwrite on a provided file pointer. | |
| Compy_Writer | compy_string_writer (char *buffer) COMPY_PRIV_MUST_USE |
A writer that invokes strncat on a provided buffer. | |
The writer interface.
| #define COMPY_WRITE_SLICES | ( | w, | |
| ... | |||
| ) |
The same as compy_write_slices but calculates an array length from variadic arguments (the syntactically separated items of the array).
| #define Compy_Writer_IFACE |
The user-supplied data writer interface.
| Compy_Writer compy_fd_writer | ( | int * | fd | ) |
A writer that invokes write on a provided file descriptor.
fd != NULL | Compy_Writer compy_file_writer | ( | FILE * | stream | ) |
A writer that invokes fwrite on a provided file pointer.
stream != NULL | Compy_Writer compy_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 compy_write_slices | ( | Compy_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 | interface99 | ( | Compy_Writer | ) |
Defines the Compy_Writer interface.
See Interface99 for the macro usage.