@@ -330,25 +330,21 @@ struct CborParserOperations
330330 * called before \ref read_bytes and \ref transfer_bytes to ensure it is safe
331331 * to read the requested number of bytes from the reader.
332332 *
333- * \param token An opaque object passed to \ref cbor_parser_init_reader
334- * that may be used to pass context information between the
335- * \ref CborParserOperations methods.
333+ * \param value The CBOR value being parsed.
336334 *
337335 * \param len The number of bytes sought.
338336 *
339337 * \retval true \a len bytes may be read from the reader.
340338 * \retval false Insufficient data is available to be read at this time.
341339 */
342- bool (* can_read_bytes )(void * token , size_t len );
340+ bool (* can_read_bytes )(const struct CborValue * value , size_t len );
343341
344342 /**
345343 * Reads \a len bytes from the reader starting at \a offset bytes from
346344 * the current read position and copies them to \a dst. The read pointer
347345 * is *NOT* modified by this operation.
348346 *
349- * \param token An opaque object passed to \ref cbor_parser_init_reader
350- * that may be used to pass context information between the
351- * \ref CborParserOperations methods.
347+ * \param value The CBOR value being parsed.
352348 *
353349 * \param dst The buffer the read bytes will be copied to.
354350 *
@@ -357,19 +353,17 @@ struct CborParserOperations
357353 *
358354 * \param len The number of bytes sought.
359355 */
360- void * (* read_bytes )(void * token , void * dst , size_t offset , size_t len );
356+ void * (* read_bytes )(const struct CborValue * value , void * dst , size_t offset , size_t len );
361357
362358 /**
363359 * Skips past \a len bytes from the reader without reading them. The read
364360 * pointer is advanced in the process.
365361 *
366- * \param token An opaque object passed to \ref cbor_parser_init_reader
367- * that may be used to pass context information between the
368- * \ref CborParserOperations methods.
362+ * \param value The CBOR value being parsed.
369363 *
370364 * \param len The number of bytes skipped.
371365 */
372- void (* advance_bytes )(void * token , size_t len );
366+ void (* advance_bytes )(struct CborValue * value , size_t len );
373367
374368 /**
375369 * Overwrite the user-supplied pointer \a userptr with the address where the
@@ -379,9 +373,7 @@ struct CborParserOperations
379373 * This routine is used for accessing strings embedded in CBOR documents
380374 * (both text and binary strings).
381375 *
382- * \param token An opaque object passed to \ref cbor_parser_init_reader
383- * that may be used to pass context information between the
384- * \ref CborParserOperations methods.
376+ * \param value The CBOR value being parsed.
385377 *
386378 * \param userptr The pointer that will be updated to reference the location
387379 * of the data in the buffer.
@@ -391,7 +383,7 @@ struct CborParserOperations
391383 *
392384 * \param len The number of bytes sought.
393385 */
394- CborError (* transfer_string )(void * token , const void * * userptr , size_t offset , size_t len );
386+ CborError (* transfer_string )(struct CborValue * value , const void * * userptr , size_t offset , size_t len );
395387};
396388
397389struct CborParser
0 commit comments