add packet clone

This commit is contained in:
Vinzenz Schroeter 2024-08-29 22:21:21 +02:00
parent c9c51dcdc2
commit d385d8e1d4
7 changed files with 87 additions and 31 deletions

View file

@ -994,6 +994,20 @@ struct sp_CByteSlice sp_cp437_grid_unsafe_data_ref(struct sp_CCp437Grid *this_);
*/
size_t sp_cp437_grid_width(const struct sp_CCp437Grid *this_);
/**
* Clones a `Packet`.
*
* # Safety
*
* The caller has to make sure that:
*
* - `this` points to a valid `Packet`
* - `this` is not written to concurrently
* - the returned instance is freed in some way, either by using a consuming function or
* by explicitly calling `sp_packet_dealloc`.
*/
struct sp_Packet *sp_packet_clone(const struct sp_Packet *this_);
/**
* Deallocates a `Packet`.
*