@@ -334,25 +334,21 @@ struct CborParserOperations
334
334
* called before \ref read_bytes and \ref transfer_bytes to ensure it is safe
335
335
* to read the requested number of bytes from the reader.
336
336
*
337
- * \param token An opaque object passed to \ref cbor_parser_init_reader
338
- * that may be used to pass context information between the
339
- * \ref CborParserOperations methods.
337
+ * \param value The CBOR value being parsed.
340
338
*
341
339
* \param len The number of bytes sought.
342
340
*
343
341
* \retval true \a len bytes may be read from the reader.
344
342
* \retval false Insufficient data is available to be read at this time.
345
343
*/
346
- bool (* can_read_bytes )(void * token , size_t len );
344
+ bool (* can_read_bytes )(const struct CborValue * value , size_t len );
347
345
348
346
/**
349
347
* Reads \a len bytes from the reader starting at \a offset bytes from
350
348
* the current read position and copies them to \a dst. The read pointer
351
349
* is *NOT* modified by this operation.
352
350
*
353
- * \param token An opaque object passed to \ref cbor_parser_init_reader
354
- * that may be used to pass context information between the
355
- * \ref CborParserOperations methods.
351
+ * \param value The CBOR value being parsed.
356
352
*
357
353
* \param dst The buffer the read bytes will be copied to.
358
354
*
@@ -361,19 +357,17 @@ struct CborParserOperations
361
357
*
362
358
* \param len The number of bytes sought.
363
359
*/
364
- void * (* read_bytes )(void * token , void * dst , size_t offset , size_t len );
360
+ void * (* read_bytes )(const struct CborValue * value , void * dst , size_t offset , size_t len );
365
361
366
362
/**
367
363
* Skips past \a len bytes from the reader without reading them. The read
368
364
* pointer is advanced in the process.
369
365
*
370
- * \param token An opaque object passed to \ref cbor_parser_init_reader
371
- * that may be used to pass context information between the
372
- * \ref CborParserOperations methods.
366
+ * \param value The CBOR value being parsed.
373
367
*
374
368
* \param len The number of bytes skipped.
375
369
*/
376
- void (* advance_bytes )(void * token , size_t len );
370
+ void (* advance_bytes )(struct CborValue * value , size_t len );
377
371
378
372
/**
379
373
* Overwrite the user-supplied pointer \a userptr with the address where the
@@ -383,9 +377,7 @@ struct CborParserOperations
383
377
* This routine is used for accessing strings embedded in CBOR documents
384
378
* (both text and binary strings).
385
379
*
386
- * \param token An opaque object passed to \ref cbor_parser_init_reader
387
- * that may be used to pass context information between the
388
- * \ref CborParserOperations methods.
380
+ * \param value The CBOR value being parsed.
389
381
*
390
382
* \param userptr The pointer that will be updated to reference the location
391
383
* of the data in the buffer.
@@ -395,7 +387,7 @@ struct CborParserOperations
395
387
*
396
388
* \param len The number of bytes sought.
397
389
*/
398
- CborError (* transfer_string )(void * token , const void * * userptr , size_t offset , size_t len );
390
+ CborError (* transfer_string )(struct CborValue * value , const void * * userptr , size_t offset , size_t len );
399
391
};
400
392
401
393
struct CborParser
0 commit comments