container macro code dedup
This commit is contained in:
parent
5ecb84ed16
commit
b4730ffdf3
11 changed files with 148 additions and 222 deletions
|
@ -656,11 +656,11 @@ struct ByteSlice sp_bitmap_data_ref_mut(struct Bitmap */*notnull*/ instance);
|
|||
/**
|
||||
* Calls method [`servicepoint::Bitmap::fill`].
|
||||
*
|
||||
* Sets the state of all pixels in the [Bitmap].
|
||||
* Sets the state of all cells in the grid.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* - `value`: the value to set all pixels to
|
||||
* - `value`: the value to set all cells to
|
||||
*
|
||||
* This function is part of the `bitmap` module.
|
||||
*/
|
||||
|
@ -704,7 +704,7 @@ bool sp_bitmap_get(struct Bitmap */*notnull*/ instance, size_t x, size_t y);
|
|||
/**
|
||||
* Calls method [`servicepoint::Bitmap::height`].
|
||||
*
|
||||
* Gets the height in pixels.
|
||||
* Gets the height.
|
||||
*
|
||||
* This function is part of the `bitmap` module.
|
||||
*/
|
||||
|
@ -809,7 +809,7 @@ void sp_bitmap_set(struct Bitmap */*notnull*/ instance,
|
|||
/**
|
||||
* Calls method [`servicepoint::Bitmap::width`].
|
||||
*
|
||||
* Gets the width in pixels.
|
||||
* Gets the width.
|
||||
*
|
||||
* This function is part of the `bitmap` module.
|
||||
*/
|
||||
|
@ -914,46 +914,6 @@ void sp_bitmapcommand_set_origin(struct BitmapCommand */*notnull*/ command,
|
|||
*/
|
||||
struct Packet *sp_bitmapcommand_try_into_packet(struct BitmapCommand */*notnull*/ command);
|
||||
|
||||
/**
|
||||
* Creates a [BitVecCommand] and immediately turns that into a [Packet].
|
||||
*
|
||||
* The provided [DisplayBitVec] gets consumed.
|
||||
*
|
||||
* Returns NULL in case of an error.
|
||||
*
|
||||
* This function is part of the `bitvec` module.
|
||||
*/
|
||||
struct Packet *sp_bitvec_into_packet(BitVec */*notnull*/ bitvec,
|
||||
size_t offset,
|
||||
BinaryOperation operation,
|
||||
CompressionCode compression);
|
||||
|
||||
/**
|
||||
* Interpret the data as a series of bits and load then into a new [DisplayBitVec] instance.
|
||||
*
|
||||
* returns: [DisplayBitVec] instance containing data.
|
||||
*
|
||||
* This function is part of the `bitvec` module.
|
||||
*/
|
||||
BitVec */*notnull*/ sp_bitvec_load(struct ByteSlice data);
|
||||
|
||||
/**
|
||||
* Creates a new [DisplayBitVec] instance.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* - `size`: size in bits.
|
||||
*
|
||||
* returns: [DisplayBitVec] with all bits set to false.
|
||||
*
|
||||
* # Panics
|
||||
*
|
||||
* - when `size` is not divisible by 8.
|
||||
*
|
||||
* This function is part of the `bitvec` module.
|
||||
*/
|
||||
BitVec */*notnull*/ sp_bitvec_new(size_t size);
|
||||
|
||||
/**
|
||||
*Clones a [`BitVecCommand`] instance.
|
||||
*
|
||||
|
@ -1083,7 +1043,7 @@ struct ByteSlice sp_brightnessgrid_data_ref_mut(BrightnessGrid */*notnull*/ inst
|
|||
/**
|
||||
* Calls method [`servicepoint::BrightnessGrid::fill`].
|
||||
*
|
||||
* Sets the value of all cells.
|
||||
* Sets the state of all cells in the grid.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
|
@ -1110,10 +1070,9 @@ void sp_brightnessgrid_free(BrightnessGrid */*notnull*/ instance);
|
|||
*
|
||||
* - `x` and `y`: position of the cell to read
|
||||
*
|
||||
* returns: value at position
|
||||
*
|
||||
* # Panics
|
||||
* - When accessing `x` or `y` out of bounds.
|
||||
*
|
||||
* - when accessing `x` or `y` out of bounds
|
||||
*
|
||||
* This function is part of the `brightnessgrid` module.
|
||||
*/
|
||||
|
@ -1124,7 +1083,7 @@ Brightness sp_brightnessgrid_get(BrightnessGrid */*notnull*/ instance,
|
|||
/**
|
||||
* Calls method [`servicepoint::BrightnessGrid::height`].
|
||||
*
|
||||
* Gets the height of the grid.
|
||||
* Gets the height.
|
||||
*
|
||||
* This function is part of the `brightnessgrid` module.
|
||||
*/
|
||||
|
@ -1189,11 +1148,9 @@ BrightnessGrid */*notnull*/ sp_brightnessgrid_new(size_t width, size_t height);
|
|||
* - `x` and `y`: position of the cell
|
||||
* - `value`: the value to write to the cell
|
||||
*
|
||||
* returns: old value of the cell
|
||||
*
|
||||
* # Panics
|
||||
*
|
||||
* - When accessing `x` or `y` out of bounds.
|
||||
* - when accessing `x` or `y` out of bounds
|
||||
*
|
||||
* This function is part of the `brightnessgrid` module.
|
||||
*/
|
||||
|
@ -1205,7 +1162,7 @@ void sp_brightnessgrid_set(BrightnessGrid */*notnull*/ instance,
|
|||
/**
|
||||
* Calls method [`servicepoint::BrightnessGrid::width`].
|
||||
*
|
||||
* Gets the width of the grid.
|
||||
* Gets the width.
|
||||
*
|
||||
* This function is part of the `brightnessgrid` module.
|
||||
*/
|
||||
|
@ -1340,7 +1297,7 @@ uint32_t sp_chargrid_get(CharGrid */*notnull*/ instance, size_t x, size_t y);
|
|||
/**
|
||||
* Calls method [`servicepoint::CharGrid::height`].
|
||||
*
|
||||
* Gets the height of the grid.
|
||||
* Gets the height.
|
||||
*
|
||||
* This function is part of the `chargrid` module.
|
||||
*/
|
||||
|
@ -1413,7 +1370,7 @@ void sp_chargrid_set(CharGrid */*notnull*/ instance,
|
|||
/**
|
||||
* Calls method [`servicepoint::CharGrid::width`].
|
||||
*
|
||||
* Gets the width of the grid.
|
||||
* Gets the width.
|
||||
*
|
||||
* This function is part of the `chargrid` module.
|
||||
*/
|
||||
|
@ -1622,11 +1579,10 @@ struct ByteSlice sp_cp437grid_data_ref_mut(Cp437Grid */*notnull*/ instance);
|
|||
/**
|
||||
* Calls method [`servicepoint::Cp437Grid::fill`].
|
||||
*
|
||||
* Sets the value of all cells in the grid.
|
||||
* Sets the state of all cells in the grid.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* - `cp437_grid`: instance to write to
|
||||
* - `value`: the value to set all cells to
|
||||
*
|
||||
* This function is part of the `cp437grid` module.
|
||||
|
@ -1660,7 +1616,7 @@ uint8_t sp_cp437grid_get(Cp437Grid */*notnull*/ instance, size_t x, size_t y);
|
|||
/**
|
||||
* Calls method [`servicepoint::Cp437Grid::height`].
|
||||
*
|
||||
* Gets the height of the grid.
|
||||
* Gets the height.
|
||||
*
|
||||
* This function is part of the `cp437grid` module.
|
||||
*/
|
||||
|
@ -1700,15 +1656,13 @@ Cp437Grid */*notnull*/ sp_cp437grid_new(size_t width, size_t height);
|
|||
/**
|
||||
* Calls method [`servicepoint::Cp437Grid::set`].
|
||||
*
|
||||
* Sets the value at the specified position.
|
||||
* Sets the value of the specified position.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* - `x` and `y`: position of the cell
|
||||
* - `value`: the value to write to the cell
|
||||
*
|
||||
* returns: old value of the cell
|
||||
*
|
||||
* # Panics
|
||||
*
|
||||
* - when accessing `x` or `y` out of bounds
|
||||
|
@ -1723,7 +1677,7 @@ void sp_cp437grid_set(Cp437Grid */*notnull*/ instance,
|
|||
/**
|
||||
* Calls method [`servicepoint::Cp437Grid::width`].
|
||||
*
|
||||
* Gets the width of the grid.
|
||||
* Gets the width.
|
||||
*
|
||||
* This function is part of the `cp437grid` module.
|
||||
*/
|
||||
|
@ -1847,6 +1801,20 @@ void sp_displaybitvec_free(BitVec */*notnull*/ instance);
|
|||
*/
|
||||
bool sp_displaybitvec_get(BitVec */*notnull*/ instance, size_t index);
|
||||
|
||||
/**
|
||||
* Creates a [BitVecCommand] and immediately turns that into a [Packet].
|
||||
*
|
||||
* The provided [DisplayBitVec] gets consumed.
|
||||
*
|
||||
* Returns NULL in case of an error.
|
||||
*
|
||||
* This function is part of the `displaybitvec` module.
|
||||
*/
|
||||
struct Packet *sp_displaybitvec_into_packet(BitVec */*notnull*/ bitvec,
|
||||
size_t offset,
|
||||
BinaryOperation operation,
|
||||
CompressionCode compression);
|
||||
|
||||
/**
|
||||
* Calls method [`servicepoint::DisplayBitVec::is_empty`].
|
||||
*
|
||||
|
@ -1865,6 +1833,32 @@ bool sp_displaybitvec_is_empty(BitVec */*notnull*/ instance);
|
|||
*/
|
||||
size_t sp_displaybitvec_len(BitVec */*notnull*/ instance);
|
||||
|
||||
/**
|
||||
* Interpret the data as a series of bits and load then into a new [DisplayBitVec] instance.
|
||||
*
|
||||
* returns: [DisplayBitVec] instance containing data.
|
||||
*
|
||||
* This function is part of the `displaybitvec` module.
|
||||
*/
|
||||
BitVec */*notnull*/ sp_displaybitvec_load(struct ByteSlice data);
|
||||
|
||||
/**
|
||||
* Creates a new [DisplayBitVec] instance.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* - `size`: size in bits.
|
||||
*
|
||||
* returns: [DisplayBitVec] with all bits set to false.
|
||||
*
|
||||
* # Panics
|
||||
*
|
||||
* - when `size` is not divisible by 8.
|
||||
*
|
||||
* This function is part of the `displaybitvec` module.
|
||||
*/
|
||||
BitVec */*notnull*/ sp_displaybitvec_new(size_t size);
|
||||
|
||||
/**
|
||||
* Calls method [`servicepoint::DisplayBitVec::set`].
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue