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