/* helper to encode a single byte in hex form
*
- * Returns the position of the last written byte on success and NULL on
- * error.
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static char *_encode_byte_hex(char *start, char *stop, unsigned char byte)
{
* The function may only be called under CBOR context (that is when
* LOG_OPT_ENCODE_CBOR option is set).
*
- * Returns the position of the last written byte on success and NULL on
- * error.
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static char *_lf_cbor_encode_byte(struct cbor_encode_ctx *cbor_ctx,
char *start, char *stop, unsigned char byte)
/* helper function for _lf_encode_bytes() to escape a single byte
* with <escape>
+ *
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_escape_byte(char *start, char *stop,
char byte, const char escape)
/* helper function for _lf_encode_bytes() to escape a single byte
* with <escape> and deal with cbor-specific encoding logic
+ *
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_cbor_escape_byte(char *start, char *stop,
char byte, const char escape,
*
* The function assumes that at least 1 byte is available for writing
*
- * Returns the address of the last written byte on success, or NULL
- * on error
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_map_escape_byte(char *start, char *stop,
const char *byte,
*
* The function assumes that at least 1 byte is available for writing
*
- * Returns the address of the last written byte on success, or NULL
- * on error
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_cbor_map_escape_byte(char *start, char *stop,
const char *byte,
*
* The function assumes that at least 1 byte is available for writing
*
- * Returns the address of the last written byte on success, or NULL
- * on error
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_rfc5424_escape_byte(char *start, char *stop,
const char *byte,
*
* The function assumes that at least 1 byte is available for writing
*
- * Returns the address of the last written byte on success, or NULL
- * on error
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. It will not append terminating NULL byte.
*/
static inline char *_lf_json_escape_byte(char *start, char *stop,
const char *byte,
*
* CBOR encode ctx is provided in <ctx>
*
- * Returns the position of the last written byte on success and NULL on
- * error. The function cannot write past <stop>
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. The function cannot write past <stop>.
+ * It will not append terminating NULL byte.
*/
char *cbor_encode_uint64_prefix(struct cbor_encode_ctx *ctx,
char *start, char *stop, uint64_t value,
*
* CBOR encode ctx is provided in <ctx>
*
- * Returns the position of the last written byte on success and NULL on
- * error. The function cannot write past <stop>
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. The function cannot write past <stop>.
+ * It will not append terminating NULL byte.
*/
char *cbor_encode_int64(struct cbor_encode_ctx *ctx,
char *start, char *stop, int64_t value)
*
* CBOR encode ctx is provided in <ctx>
*
- * Returns the position of the last written byte on success and NULL on
- * error. The function cannot write past <stop>
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. The function cannot write past <stop>.
+ * It will not append terminating NULL byte.
*/
char *cbor_encode_bytes_prefix(struct cbor_encode_ctx *ctx,
char *start, char *stop,
*
* CBOR encode ctx is provided in <ctx>
*
- * Returns the position of the last written byte on success and NULL on
- * error. The function cannot write past <stop>
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. The function cannot write past <stop>.
+ * It will not append terminating NULL byte.
*/
char *cbor_encode_text(struct cbor_encode_ctx *ctx,
char *start, char *stop,
*
* CBOR encode ctx is provided in <ctx>
*
- * Returns the position of the last written byte on success and NULL on
- * error. The function cannot write past <stop>
+ * Returns the address of the byte immediately after the last written byte
+ * on success, or NULL on error. The function cannot write past <stop>.
+ * It will not append terminating NULL byte.
*/
char *cbor_encode_bytes(struct cbor_encode_ctx *ctx,
char *start, char *stop,