remove SPBitVec wrapper type
Some checks failed
Rust / build-gnu-apt (pull_request) Failing after 1m19s
Rust / build-size-gnu-unstable (pull_request) Failing after 1m9s

This commit is contained in:
Vinzenz Schroeter 2025-05-06 23:05:06 +02:00
parent 85ccf4123c
commit a4bacd53a2
5 changed files with 48 additions and 74 deletions

View file

@ -396,18 +396,6 @@ typedef struct HardResetCommand HardResetCommand;
*/
typedef struct Packet Packet;
/**
* A vector of bits
*
* # Examples
* ```C
* SPBitVec vec = sp_bitvec_new(8);
* sp_bitvec_set(vec, 5, true);
* sp_bitvec_free(vec);
* ```
*/
typedef struct SPBitVec SPBitVec;
/**
* This is a type only used by cbindgen to have a type for pointers.
*/
@ -634,7 +622,7 @@ void sp_bitmap_free(Bitmap */*notnull*/ bitmap);
*
* Returns NULL in case of error.
*/
Bitmap *sp_bitmap_from_bitvec(size_t width, SPBitVec */*notnull*/ bitvec);
Bitmap *sp_bitmap_from_bitvec(size_t width, DisplayBitVec */*notnull*/ bitvec);
/**
* Gets the current value at the specified position in the [Bitmap].
@ -662,7 +650,7 @@ size_t sp_bitmap_height(Bitmap */*notnull*/ bitmap);
/**
* Consumes the Bitmap and returns the contained BitVec
*/
SPBitVec */*notnull*/ sp_bitmap_into_bitvec(Bitmap */*notnull*/ bitmap);
DisplayBitVec */*notnull*/ sp_bitmap_into_bitvec(Bitmap */*notnull*/ bitmap);
/**
* Creates a [BitmapCommand] and immediately turns that into a [Packet].
@ -768,7 +756,7 @@ size_t sp_bitmap_width(Bitmap */*notnull*/ bitmap);
/**
* Clones a [SPBitVec].
*/
SPBitVec */*notnull*/ sp_bitvec_clone(SPBitVec */*notnull*/ bit_vec);
DisplayBitVec */*notnull*/ sp_bitvec_clone(DisplayBitVec */*notnull*/ bit_vec);
/**
* Sets the value of all bits in the [SPBitVec].
@ -778,12 +766,12 @@ SPBitVec */*notnull*/ sp_bitvec_clone(SPBitVec */*notnull*/ bit_vec);
* - `bit_vec`: instance to write to
* - `value`: the value to set all bits to
*/
void sp_bitvec_fill(SPBitVec */*notnull*/ bit_vec, bool value);
void sp_bitvec_fill(DisplayBitVec */*notnull*/ bit_vec, bool value);
/**
* Deallocates a [SPBitVec].
*/
void sp_bitvec_free(SPBitVec */*notnull*/ bit_vec);
void sp_bitvec_free(DisplayBitVec */*notnull*/ bit_vec);
/**
* Gets the value of a bit from the [SPBitVec].
@ -799,7 +787,7 @@ void sp_bitvec_free(SPBitVec */*notnull*/ bit_vec);
*
* - when accessing `index` out of bounds
*/
bool sp_bitvec_get(SPBitVec */*notnull*/ bit_vec, size_t index);
bool sp_bitvec_get(DisplayBitVec */*notnull*/ bit_vec, size_t index);
/**
* Creates a [BitVecCommand] and immediately turns that into a [Packet].
@ -808,7 +796,7 @@ bool sp_bitvec_get(SPBitVec */*notnull*/ bit_vec, size_t index);
*
* Returns NULL in case of an error.
*/
Packet *sp_bitvec_into_packet(SPBitVec */*notnull*/ bitvec,
Packet *sp_bitvec_into_packet(DisplayBitVec */*notnull*/ bitvec,
size_t offset,
BinaryOperation operation,
CompressionCode compression);
@ -820,7 +808,7 @@ Packet *sp_bitvec_into_packet(SPBitVec */*notnull*/ bitvec,
*
* - `bit_vec`: instance to write to
*/
bool sp_bitvec_is_empty(SPBitVec */*notnull*/ bit_vec);
bool sp_bitvec_is_empty(DisplayBitVec */*notnull*/ bit_vec);
/**
* Gets the length of the [SPBitVec] in bits.
@ -829,14 +817,14 @@ bool sp_bitvec_is_empty(SPBitVec */*notnull*/ bit_vec);
*
* - `bit_vec`: instance to write to
*/
size_t sp_bitvec_len(SPBitVec */*notnull*/ bit_vec);
size_t sp_bitvec_len(DisplayBitVec */*notnull*/ bit_vec);
/**
* Interpret the data as a series of bits and load then into a new [SPBitVec] instance.
*
* returns: [SPBitVec] instance containing data.
*/
SPBitVec */*notnull*/ sp_bitvec_load(ByteSlice data);
DisplayBitVec */*notnull*/ sp_bitvec_load(ByteSlice data);
/**
* Creates a new [SPBitVec] instance.
@ -851,7 +839,7 @@ SPBitVec */*notnull*/ sp_bitvec_load(ByteSlice data);
*
* - when `size` is not divisible by 8.
*/
SPBitVec */*notnull*/ sp_bitvec_new(size_t size);
DisplayBitVec */*notnull*/ sp_bitvec_new(size_t size);
/**
* Sets the value of a bit in the [SPBitVec].
@ -866,7 +854,9 @@ SPBitVec */*notnull*/ sp_bitvec_new(size_t size);
*
* - when accessing `index` out of bounds
*/
void sp_bitvec_set(SPBitVec */*notnull*/ bit_vec, size_t index, bool value);
void sp_bitvec_set(DisplayBitVec */*notnull*/ bit_vec,
size_t index,
bool value);
/**
* Gets an unsafe reference to the data of the [SPBitVec] instance.
@ -877,7 +867,7 @@ void sp_bitvec_set(SPBitVec */*notnull*/ bit_vec, size_t index, bool value);
*
* - `bit_vec`: instance to write to
*/
ByteSlice sp_bitvec_unsafe_data_ref(SPBitVec */*notnull*/ bit_vec);
ByteSlice sp_bitvec_unsafe_data_ref(DisplayBitVec */*notnull*/ bit_vec);
/**
* Clones a [BrightnessGrid].