Skip to main content

pamoja_cobs_decoder_feed

Function pamoja_cobs_decoder_feed 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_cobs_decoder_feed( decoder: *mut PamojaCobsDecoder, bytes: *const u8, bytes_len: usize, out_frames: *mut *mut PamojaFrames, ) -> PamojaStatus
Expand description

Feeds a chunk of the byte stream to a COBS decoder.

§Returns

PamojaStatus::Ok on success, with *out_frames set to a new handle holding every frame this chunk completed, in order, which the caller must release with pamoja_frames_free.

§Safety

decoder must be a live handle from pamoja_cobs_decoder_new, bytes must point to at least bytes_len readable bytes or be null when bytes_len is 0, and out_frames must point to a writable *mut PamojaFrames.