COBS is an escaping algorithm, taking input in the [0,255] range and producing output in the [1,255] range. In other words, it escapes all NUL bytes.
|
Defines |
| #define | FINISH(x) |
| #define | FINISH() |
Functions |
| | RCSID ("$Id:cobs.c, v 1.13 2005/09/10 10:10:36 daichik Exp $") |
| 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_encode (gchar *buf, size_t len, size_t *retlen) |
| | Encode `len' bytes starting at `buf' into new allocated buffer.
|
| 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.
|
| 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.
|
| 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.
|
| gboolean | cobs_stream_write (cobs_stream_t *cs, gpointer data, size_t len) |
| | Add data to the COBS stream.
|
| size_t | cobs_stream_close (cobs_stream_t *cs, gboolean *saw_nul) |
| | Close COBS stream: we have no more data to write.
|
| 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.
|