Skip to content

Commit

Permalink
WSHUB-458: cborparser: Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlongland committed Jul 3, 2021
1 parent 6ed299d commit 4a1cfc3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cborparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,19 @@ CborError cbor_parser_init(const uint8_t *buffer, size_t size, uint32_t flags, C
* The \a ops structure defines functions that implement the read process from
* the buffer given, see \ref CborParserOperations for further details.
*
* The \a token is passed as the first argument to all
* \ref CborParserOperations methods, and may be used to pass additional
* context information to the reader implementation.
* The \a ctx is stored in the \ref CborParser object as `data.ctx` and may be
* used however the reader implementation sees fit. For cursor-specific
* context information, the \ref CborValue `source.token` union member is
* initialised to `NULL` and may be used however the reader implementation
* sees fit.
*/
CborError cbor_parser_init_reader(const struct CborParserOperations *ops, CborParser *parser, CborValue *it, void *token)
CborError cbor_parser_init_reader(const struct CborParserOperations *ops, CborParser *parser, CborValue *it, void *ctx)
{
cbor_parser_init_common(parser, it);
parser->ops = ops;
parser->flags = CborParserFlag_ExternalSource;
parser->data.ctx = token;
parser->data.ctx = ctx;
it->source.token = NULL;
return preparse_value(it);
}

Expand Down

0 comments on commit 4a1cfc3

Please sign in to comment.