From 8f13ba61f0d8966b164bb981f27668de12e0e22a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 22 Jun 2025 00:14:06 +0200 Subject: [PATCH] remove _ from type names in function names --- include/servicepoint.h | 574 +++++++++++----------- src/commands/brightness_grid_command.rs | 6 +- src/commands/char_grid_command.rs | 6 +- src/commands/cp437_grid_command.rs | 6 +- src/commands/global_brightness_command.rs | 4 +- src/containers/brightness_grid.rs | 8 +- src/containers/char_grid.rs | 8 +- src/containers/cp437_grid.rs | 8 +- src/macros.rs | 2 +- 9 files changed, 311 insertions(+), 311 deletions(-) diff --git a/include/servicepoint.h b/include/servicepoint.h index 63b2226..0c6490f 100644 --- a/include/servicepoint.h +++ b/include/servicepoint.h @@ -638,7 +638,7 @@ extern "C" { /** *Clones a [`Bitmap`] instance. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Bitmap */*notnull*/ sp_bitmap_clone(struct Bitmap */*notnull*/ instance); @@ -649,7 +649,7 @@ struct Bitmap */*notnull*/ sp_bitmap_clone(struct Bitmap */*notnull*/ instance); * * The returned memory is valid for the lifetime of the bitmap. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct ByteSlice sp_bitmap_data_ref_mut(struct Bitmap */*notnull*/ instance); @@ -662,14 +662,14 @@ struct ByteSlice sp_bitmap_data_ref_mut(struct Bitmap */*notnull*/ instance); * * - `value`: the value to set all pixels to * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ void sp_bitmap_fill(struct Bitmap */*notnull*/ instance, bool value); /** *Deallocates a [`Bitmap`] instance. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ void sp_bitmap_free(struct Bitmap */*notnull*/ instance); @@ -680,7 +680,7 @@ void sp_bitmap_free(struct Bitmap */*notnull*/ instance); * * Returns NULL in case of error. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Bitmap *sp_bitmap_from_bitvec(size_t width, BitVec */*notnull*/ bitvec); @@ -697,7 +697,7 @@ struct Bitmap *sp_bitmap_from_bitvec(size_t width, BitVec */*notnull*/ bitvec); * * - when accessing `x` or `y` out of bounds * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ bool sp_bitmap_get(struct Bitmap */*notnull*/ instance, size_t x, size_t y); @@ -706,14 +706,14 @@ bool sp_bitmap_get(struct Bitmap */*notnull*/ instance, size_t x, size_t y); * * Gets the height in pixels. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ size_t sp_bitmap_height(struct Bitmap */*notnull*/ instance); /** * Consumes the Bitmap and returns the contained BitVec. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ BitVec */*notnull*/ sp_bitmap_into_bitvec(struct Bitmap */*notnull*/ bitmap); @@ -724,7 +724,7 @@ BitVec */*notnull*/ sp_bitmap_into_bitvec(struct Bitmap */*notnull*/ bitmap); * * Returns NULL in case of an error. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Packet *sp_bitmap_into_packet(struct Bitmap */*notnull*/ bitmap, size_t x, @@ -741,7 +741,7 @@ struct Packet *sp_bitmap_into_packet(struct Bitmap */*notnull*/ bitmap, * * returns: [Bitmap] that contains a copy of the provided data, or NULL in case of an error. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Bitmap *sp_bitmap_load(size_t width, size_t height, @@ -772,7 +772,7 @@ struct Bitmap *sp_bitmap_load(size_t width, * sp_bitmap_free(grid); * ``` * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Bitmap *sp_bitmap_new(size_t width, size_t height); @@ -781,7 +781,7 @@ struct Bitmap *sp_bitmap_new(size_t width, size_t height); * * returns: [Bitmap] initialized to all pixels off. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ struct Bitmap */*notnull*/ sp_bitmap_new_max_sized(void); @@ -799,7 +799,7 @@ struct Bitmap */*notnull*/ sp_bitmap_new_max_sized(void); * * - when accessing `x` or `y` out of bounds * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ void sp_bitmap_set(struct Bitmap */*notnull*/ instance, size_t x, @@ -811,7 +811,7 @@ void sp_bitmap_set(struct Bitmap */*notnull*/ instance, * * Gets the width in pixels. * - * This function is part of the bitmap module. + * This function is part of the `bitmap` module. */ size_t sp_bitmap_width(struct Bitmap */*notnull*/ instance); @@ -822,14 +822,14 @@ size_t sp_bitmap_width(struct Bitmap */*notnull*/ instance); * * The returned memory is valid for the lifetime of the bitvec. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ struct ByteSlice sp_bitvec_as_raw_mut_slice(BitVec */*notnull*/ instance); /** *Clones a [`DisplayBitVec`] instance. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ BitVec */*notnull*/ sp_bitvec_clone(BitVec */*notnull*/ instance); @@ -842,14 +842,14 @@ BitVec */*notnull*/ sp_bitvec_clone(BitVec */*notnull*/ instance); * * - `value`: the value to set all bits to * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ void sp_bitvec_fill(BitVec */*notnull*/ instance, bool value); /** *Deallocates a [`DisplayBitVec`] instance. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ void sp_bitvec_free(BitVec */*notnull*/ instance); @@ -869,7 +869,7 @@ void sp_bitvec_free(BitVec */*notnull*/ instance); * * - when accessing `index` out of bounds * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ bool sp_bitvec_get(BitVec */*notnull*/ instance, size_t index); @@ -880,7 +880,7 @@ bool sp_bitvec_get(BitVec */*notnull*/ instance, size_t index); * * Returns NULL in case of an error. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ struct Packet *sp_bitvec_into_packet(BitVec */*notnull*/ bitvec, size_t offset, @@ -892,7 +892,7 @@ struct Packet *sp_bitvec_into_packet(BitVec */*notnull*/ bitvec, * * Returns true if length is 0. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ bool sp_bitvec_is_empty(BitVec */*notnull*/ instance); @@ -901,7 +901,7 @@ bool sp_bitvec_is_empty(BitVec */*notnull*/ instance); * * Gets the length in bits. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ size_t sp_bitvec_len(BitVec */*notnull*/ instance); @@ -910,7 +910,7 @@ size_t sp_bitvec_len(BitVec */*notnull*/ instance); * * returns: [DisplayBitVec] instance containing data. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ BitVec */*notnull*/ sp_bitvec_load(struct ByteSlice data); @@ -927,7 +927,7 @@ BitVec */*notnull*/ sp_bitvec_load(struct ByteSlice data); * * - when `size` is not divisible by 8. * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ BitVec */*notnull*/ sp_bitvec_new(size_t size); @@ -945,16 +945,16 @@ BitVec */*notnull*/ sp_bitvec_new(size_t size); * * - when accessing `index` out of bounds * - * This function is part of the bitvec module. + * This function is part of the `bitvec` module. */ void sp_bitvec_set(BitVec */*notnull*/ instance, size_t index, bool value); /** *Clones a [`BrightnessGrid`] instance. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -BrightnessGrid */*notnull*/ sp_brightness_grid_clone(BrightnessGrid */*notnull*/ instance); +BrightnessGrid */*notnull*/ sp_brightnessgrid_clone(BrightnessGrid */*notnull*/ instance); /** * Calls method [`servicepoint::BrightnessGrid::data_ref_mut`]. @@ -963,9 +963,9 @@ BrightnessGrid */*notnull*/ sp_brightness_grid_clone(BrightnessGrid */*notnull*/ * * The returned memory is valid for the lifetime of the grid. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -struct ByteSlice sp_brightness_grid_data_ref_mut(BrightnessGrid */*notnull*/ instance); +struct ByteSlice sp_brightnessgrid_data_ref_mut(BrightnessGrid */*notnull*/ instance); /** * Calls method [`servicepoint::BrightnessGrid::fill`]. @@ -976,17 +976,17 @@ struct ByteSlice sp_brightness_grid_data_ref_mut(BrightnessGrid */*notnull*/ ins * * - `value`: the value to set all cells to * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -void sp_brightness_grid_fill(BrightnessGrid */*notnull*/ instance, - Brightness value); +void sp_brightnessgrid_fill(BrightnessGrid */*notnull*/ instance, + Brightness value); /** *Deallocates a [`BrightnessGrid`] instance. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -void sp_brightness_grid_free(BrightnessGrid */*notnull*/ instance); +void sp_brightnessgrid_free(BrightnessGrid */*notnull*/ instance); /** * Calls method [`servicepoint::BrightnessGrid::get`]. @@ -1002,20 +1002,20 @@ void sp_brightness_grid_free(BrightnessGrid */*notnull*/ instance); * # Panics * - When accessing `x` or `y` out of bounds. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -Brightness sp_brightness_grid_get(BrightnessGrid */*notnull*/ instance, - size_t x, - size_t y); +Brightness sp_brightnessgrid_get(BrightnessGrid */*notnull*/ instance, + size_t x, + size_t y); /** * Calls method [`servicepoint::BrightnessGrid::height`]. * * Gets the height of the grid. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -size_t sp_brightness_grid_height(BrightnessGrid */*notnull*/ instance); +size_t sp_brightnessgrid_height(BrightnessGrid */*notnull*/ instance); /** * Creates a [BrightnessGridCommand] and immediately turns that into a [Packet]. @@ -1024,11 +1024,11 @@ size_t sp_brightness_grid_height(BrightnessGrid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -struct Packet *sp_brightness_grid_into_packet(BrightnessGrid */*notnull*/ grid, - size_t x, - size_t y); +struct Packet *sp_brightnessgrid_into_packet(BrightnessGrid */*notnull*/ grid, + size_t x, + size_t y); /** * Loads a [BrightnessGrid] with the specified dimensions from the provided data. @@ -1037,11 +1037,11 @@ struct Packet *sp_brightness_grid_into_packet(BrightnessGrid */*notnull*/ grid, * * returns: new [BrightnessGrid] instance, or NULL in case of an error. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -BrightnessGrid *sp_brightness_grid_load(size_t width, - size_t height, - struct ByteSlice data); +BrightnessGrid *sp_brightnessgrid_load(size_t width, + size_t height, + struct ByteSlice data); /** * Creates a new [BrightnessGrid] with the specified dimensions. @@ -1062,9 +1062,9 @@ BrightnessGrid *sp_brightness_grid_load(size_t width, * sp_udp_free(connection); * ``` * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -BrightnessGrid */*notnull*/ sp_brightness_grid_new(size_t width, size_t height); +BrightnessGrid */*notnull*/ sp_brightnessgrid_new(size_t width, size_t height); /** * Calls method [`servicepoint::BrightnessGrid::set`]. @@ -1082,28 +1082,28 @@ BrightnessGrid */*notnull*/ sp_brightness_grid_new(size_t width, size_t height); * * - When accessing `x` or `y` out of bounds. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -void sp_brightness_grid_set(BrightnessGrid */*notnull*/ instance, - size_t x, - size_t y, - Brightness value); +void sp_brightnessgrid_set(BrightnessGrid */*notnull*/ instance, + size_t x, + size_t y, + Brightness value); /** * Calls method [`servicepoint::BrightnessGrid::width`]. * * Gets the width of the grid. * - * This function is part of the brightness_grid module. + * This function is part of the `brightnessgrid` module. */ -size_t sp_brightness_grid_width(BrightnessGrid */*notnull*/ instance); +size_t sp_brightnessgrid_width(BrightnessGrid */*notnull*/ instance); /** *Clones a [`CharGrid`] instance. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -CharGrid */*notnull*/ sp_char_grid_clone(CharGrid */*notnull*/ instance); +CharGrid */*notnull*/ sp_chargrid_clone(CharGrid */*notnull*/ instance); /** * Calls method [`servicepoint::CharGrid::fill`]. @@ -1115,16 +1115,16 @@ CharGrid */*notnull*/ sp_char_grid_clone(CharGrid */*notnull*/ instance); * - `value`: the value to set all cells to * - when providing values that cannot be converted to Rust's `char`. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -void sp_char_grid_fill(CharGrid */*notnull*/ instance, uint32_t value); +void sp_chargrid_fill(CharGrid */*notnull*/ instance, uint32_t value); /** *Deallocates a [`CharGrid`] instance. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -void sp_char_grid_free(CharGrid */*notnull*/ instance); +void sp_chargrid_free(CharGrid */*notnull*/ instance); /** * Calls method [`servicepoint::CharGrid::get`]. @@ -1139,18 +1139,18 @@ void sp_char_grid_free(CharGrid */*notnull*/ instance); * * - when accessing `x` or `y` out of bounds * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -uint32_t sp_char_grid_get(CharGrid */*notnull*/ instance, size_t x, size_t y); +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. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -size_t sp_char_grid_height(CharGrid */*notnull*/ instance); +size_t sp_chargrid_height(CharGrid */*notnull*/ instance); /** * Creates a [CharGridCommand] and immediately turns that into a [Packet]. @@ -1159,20 +1159,20 @@ size_t sp_char_grid_height(CharGrid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -struct Packet *sp_char_grid_into_packet(CharGrid */*notnull*/ grid, - size_t x, - size_t y); +struct Packet *sp_chargrid_into_packet(CharGrid */*notnull*/ grid, + size_t x, + size_t y); /** * Loads a [CharGrid] with the specified dimensions from the provided data. * * returns: new CharGrid or NULL in case of an error * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -CharGrid *sp_char_grid_load(size_t width, size_t height, struct ByteSlice data); +CharGrid *sp_chargrid_load(size_t width, size_t height, struct ByteSlice data); /** * Creates a new [CharGrid] with the specified dimensions. @@ -1188,9 +1188,9 @@ CharGrid *sp_char_grid_load(size_t width, size_t height, struct ByteSlice data); * sp_char_grid_free(grid); * ``` * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -CharGrid */*notnull*/ sp_char_grid_new(size_t width, size_t height); +CharGrid */*notnull*/ sp_chargrid_new(size_t width, size_t height); /** * Calls method [`servicepoint::CharGrid::set`]. @@ -1209,33 +1209,33 @@ CharGrid */*notnull*/ sp_char_grid_new(size_t width, size_t height); * - when accessing `x` or `y` out of bounds * - when providing values that cannot be converted to Rust's `char`. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -void sp_char_grid_set(CharGrid */*notnull*/ instance, - size_t x, - size_t y, - uint32_t value); +void sp_chargrid_set(CharGrid */*notnull*/ instance, + size_t x, + size_t y, + uint32_t value); /** * Calls method [`servicepoint::CharGrid::width`]. * * Gets the width of the grid. * - * This function is part of the char_grid module. + * This function is part of the `chargrid` module. */ -size_t sp_char_grid_width(CharGrid */*notnull*/ instance); +size_t sp_chargrid_width(CharGrid */*notnull*/ instance); /** *Clones a [`BitmapCommand`] instance. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ struct BitmapCommand */*notnull*/ sp_cmd_bitmap_clone(struct BitmapCommand */*notnull*/ instance); /** *Deallocates a [`BitmapCommand`] instance. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ void sp_cmd_bitmap_free(struct BitmapCommand */*notnull*/ instance); @@ -1245,7 +1245,7 @@ void sp_cmd_bitmap_free(struct BitmapCommand */*notnull*/ instance); * * Rust equivalent: `BitmapCommand::from(bitmap)` * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ struct BitmapCommand */*notnull*/ sp_cmd_bitmap_from_bitmap(struct Bitmap */*notnull*/ bitmap); @@ -1255,21 +1255,21 @@ struct BitmapCommand */*notnull*/ sp_cmd_bitmap_from_bitmap(struct Bitmap */*not * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ struct Bitmap */*notnull*/ sp_cmd_bitmap_get_bitmap_mut(struct BitmapCommand */*notnull*/ instance); /** * Gets the value of field `compression` of the [`servicepoint::BitmapCommand`]. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ CompressionCode sp_cmd_bitmap_get_compression(struct BitmapCommand */*notnull*/ instance); /** * Reads the origin field of the [`BitmapCommand`]. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ void sp_cmd_bitmap_get_origin(struct BitmapCommand */*notnull*/ command, size_t */*notnull*/ origin_x, @@ -1282,7 +1282,7 @@ void sp_cmd_bitmap_get_origin(struct BitmapCommand */*notnull*/ command, * * Returns: a new [BitmapCommand] instance. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ struct BitmapCommand */*notnull*/ sp_cmd_bitmap_new(struct Bitmap */*notnull*/ bitmap, size_t origin_x, @@ -1293,7 +1293,7 @@ struct BitmapCommand */*notnull*/ sp_cmd_bitmap_new(struct Bitmap */*notnull*/ b * Sets the value of field `bitmap` of the [`servicepoint::BitmapCommand`]. * The provided value is moved into the instance, potentially invalidating previously taken references. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ void sp_cmd_bitmap_set_bitmap(struct BitmapCommand */*notnull*/ instance, struct Bitmap */*notnull*/ value); @@ -1301,7 +1301,7 @@ void sp_cmd_bitmap_set_bitmap(struct BitmapCommand */*notnull*/ instance, /** * Sets the value of field `compression` of the [`servicepoint::BitmapCommand`]. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ void sp_cmd_bitmap_set_compression(struct BitmapCommand */*notnull*/ instance, CompressionCode value); @@ -1309,7 +1309,7 @@ void sp_cmd_bitmap_set_compression(struct BitmapCommand */*notnull*/ instance, /** * Overwrites the origin field of the [`BitmapCommand`]. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ void sp_cmd_bitmap_set_origin(struct BitmapCommand */*notnull*/ command, size_t origin_x, @@ -1320,21 +1320,21 @@ void sp_cmd_bitmap_set_origin(struct BitmapCommand */*notnull*/ command, * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the cmd_bitmap module. + * This function is part of the `cmd_bitmap` module. */ struct Packet *sp_cmd_bitmap_try_into_packet(struct BitmapCommand */*notnull*/ command); /** *Clones a [`BitVecCommand`] instance. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ struct BitVecCommand */*notnull*/ sp_cmd_bitvec_clone(struct BitVecCommand */*notnull*/ instance); /** *Deallocates a [`BitVecCommand`] instance. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ void sp_cmd_bitvec_free(struct BitVecCommand */*notnull*/ instance); @@ -1344,28 +1344,28 @@ void sp_cmd_bitvec_free(struct BitVecCommand */*notnull*/ instance); * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ BitVec */*notnull*/ sp_cmd_bitvec_get_bitvec_mut(struct BitVecCommand */*notnull*/ instance); /** * Gets the value of field `compression` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ CompressionCode sp_cmd_bitvec_get_compression(struct BitVecCommand */*notnull*/ instance); /** * Gets the value of field `offset` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ Offset sp_cmd_bitvec_get_offset(struct BitVecCommand */*notnull*/ instance); /** * Gets the value of field `operation` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ BinaryOperation sp_cmd_bitvec_get_operation(struct BitVecCommand */*notnull*/ instance); @@ -1383,7 +1383,7 @@ BinaryOperation sp_cmd_bitvec_get_operation(struct BitVecCommand */*notnull*/ in * * The contained [`DisplayBitVec`] is always uncompressed. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ struct BitVecCommand */*notnull*/ sp_cmd_bitvec_new(BitVec */*notnull*/ bitvec, size_t offset, @@ -1394,7 +1394,7 @@ struct BitVecCommand */*notnull*/ sp_cmd_bitvec_new(BitVec */*notnull*/ bitvec, * Sets the value of field `bitvec` of the [`servicepoint::BitVecCommand`]. * The provided value is moved into the instance, potentially invalidating previously taken references. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ void sp_cmd_bitvec_set_bitvec(struct BitVecCommand */*notnull*/ instance, BitVec */*notnull*/ value); @@ -1402,7 +1402,7 @@ void sp_cmd_bitvec_set_bitvec(struct BitVecCommand */*notnull*/ instance, /** * Sets the value of field `compression` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ void sp_cmd_bitvec_set_compression(struct BitVecCommand */*notnull*/ instance, CompressionCode value); @@ -1410,7 +1410,7 @@ void sp_cmd_bitvec_set_compression(struct BitVecCommand */*notnull*/ instance, /** * Sets the value of field `offset` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ void sp_cmd_bitvec_set_offset(struct BitVecCommand */*notnull*/ instance, Offset value); @@ -1418,7 +1418,7 @@ void sp_cmd_bitvec_set_offset(struct BitVecCommand */*notnull*/ instance, /** * Sets the value of field `operation` of the [`servicepoint::BitVecCommand`]. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ void sp_cmd_bitvec_set_operation(struct BitVecCommand */*notnull*/ instance, BinaryOperation value); @@ -1428,48 +1428,31 @@ void sp_cmd_bitvec_set_operation(struct BitVecCommand */*notnull*/ instance, * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the cmd_bitvec module. + * This function is part of the `cmd_bitvec` module. */ struct Packet *sp_cmd_bitvec_try_into_packet(struct BitVecCommand */*notnull*/ command); /** - * Gets the value of field `brightness` of the [`servicepoint::GlobalBrightnessCommand`]. + *Clones a [`BrightnessGridCommand`] instance. * - * This function is part of the cmd_brightness_global module. + * This function is part of the `cmd_brightnessgrid` module. */ -Brightness sp_cmd_brightness_global_get_brightness(struct GlobalBrightnessCommand */*notnull*/ instance); +struct BrightnessGridCommand */*notnull*/ sp_cmd_brightnessgrid_clone(struct BrightnessGridCommand */*notnull*/ instance); /** - * Turns the command into a packet + *Deallocates a [`BrightnessGridCommand`] instance. * - * This function is part of the cmd_brightness_global module. + * This function is part of the `cmd_brightnessgrid` module. */ -struct Packet */*notnull*/ sp_cmd_brightness_global_into_packet(struct GlobalBrightnessCommand */*notnull*/ command); - -/** - * Set the brightness of all tiles to the same value. - * - * Returns: a new [GlobalBrightnessCommand] instance. - * - * This function is part of the cmd_brightness_global module. - */ -struct GlobalBrightnessCommand */*notnull*/ sp_cmd_brightness_global_new(Brightness brightness); - -/** - * Sets the value of field `brightness` of the [`servicepoint::GlobalBrightnessCommand`]. - * - * This function is part of the cmd_brightness_global module. - */ -void sp_cmd_brightness_global_set_brightness(struct GlobalBrightnessCommand */*notnull*/ instance, - Brightness value); +void sp_cmd_brightnessgrid_free(struct BrightnessGridCommand */*notnull*/ instance); /** * Moves the provided [BrightnessGrid] into a new [BrightnessGridCommand], * leaving other fields as their default values. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_from_grid(BrightnessGrid */*notnull*/ grid); +struct BrightnessGridCommand */*notnull*/ sp_cmd_brightnessgrid_from_grid(BrightnessGrid */*notnull*/ grid); /** * Gets a reference to the field `grid` of the [`servicepoint::BrightnessGridCommand`]. @@ -1477,27 +1460,27 @@ struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_from_grid(Brigh * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -BrightnessGrid */*notnull*/ sp_cmd_brightness_grid_get_grid_mut(struct BrightnessGridCommand */*notnull*/ instance); +BrightnessGrid */*notnull*/ sp_cmd_brightnessgrid_get_grid_mut(struct BrightnessGridCommand */*notnull*/ instance); /** * Reads the origin field of the [`BrightnessGridCommand`]. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -void sp_cmd_brightness_grid_get_origin(struct BrightnessGridCommand */*notnull*/ command, - size_t */*notnull*/ origin_x, - size_t */*notnull*/ origin_y); +void sp_cmd_brightnessgrid_get_origin(struct BrightnessGridCommand */*notnull*/ command, + size_t */*notnull*/ origin_x, + size_t */*notnull*/ origin_y); /** * Tries to turn a [BrightnessGridCommand] into a [Packet]. * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -struct Packet *sp_cmd_brightness_grid_into_packet(struct BrightnessGridCommand */*notnull*/ command); +struct Packet *sp_cmd_brightnessgrid_into_packet(struct BrightnessGridCommand */*notnull*/ command); /** * Set the brightness of individual tiles in a rectangular area of the display. @@ -1506,51 +1489,51 @@ struct Packet *sp_cmd_brightness_grid_into_packet(struct BrightnessGridCommand * * * Returns: a new [BrightnessGridCommand] instance. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_new(BrightnessGrid */*notnull*/ grid, - size_t origin_x, - size_t origin_y); +struct BrightnessGridCommand */*notnull*/ sp_cmd_brightnessgrid_new(BrightnessGrid */*notnull*/ grid, + size_t origin_x, + size_t origin_y); /** * Sets the value of field `grid` of the [`servicepoint::BrightnessGridCommand`]. * The provided value is moved into the instance, potentially invalidating previously taken references. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -void sp_cmd_brightness_grid_set_grid(struct BrightnessGridCommand */*notnull*/ instance, - BrightnessGrid */*notnull*/ value); +void sp_cmd_brightnessgrid_set_grid(struct BrightnessGridCommand */*notnull*/ instance, + BrightnessGrid */*notnull*/ value); /** * Overwrites the origin field of the [`BrightnessGridCommand`]. * - * This function is part of the cmd_brightness_grid module. + * This function is part of the `cmd_brightnessgrid` module. */ -void sp_cmd_brightness_grid_set_origin(struct BrightnessGridCommand */*notnull*/ command, - size_t origin_x, - size_t origin_y); +void sp_cmd_brightnessgrid_set_origin(struct BrightnessGridCommand */*notnull*/ command, + size_t origin_x, + size_t origin_y); /** - *Clones a [`BrightnessGridCommand`] instance. + *Clones a [`CharGridCommand`] instance. * - * This function is part of the cmd_brightnessgrid module. + * This function is part of the `cmd_chargrid` module. */ -struct BrightnessGridCommand */*notnull*/ sp_cmd_brightnessgrid_clone(struct BrightnessGridCommand */*notnull*/ instance); +struct CharGridCommand */*notnull*/ sp_cmd_chargrid_clone(struct CharGridCommand */*notnull*/ instance); /** - *Deallocates a [`BrightnessGridCommand`] instance. + *Deallocates a [`CharGridCommand`] instance. * - * This function is part of the cmd_brightnessgrid module. + * This function is part of the `cmd_chargrid` module. */ -void sp_cmd_brightnessgrid_free(struct BrightnessGridCommand */*notnull*/ instance); +void sp_cmd_chargrid_free(struct CharGridCommand */*notnull*/ instance); /** * Moves the provided [CharGrid] into a new [CharGridCommand], * leaving other fields as their default values. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -struct CharGridCommand */*notnull*/ sp_cmd_char_grid_from_grid(CharGrid */*notnull*/ grid); +struct CharGridCommand */*notnull*/ sp_cmd_chargrid_from_grid(CharGrid */*notnull*/ grid); /** * Gets a reference to the field `grid` of the [`servicepoint::CharGridCommand`]. @@ -1558,18 +1541,18 @@ struct CharGridCommand */*notnull*/ sp_cmd_char_grid_from_grid(CharGrid */*notnu * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -CharGrid */*notnull*/ sp_cmd_char_grid_get_grid_mut(struct CharGridCommand */*notnull*/ instance); +CharGrid */*notnull*/ sp_cmd_chargrid_get_grid_mut(struct CharGridCommand */*notnull*/ instance); /** * Reads the origin field of the [`CharGridCommand`]. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -void sp_cmd_char_grid_get_origin(struct CharGridCommand */*notnull*/ command, - size_t */*notnull*/ origin_x, - size_t */*notnull*/ origin_y); +void sp_cmd_chargrid_get_origin(struct CharGridCommand */*notnull*/ command, + size_t */*notnull*/ origin_x, + size_t */*notnull*/ origin_y); /** * Show UTF-8 encoded text on the screen. @@ -1578,64 +1561,50 @@ void sp_cmd_char_grid_get_origin(struct CharGridCommand */*notnull*/ command, * * Returns: a new [CharGridCommand] instance. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -struct CharGridCommand */*notnull*/ sp_cmd_char_grid_new(CharGrid */*notnull*/ grid, - size_t origin_x, - size_t origin_y); +struct CharGridCommand */*notnull*/ sp_cmd_chargrid_new(CharGrid */*notnull*/ grid, + size_t origin_x, + size_t origin_y); /** * Sets the value of field `grid` of the [`servicepoint::CharGridCommand`]. * The provided value is moved into the instance, potentially invalidating previously taken references. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -void sp_cmd_char_grid_set_grid(struct CharGridCommand */*notnull*/ instance, - CharGrid */*notnull*/ value); +void sp_cmd_chargrid_set_grid(struct CharGridCommand */*notnull*/ instance, + CharGrid */*notnull*/ value); /** * Overwrites the origin field of the [`CharGridCommand`]. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -void sp_cmd_char_grid_set_origin(struct CharGridCommand */*notnull*/ command, - size_t origin_x, - size_t origin_y); +void sp_cmd_chargrid_set_origin(struct CharGridCommand */*notnull*/ command, + size_t origin_x, + size_t origin_y); /** * Tries to turn a [CharGridCommand] into a [Packet]. * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the cmd_char_grid module. + * This function is part of the `cmd_chargrid` module. */ -struct Packet *sp_cmd_char_grid_try_into_packet(struct CharGridCommand */*notnull*/ command); - -/** - *Clones a [`CharGridCommand`] instance. - * - * This function is part of the cmd_chargrid module. - */ -struct CharGridCommand */*notnull*/ sp_cmd_chargrid_clone(struct CharGridCommand */*notnull*/ instance); - -/** - *Deallocates a [`CharGridCommand`] instance. - * - * This function is part of the cmd_chargrid module. - */ -void sp_cmd_chargrid_free(struct CharGridCommand */*notnull*/ instance); +struct Packet *sp_cmd_chargrid_try_into_packet(struct CharGridCommand */*notnull*/ command); /** *Clones a [`ClearCommand`] instance. * - * This function is part of the cmd_clear module. + * This function is part of the `cmd_clear` module. */ struct ClearCommand */*notnull*/ sp_cmd_clear_clone(struct ClearCommand */*notnull*/ instance); /** *Deallocates a [`ClearCommand`] instance. * - * This function is part of the cmd_clear module. + * This function is part of the `cmd_clear` module. */ void sp_cmd_clear_free(struct ClearCommand */*notnull*/ instance); @@ -1646,17 +1615,31 @@ void sp_cmd_clear_free(struct ClearCommand */*notnull*/ instance); * * Returns: a new [`ClearCommand`] instance. * - * This function is part of the cmd_clear module. + * This function is part of the `cmd_clear` module. */ struct ClearCommand */*notnull*/ sp_cmd_clear_new(void); +/** + *Clones a [`Cp437GridCommand`] instance. + * + * This function is part of the `cmd_cp437grid` module. + */ +struct Cp437GridCommand */*notnull*/ sp_cmd_cp437grid_clone(struct Cp437GridCommand */*notnull*/ instance); + +/** + *Deallocates a [`Cp437GridCommand`] instance. + * + * This function is part of the `cmd_cp437grid` module. + */ +void sp_cmd_cp437grid_free(struct Cp437GridCommand */*notnull*/ instance); + /** * Moves the provided [Cp437Grid] into a new [Cp437GridCommand], * leaving other fields as their default values. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_from_grid(Cp437Grid */*notnull*/ grid); +struct Cp437GridCommand */*notnull*/ sp_cmd_cp437grid_from_grid(Cp437Grid */*notnull*/ grid); /** * Gets a reference to the field `grid` of the [`servicepoint::Cp437GridCommand`]. @@ -1664,18 +1647,18 @@ struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_from_grid(Cp437Grid */*no * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -Cp437Grid */*notnull*/ sp_cmd_cp437_grid_get_grid_mut(struct Cp437GridCommand */*notnull*/ instance); +Cp437Grid */*notnull*/ sp_cmd_cp437grid_get_grid_mut(struct Cp437GridCommand */*notnull*/ instance); /** * Reads the origin field of the [`Cp437GridCommand`]. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -void sp_cmd_cp437_grid_get_origin(struct Cp437GridCommand */*notnull*/ command, - size_t */*notnull*/ origin_x, - size_t */*notnull*/ origin_y); +void sp_cmd_cp437grid_get_origin(struct Cp437GridCommand */*notnull*/ command, + size_t */*notnull*/ origin_x, + size_t */*notnull*/ origin_y); /** * Show text on the screen. @@ -1684,64 +1667,50 @@ void sp_cmd_cp437_grid_get_origin(struct Cp437GridCommand */*notnull*/ command, * * The origin is relative to the top-left of the display. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_new(Cp437Grid */*notnull*/ grid, - size_t origin_x, - size_t origin_y); +struct Cp437GridCommand */*notnull*/ sp_cmd_cp437grid_new(Cp437Grid */*notnull*/ grid, + size_t origin_x, + size_t origin_y); /** * Sets the value of field `grid` of the [`servicepoint::Cp437GridCommand`]. * The provided value is moved into the instance, potentially invalidating previously taken references. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -void sp_cmd_cp437_grid_set_grid(struct Cp437GridCommand */*notnull*/ instance, - Cp437Grid */*notnull*/ value); +void sp_cmd_cp437grid_set_grid(struct Cp437GridCommand */*notnull*/ instance, + Cp437Grid */*notnull*/ value); /** * Overwrites the origin field of the [`Cp437GridCommand`]. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -void sp_cmd_cp437_grid_set_origin(struct Cp437GridCommand */*notnull*/ command, - size_t origin_x, - size_t origin_y); +void sp_cmd_cp437grid_set_origin(struct Cp437GridCommand */*notnull*/ command, + size_t origin_x, + size_t origin_y); /** * Tries to turn a [Cp437GridCommand] into a [Packet]. * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the cmd_cp437_grid module. + * This function is part of the `cmd_cp437grid` module. */ -struct Packet *sp_cmd_cp437_grid_try_into_packet(struct Cp437GridCommand */*notnull*/ command); - -/** - *Clones a [`Cp437GridCommand`] instance. - * - * This function is part of the cmd_cp437grid module. - */ -struct Cp437GridCommand */*notnull*/ sp_cmd_cp437grid_clone(struct Cp437GridCommand */*notnull*/ instance); - -/** - *Deallocates a [`Cp437GridCommand`] instance. - * - * This function is part of the cmd_cp437grid module. - */ -void sp_cmd_cp437grid_free(struct Cp437GridCommand */*notnull*/ instance); +struct Packet *sp_cmd_cp437grid_try_into_packet(struct Cp437GridCommand */*notnull*/ command); /** *Clones a [`FadeOutCommand`] instance. * - * This function is part of the cmd_fadeout module. + * This function is part of the `cmd_fadeout` module. */ struct FadeOutCommand */*notnull*/ sp_cmd_fadeout_clone(struct FadeOutCommand */*notnull*/ instance); /** *Deallocates a [`FadeOutCommand`] instance. * - * This function is part of the cmd_fadeout module. + * This function is part of the `cmd_fadeout` module. */ void sp_cmd_fadeout_free(struct FadeOutCommand */*notnull*/ instance); @@ -1750,7 +1719,7 @@ void sp_cmd_fadeout_free(struct FadeOutCommand */*notnull*/ instance); * * Returns: a new [`FadeOutCommand`] instance. * - * This function is part of the cmd_fadeout module. + * This function is part of the `cmd_fadeout` module. */ struct FadeOutCommand */*notnull*/ sp_cmd_fadeout_new(void); @@ -1759,7 +1728,7 @@ struct FadeOutCommand */*notnull*/ sp_cmd_fadeout_new(void); * * returns: a new [SPCommand] instance. * - * This function is part of the cmd_generic module. + * This function is part of the `cmd_generic` module. */ struct Command sp_cmd_generic_clone(struct Command command); @@ -1775,7 +1744,7 @@ struct Command sp_cmd_generic_clone(struct Command command); * sp_command_free(c); * ``` * - * This function is part of the cmd_generic module. + * This function is part of the `cmd_generic` module. */ void sp_cmd_generic_free(struct Command command); @@ -1785,7 +1754,7 @@ void sp_cmd_generic_free(struct Command command); * * Returns tag [CommandTag::Invalid] in case of an error. * - * This function is part of the cmd_generic module. + * This function is part of the `cmd_generic` module. */ struct Packet *sp_cmd_generic_into_packet(struct Command command); @@ -1796,35 +1765,66 @@ struct Packet *sp_cmd_generic_into_packet(struct Command command); * * Returns: pointer to new [SPCommand] instance or NULL if parsing failed. * - * This function is part of the cmd_generic module. + * This function is part of the `cmd_generic` module. */ struct Command sp_cmd_generic_try_from_packet(struct Packet */*notnull*/ packet); /** *Clones a [`GlobalBrightnessCommand`] instance. * - * This function is part of the cmd_globalbrightness module. + * This function is part of the `cmd_globalbrightness` module. */ struct GlobalBrightnessCommand */*notnull*/ sp_cmd_globalbrightness_clone(struct GlobalBrightnessCommand */*notnull*/ instance); /** *Deallocates a [`GlobalBrightnessCommand`] instance. * - * This function is part of the cmd_globalbrightness module. + * This function is part of the `cmd_globalbrightness` module. */ void sp_cmd_globalbrightness_free(struct GlobalBrightnessCommand */*notnull*/ instance); +/** + * Gets the value of field `brightness` of the [`servicepoint::GlobalBrightnessCommand`]. + * + * This function is part of the `cmd_globalbrightness` module. + */ +Brightness sp_cmd_globalbrightness_get_brightness(struct GlobalBrightnessCommand */*notnull*/ instance); + +/** + * Turns the command into a packet + * + * This function is part of the `cmd_globalbrightness` module. + */ +struct Packet */*notnull*/ sp_cmd_globalbrightness_into_packet(struct GlobalBrightnessCommand */*notnull*/ command); + +/** + * Set the brightness of all tiles to the same value. + * + * Returns: a new [GlobalBrightnessCommand] instance. + * + * This function is part of the `cmd_globalbrightness` module. + */ +struct GlobalBrightnessCommand */*notnull*/ sp_cmd_globalbrightness_new(Brightness brightness); + +/** + * Sets the value of field `brightness` of the [`servicepoint::GlobalBrightnessCommand`]. + * + * This function is part of the `cmd_globalbrightness` module. + */ +void sp_cmd_globalbrightness_set_brightness(struct GlobalBrightnessCommand */*notnull*/ instance, + Brightness value); + /** *Clones a [`HardResetCommand`] instance. * - * This function is part of the cmd_hardreset module. + * This function is part of the `cmd_hardreset` module. */ struct HardResetCommand */*notnull*/ sp_cmd_hardreset_clone(struct HardResetCommand */*notnull*/ instance); /** *Deallocates a [`HardResetCommand`] instance. * - * This function is part of the cmd_hardreset module. + * This function is part of the `cmd_hardreset` module. */ void sp_cmd_hardreset_free(struct HardResetCommand */*notnull*/ instance); @@ -1835,16 +1835,16 @@ void sp_cmd_hardreset_free(struct HardResetCommand */*notnull*/ instance); * * Returns: a new [`HardResetCommand`] instance. * - * This function is part of the cmd_hardreset module. + * This function is part of the `cmd_hardreset` module. */ struct HardResetCommand */*notnull*/ sp_cmd_hardreset_new(void); /** *Clones a [`Cp437Grid`] instance. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -Cp437Grid */*notnull*/ sp_cp437_grid_clone(Cp437Grid */*notnull*/ instance); +Cp437Grid */*notnull*/ sp_cp437grid_clone(Cp437Grid */*notnull*/ instance); /** * Calls method [`servicepoint::Cp437Grid::data_ref_mut`]. @@ -1853,9 +1853,9 @@ Cp437Grid */*notnull*/ sp_cp437_grid_clone(Cp437Grid */*notnull*/ instance); * * The returned memory is valid for the lifetime of the instance. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -struct ByteSlice sp_cp437_grid_data_ref_mut(Cp437Grid */*notnull*/ instance); +struct ByteSlice sp_cp437grid_data_ref_mut(Cp437Grid */*notnull*/ instance); /** * Calls method [`servicepoint::Cp437Grid::fill`]. @@ -1867,16 +1867,16 @@ struct ByteSlice sp_cp437_grid_data_ref_mut(Cp437Grid */*notnull*/ instance); * - `cp437_grid`: instance to write to * - `value`: the value to set all cells to * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -void sp_cp437_grid_fill(Cp437Grid */*notnull*/ instance, uint8_t value); +void sp_cp437grid_fill(Cp437Grid */*notnull*/ instance, uint8_t value); /** *Deallocates a [`Cp437Grid`] instance. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -void sp_cp437_grid_free(Cp437Grid */*notnull*/ instance); +void sp_cp437grid_free(Cp437Grid */*notnull*/ instance); /** * Calls method [`servicepoint::Cp437Grid::get`]. @@ -1891,18 +1891,18 @@ void sp_cp437_grid_free(Cp437Grid */*notnull*/ instance); * * - when accessing `x` or `y` out of bounds * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -uint8_t sp_cp437_grid_get(Cp437Grid */*notnull*/ instance, size_t x, size_t y); +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. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -size_t sp_cp437_grid_height(Cp437Grid */*notnull*/ instance); +size_t sp_cp437grid_height(Cp437Grid */*notnull*/ instance); /** * Creates a [Cp437GridCommand] and immediately turns that into a [Packet]. @@ -1911,29 +1911,29 @@ size_t sp_cp437_grid_height(Cp437Grid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -struct Packet *sp_cp437_grid_into_packet(Cp437Grid */*notnull*/ grid, - size_t x, - size_t y); +struct Packet *sp_cp437grid_into_packet(Cp437Grid */*notnull*/ grid, + size_t x, + size_t y); /** * Loads a [Cp437Grid] with the specified dimensions from the provided data. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -Cp437Grid *sp_cp437_grid_load(size_t width, - size_t height, - struct ByteSlice data); +Cp437Grid *sp_cp437grid_load(size_t width, + size_t height, + struct ByteSlice data); /** * Creates a new [Cp437Grid] with the specified dimensions. * * returns: [Cp437Grid] initialized to 0. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -Cp437Grid */*notnull*/ sp_cp437_grid_new(size_t width, size_t height); +Cp437Grid */*notnull*/ sp_cp437grid_new(size_t width, size_t height); /** * Calls method [`servicepoint::Cp437Grid::set`]. @@ -1951,41 +1951,41 @@ Cp437Grid */*notnull*/ sp_cp437_grid_new(size_t width, size_t height); * * - when accessing `x` or `y` out of bounds * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -void sp_cp437_grid_set(Cp437Grid */*notnull*/ instance, - size_t x, - size_t y, - uint8_t value); +void sp_cp437grid_set(Cp437Grid */*notnull*/ instance, + size_t x, + size_t y, + uint8_t value); /** * Calls method [`servicepoint::Cp437Grid::width`]. * * Gets the width of the grid. * - * This function is part of the cp437_grid module. + * This function is part of the `cp437grid` module. */ -size_t sp_cp437_grid_width(Cp437Grid */*notnull*/ instance); +size_t sp_cp437grid_width(Cp437Grid */*notnull*/ instance); /** * Call this function at the beginning of main to enable rust logging controlled by the * `RUST_LOG` environment variable. See [env_logger](https://docs.rs/env_logger/latest/env_logger/). * - * This function is part of the envlogger module. + * This function is part of the `envlogger` module. */ void sp_envlogger_init(void); /** *Clones a [`Packet`] instance. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct Packet */*notnull*/ sp_packet_clone(struct Packet */*notnull*/ instance); /** *Deallocates a [`Packet`] instance. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ void sp_packet_free(struct Packet */*notnull*/ instance); @@ -1994,7 +1994,7 @@ void sp_packet_free(struct Packet */*notnull*/ instance); * * returns: new instance. Will never return null. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct Packet */*notnull*/ sp_packet_from_parts(struct Header header, struct ByteSlice payload); @@ -2002,7 +2002,7 @@ struct Packet */*notnull*/ sp_packet_from_parts(struct Header header, /** * Gets the value of field `header` of the [`servicepoint::Packet`]. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct Header sp_packet_get_header(struct Packet */*notnull*/ instance); @@ -2012,7 +2012,7 @@ struct Header sp_packet_get_header(struct Packet */*notnull*/ instance); * - The returned reference inherits the lifetime of object in which it is contained. * - The returned pointer may not be used in a function that consumes the instance, e.g. to create a command. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct Header */*notnull*/ sp_packet_get_header_mut(struct Packet */*notnull*/ instance); @@ -2023,7 +2023,7 @@ struct Header */*notnull*/ sp_packet_get_header_mut(struct Packet */*notnull*/ i * * The returned memory can be changed and will be valid until a new payload is set. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct ByteSlice sp_packet_get_payload(struct Packet */*notnull*/ packet); @@ -2034,7 +2034,7 @@ struct ByteSlice sp_packet_get_payload(struct Packet */*notnull*/ packet); * * - if the buffer is not big enough to hold header+payload. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ size_t sp_packet_serialize_to(struct Packet */*notnull*/ packet, struct ByteSlice buffer); @@ -2042,7 +2042,7 @@ size_t sp_packet_serialize_to(struct Packet */*notnull*/ packet, /** * Sets the value of field `header` of the [`servicepoint::Packet`]. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ void sp_packet_set_header(struct Packet */*notnull*/ instance, struct Header value); @@ -2052,7 +2052,7 @@ void sp_packet_set_header(struct Packet */*notnull*/ instance, * * This makes previous payload pointers invalid. * - * This function is part of the packet module. + * This function is part of the `packet` module. */ void sp_packet_set_payload(struct Packet */*notnull*/ packet, struct ByteSlice data); @@ -2062,7 +2062,7 @@ void sp_packet_set_payload(struct Packet */*notnull*/ packet, * * returns: NULL in case of an error, pointer to the allocated packet otherwise * - * This function is part of the packet module. + * This function is part of the `packet` module. */ struct Packet *sp_packet_try_load(struct ByteSlice data); @@ -2071,7 +2071,7 @@ struct Packet *sp_packet_try_load(struct ByteSlice data); * * If the provided value is not valid, false is returned and result is not changed. * - * This function is part of the sp module. + * This function is part of the `sp` module. */ bool sp_sp_u16_to_command_code(uint16_t code, CommandCode *result); @@ -2079,7 +2079,7 @@ bool sp_sp_u16_to_command_code(uint16_t code, /** *Deallocates a [`UdpSocket`] instance. * - * This function is part of the udp module. + * This function is part of the `udp` module. */ void sp_udp_free(struct UdpSocket */*notnull*/ instance); @@ -2096,7 +2096,7 @@ void sp_udp_free(struct UdpSocket */*notnull*/ instance); * sp_udp_send_command(connection, sp_command_clear()); * ``` * - * This function is part of the udp module. + * This function is part of the `udp` module. */ struct UdpSocket *sp_udp_open(char */*notnull*/ host); @@ -2113,7 +2113,7 @@ struct UdpSocket *sp_udp_open(char */*notnull*/ host); * sp_udp_send_command(connection, sp_command_clear()); * ``` * - * This function is part of the udp module. + * This function is part of the `udp` module. */ struct UdpSocket *sp_udp_open_ipv4(uint8_t ip1, uint8_t ip2, @@ -2134,7 +2134,7 @@ struct UdpSocket *sp_udp_open_ipv4(uint8_t ip1, * sp_udp_send_command(connection, sp_command_brightness(5)); * ``` * - * This function is part of the udp module. + * This function is part of the `udp` module. */ bool sp_udp_send_command(struct UdpSocket */*notnull*/ connection, struct Command command); @@ -2150,7 +2150,7 @@ bool sp_udp_send_command(struct UdpSocket */*notnull*/ connection, * sp_udp_send_header(connection, sp_command_brightness(5)); * ``` * - * This function is part of the udp module. + * This function is part of the `udp` module. */ bool sp_udp_send_header(struct UdpSocket */*notnull*/ udp_connection, struct Header header); @@ -2162,7 +2162,7 @@ bool sp_udp_send_header(struct UdpSocket */*notnull*/ udp_connection, * * returns: true in case of success * - * This function is part of the udp module. + * This function is part of the `udp` module. */ bool sp_udp_send_packet(struct UdpSocket */*notnull*/ connection, struct Packet */*notnull*/ packet); diff --git a/src/commands/brightness_grid_command.rs b/src/commands/brightness_grid_command.rs index 7a10389..b66952d 100644 --- a/src/commands/brightness_grid_command.rs +++ b/src/commands/brightness_grid_command.rs @@ -8,13 +8,13 @@ use std::ptr::NonNull; wrap_command!(BrightnessGrid); -wrap_fields!(cmd_brightness_grid::BrightnessGridCommand; +wrap_fields!(cmd_brightnessgrid::BrightnessGridCommand; prop grid: BrightnessGrid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(cmd_brightness_grid::BrightnessGridCommand); +wrap_origin_accessors!(cmd_brightnessgrid::BrightnessGridCommand); -wrap_functions!(cmd_brightness_grid; +wrap_functions!(cmd_brightnessgrid; /// Set the brightness of individual tiles in a rectangular area of the display. /// diff --git a/src/commands/char_grid_command.rs b/src/commands/char_grid_command.rs index 07765b8..f614808 100644 --- a/src/commands/char_grid_command.rs +++ b/src/commands/char_grid_command.rs @@ -8,13 +8,13 @@ use std::ptr::NonNull; wrap_command!(CharGrid); -wrap_fields!(cmd_char_grid::CharGridCommand; +wrap_fields!(cmd_chargrid::CharGridCommand; prop grid: CharGrid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(cmd_char_grid::CharGridCommand); +wrap_origin_accessors!(cmd_chargrid::CharGridCommand); -wrap_functions!(cmd_char_grid; +wrap_functions!(cmd_chargrid; /// Show UTF-8 encoded text on the screen. /// diff --git a/src/commands/cp437_grid_command.rs b/src/commands/cp437_grid_command.rs index 2e76e3c..4ecd058 100644 --- a/src/commands/cp437_grid_command.rs +++ b/src/commands/cp437_grid_command.rs @@ -8,13 +8,13 @@ use std::ptr::NonNull; wrap_command!(Cp437Grid); -wrap_fields!(cmd_cp437_grid::Cp437GridCommand; +wrap_fields!(cmd_cp437grid::Cp437GridCommand; prop grid: Cp437Grid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(cmd_cp437_grid::Cp437GridCommand); +wrap_origin_accessors!(cmd_cp437grid::Cp437GridCommand); -wrap_functions!(cmd_cp437_grid; +wrap_functions!(cmd_cp437grid; /// Show text on the screen. /// diff --git a/src/commands/global_brightness_command.rs b/src/commands/global_brightness_command.rs index 6d00d7c..1b3fb34 100644 --- a/src/commands/global_brightness_command.rs +++ b/src/commands/global_brightness_command.rs @@ -6,7 +6,7 @@ use crate::{ use servicepoint::{Brightness, GlobalBrightnessCommand, Packet}; use std::ptr::NonNull; -wrap_functions!(cmd_brightness_global; +wrap_functions!(cmd_globalbrightness; /// Set the brightness of all tiles to the same value. /// @@ -25,7 +25,7 @@ wrap_functions!(cmd_brightness_global; wrap_command!(GlobalBrightness); wrap_fields!( - cmd_brightness_global::GlobalBrightnessCommand; + cmd_globalbrightness::GlobalBrightnessCommand; prop brightness: Brightness { get(); set(value); diff --git a/src/containers/brightness_grid.rs b/src/containers/brightness_grid.rs index 4212ec5..01fc010 100644 --- a/src/containers/brightness_grid.rs +++ b/src/containers/brightness_grid.rs @@ -9,7 +9,7 @@ use servicepoint::{ }; use std::{mem::transmute, ptr::NonNull}; -wrap_functions!(brightness_grid; +wrap_functions!(brightnessgrid; /// Creates a new [BrightnessGrid] with the specified dimensions. /// @@ -71,11 +71,11 @@ wrap_functions!(brightness_grid; ); -wrap_clone!(brightness_grid::BrightnessGrid); -wrap_free!(brightness_grid::BrightnessGrid); +wrap_clone!(brightnessgrid::BrightnessGrid); +wrap_free!(brightnessgrid::BrightnessGrid); wrap_methods!( - brightness_grid::BrightnessGrid; + brightnessgrid::BrightnessGrid; /// Gets the current value at the specified position. /// diff --git a/src/containers/char_grid.rs b/src/containers/char_grid.rs index 2a3667b..a79af3a 100644 --- a/src/containers/char_grid.rs +++ b/src/containers/char_grid.rs @@ -6,7 +6,7 @@ use crate::{ use servicepoint::{CharGrid, CharGridCommand, Grid, Origin, Packet}; use std::ptr::NonNull; -wrap_functions!(char_grid; +wrap_functions!(chargrid; /// Creates a new [CharGrid] with the specified dimensions. /// @@ -58,11 +58,11 @@ wrap_functions!(char_grid; ); -wrap_clone!(char_grid::CharGrid); -wrap_free!(char_grid::CharGrid); +wrap_clone!(chargrid::CharGrid); +wrap_free!(chargrid::CharGrid); wrap_methods!( - char_grid::CharGrid; + chargrid::CharGrid; /// Returns the current value at the specified position. /// diff --git a/src/containers/cp437_grid.rs b/src/containers/cp437_grid.rs index a344b1a..a78cecf 100644 --- a/src/containers/cp437_grid.rs +++ b/src/containers/cp437_grid.rs @@ -9,7 +9,7 @@ use servicepoint::{ }; use std::ptr::NonNull; -wrap_functions!(cp437_grid; +wrap_functions!(cp437grid; /// Creates a new [Cp437Grid] with the specified dimensions. /// @@ -50,11 +50,11 @@ wrap_functions!(cp437_grid; ); -wrap_clone!(cp437_grid::Cp437Grid); -wrap_free!(cp437_grid::Cp437Grid); +wrap_clone!(cp437grid::Cp437Grid); +wrap_free!(cp437grid::Cp437Grid); wrap_methods!( - cp437_grid::Cp437Grid; + cp437grid::Cp437Grid; /// Gets the current value at the specified position. /// /// # Arguments diff --git a/src/macros.rs b/src/macros.rs index 8f96746..93e06b8 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -221,7 +221,7 @@ macro_rules! wrap_functions { $( $(#[$meta])* #[doc = ""] - #[doc = concat!(" This function is part of the ", stringify!($module), " module.")] + #[doc = " This function is part of the `" $module "` module."] #[no_mangle] pub unsafe extern "C" fn [< sp_ $module _ $function >]( $($param_name: $param_type),*