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