Mercurial > libjeffpc
changeset 719:143874a47f06
cbor: document cbor_peek_type return values
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Tue, 19 Mar 2019 15:53:43 -0400 |
parents | c36d9d172b17 |
children | 9c00aef1efc4 |
files | include/jeffpc/cbor.h |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/include/jeffpc/cbor.h Tue Mar 19 15:53:01 2019 -0400 +++ b/include/jeffpc/cbor.h Tue Mar 19 15:53:43 2019 -0400 @@ -56,6 +56,18 @@ return cbor_pack_cstr_len(buffer, str, strlen(str)); } +/* + * Peek at what the next type is. Returns: + * + * 0: + * if the next value can be represented by a VT_* + * -EINTR: + * if the next value is a CBOR "break" + * -ENOTSUP: + * if next value cannot be represented by a VT_* + * -EFAULT: + * if the buffer is not large enough to contain another value + */ extern int cbor_peek_type(struct buffer *buffer, enum val_type *type); /*