Skip to content

Commit c730a0c

Browse files
thiagomacieirasjlongland
authored andcommitted
Parser: modify the zero-copy string API
Instead of just one function (_cbor_value_get_string_chunk), we now have _cbor_value_begin_string_iteration, _cbor_value_finish_string_iteration, _cbor_value_get_string_chunk_size, and _cbor_value_get_string_chunk. The "begin" function positions the pointer at the first chunk. That's what makes "get_size" possible, since it doesn't need to check for any state. The "finish" funcntion allows the caller to distinguish an error parsing the string from an error parsing the next value. Signed-off-by: Thiago Macieira <[email protected]>
1 parent cc7774e commit c730a0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cborparser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ static CborError get_string_chunk(CborValue *it, const void **bufferptr, size_t
11471147
*/
11481148

11491149
CborError _cbor_value_get_string_chunk(const CborValue *value, const void **bufferptr,
1150-
size_t *len, CborValue *next)
1150+
size_t *len, CborValue *next)
11511151
{
11521152
CborValue tmp;
11531153
if (!next)

0 commit comments

Comments
 (0)