#include <glib.h>
Go to the source code of this file.
Data Structures | |
struct | cobs_stream |
A COBS stream is used to fill a buffer space with COBS-ed data where the input data is not known beforehand but gathered a piece at a time. More... | |
Typedefs | |
typedef cobs_stream | cobs_stream_t |
A COBS stream is used to fill a buffer space with COBS-ed data where the input data is not known beforehand but gathered a piece at a time. | |
Enumerations | |
enum | cobs_magic { COBS_MAGIC = 0xc0befU } |
Functions | |
gchar * | cobs_encode (gchar *buf, size_t len, size_t *retlen) |
Encode `len' bytes starting at `buf' into new allocated buffer. | |
gchar * | cobs_encodev (struct iovec *iov, gint iovcnt, size_t *retlen) |
Encode vector `iov' of `iovcnt' elements, whose size is held in `retlen'. | |
gchar * | cobs_decode (gchar *buf, size_t len, size_t *retlen, gboolean inplace) |
Decode `len' bytes starting at `buf' into new allocated buffer, unless `inplace' is true in which case decoding is done inplace. | |
gboolean | cobs_decode_into (const gchar *buf, size_t len, gchar *out, size_t outlen, size_t *retlen) |
Decode `len' bytes starting at `buf' into decoding buffer `out', which is `outlen' bytes long. | |
gboolean | cobs_is_valid (const gchar *buf, size_t len) |
Check whether supplied buffer forms a valid COBS encoding. | |
void | cobs_stream_init (cobs_stream_t *cs, gpointer data, size_t len) |
Initialize an incremental COBS context, where data will be written in the supplied buffer. | |
size_t | cobs_stream_close (cobs_stream_t *cs, gboolean *saw_nul) |
Close COBS stream: we have no more data to write. | |
gboolean | cobs_stream_write (cobs_stream_t *cs, gpointer data, size_t len) |
Add data to the COBS stream. | |
void | cobs_stream_invalidate (cobs_stream_t *cs) |
Empty the descriptor, making it invalid. | |
gboolean | cobs_stream_is_valid (cobs_stream_t *cs) |
Check whether the stream descriptor is valid, for assertions. |
|
A COBS stream is used to fill a buffer space with COBS-ed data where the input data is not known beforehand but gathered a piece at a time.
|
|
|
|
Decode `len' bytes starting at `buf' into new allocated buffer, unless `inplace' is true in which case decoding is done inplace.
|
|
Decode `len' bytes starting at `buf' into decoding buffer `out', which is `outlen' bytes long.
|
|
Encode `len' bytes starting at `buf' into new allocated buffer.
|
|
Encode vector `iov' of `iovcnt' elements, whose size is held in `retlen'.
|
|
Check whether supplied buffer forms a valid COBS encoding.
|
|
Close COBS stream: we have no more data to write.
|
|
Initialize an incremental COBS context, where data will be written in the supplied buffer.
|
|
Empty the descriptor, making it invalid.
|
|
Check whether the stream descriptor is valid, for assertions.
|
|
Add data to the COBS stream.
|