I appreciate the quick changes made in #223 to provide visibility into the internal cursor.
The current API, which is accurately documented in the header below, makes it impossible to distinguish between the error state and a valid cursor positioned at the end-of-input.
In my use of this function, I need to undo the following conversion logic and requires an additional call into UsefulInputBuf_GetBufferLength(). It seems to me that this logic is not really necessary and is not as efficient as simply not including this block (and updating the documentation appropriately). The reason is that a cursor at the end-of-input is perfectly valid situation to be in, and if a user application cares about this condition it can detect it as it needs to.
I appreciate the quick changes made in #223 to provide visibility into the internal cursor.
The current API, which is accurately documented in the header below, makes it impossible to distinguish between the error state and a valid cursor positioned at the end-of-input.
https://github.com/laurencelundblade/QCBOR/blob/b239c65376fbc502587df88e47629fa667c721c7/inc/qcbor/qcbor_decode.h#L1054-L1056
In my use of this function, I need to undo the following conversion logic and requires an additional call into
UsefulInputBuf_GetBufferLength()
. It seems to me that this logic is not really necessary and is not as efficient as simply not including this block (and updating the documentation appropriately). The reason is that a cursor at the end-of-input is perfectly valid situation to be in, and if a user application cares about this condition it can detect it as it needs to.https://github.com/laurencelundblade/QCBOR/blob/b239c65376fbc502587df88e47629fa667c721c7/src/qcbor_decode.c#L3167-L3172