From 500cbbc872362848225f7ade10bc7deb1693e7ea Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 21 Jun 2025 23:51:10 +0200 Subject: [PATCH] add prefix centrally --- include/servicepoint.h | 290 +++++++++++----------- src/commands/bitmap_command.rs | 6 +- src/commands/bitvec_command.rs | 4 +- src/commands/brightness_grid_command.rs | 6 +- src/commands/cc_only_commands.rs | 2 +- src/commands/char_grid_command.rs | 6 +- src/commands/cp437_grid_command.rs | 6 +- src/commands/generic_command.rs | 2 +- src/commands/global_brightness_command.rs | 4 +- src/commands/mod.rs | 2 +- src/containers/bitmap.rs | 9 +- src/containers/bitvec.rs | 8 +- src/containers/brightness_grid.rs | 8 +- src/containers/char_grid.rs | 8 +- src/containers/cp437_grid.rs | 8 +- src/containers/mod.rs | 1 + src/lib.rs | 6 +- src/macros.rs | 2 +- src/packet.rs | 8 +- src/udp.rs | 4 +- 20 files changed, 195 insertions(+), 195 deletions(-) diff --git a/include/servicepoint.h b/include/servicepoint.h index 50adba6..63b2226 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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_bitvec module. + * This function is part of the bitvec module. */ BitVec */*notnull*/ sp_bitvec_new(size_t size); @@ -945,14 +945,14 @@ BitVec */*notnull*/ sp_bitvec_new(size_t size); * * - when accessing `index` out of bounds * - * This function is part of the sp_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 sp_brightness_grid module. + * This function is part of the brightness_grid module. */ BrightnessGrid */*notnull*/ sp_brightness_grid_clone(BrightnessGrid */*notnull*/ instance); @@ -963,7 +963,7 @@ 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 sp_brightness_grid module. + * This function is part of the brightness_grid module. */ struct ByteSlice sp_brightness_grid_data_ref_mut(BrightnessGrid */*notnull*/ instance); @@ -976,7 +976,7 @@ 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 sp_brightness_grid module. + * This function is part of the brightness_grid module. */ void sp_brightness_grid_fill(BrightnessGrid */*notnull*/ instance, Brightness value); @@ -984,7 +984,7 @@ void sp_brightness_grid_fill(BrightnessGrid */*notnull*/ instance, /** *Deallocates a [`BrightnessGrid`] instance. * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ void sp_brightness_grid_free(BrightnessGrid */*notnull*/ instance); @@ -1002,7 +1002,7 @@ void sp_brightness_grid_free(BrightnessGrid */*notnull*/ instance); * # Panics * - When accessing `x` or `y` out of bounds. * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ Brightness sp_brightness_grid_get(BrightnessGrid */*notnull*/ instance, size_t x, @@ -1013,7 +1013,7 @@ Brightness sp_brightness_grid_get(BrightnessGrid */*notnull*/ instance, * * Gets the height of the grid. * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ size_t sp_brightness_grid_height(BrightnessGrid */*notnull*/ instance); @@ -1024,7 +1024,7 @@ size_t sp_brightness_grid_height(BrightnessGrid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ struct Packet *sp_brightness_grid_into_packet(BrightnessGrid */*notnull*/ grid, size_t x, @@ -1037,7 +1037,7 @@ 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 sp_brightness_grid module. + * This function is part of the brightness_grid module. */ BrightnessGrid *sp_brightness_grid_load(size_t width, size_t height, @@ -1062,7 +1062,7 @@ BrightnessGrid *sp_brightness_grid_load(size_t width, * sp_udp_free(connection); * ``` * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ BrightnessGrid */*notnull*/ sp_brightness_grid_new(size_t width, size_t height); @@ -1082,7 +1082,7 @@ 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 sp_brightness_grid module. + * This function is part of the brightness_grid module. */ void sp_brightness_grid_set(BrightnessGrid */*notnull*/ instance, size_t x, @@ -1094,14 +1094,14 @@ void sp_brightness_grid_set(BrightnessGrid */*notnull*/ instance, * * Gets the width of the grid. * - * This function is part of the sp_brightness_grid module. + * This function is part of the brightness_grid module. */ size_t sp_brightness_grid_width(BrightnessGrid */*notnull*/ instance); /** *Clones a [`CharGrid`] instance. * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ CharGrid */*notnull*/ sp_char_grid_clone(CharGrid */*notnull*/ instance); @@ -1115,14 +1115,14 @@ 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 sp_char_grid module. + * This function is part of the char_grid module. */ void sp_char_grid_fill(CharGrid */*notnull*/ instance, uint32_t value); /** *Deallocates a [`CharGrid`] instance. * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ void sp_char_grid_free(CharGrid */*notnull*/ instance); @@ -1139,7 +1139,7 @@ void sp_char_grid_free(CharGrid */*notnull*/ instance); * * - when accessing `x` or `y` out of bounds * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ uint32_t sp_char_grid_get(CharGrid */*notnull*/ instance, size_t x, size_t y); @@ -1148,7 +1148,7 @@ uint32_t sp_char_grid_get(CharGrid */*notnull*/ instance, size_t x, size_t y); * * Gets the height of the grid. * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ size_t sp_char_grid_height(CharGrid */*notnull*/ instance); @@ -1159,7 +1159,7 @@ size_t sp_char_grid_height(CharGrid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ struct Packet *sp_char_grid_into_packet(CharGrid */*notnull*/ grid, size_t x, @@ -1170,7 +1170,7 @@ struct Packet *sp_char_grid_into_packet(CharGrid */*notnull*/ grid, * * returns: new CharGrid or NULL in case of an error * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ CharGrid *sp_char_grid_load(size_t width, size_t height, struct ByteSlice data); @@ -1188,7 +1188,7 @@ 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 sp_char_grid module. + * This function is part of the char_grid module. */ CharGrid */*notnull*/ sp_char_grid_new(size_t width, size_t height); @@ -1209,7 +1209,7 @@ 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 sp_char_grid module. + * This function is part of the char_grid module. */ void sp_char_grid_set(CharGrid */*notnull*/ instance, size_t x, @@ -1221,21 +1221,21 @@ void sp_char_grid_set(CharGrid */*notnull*/ instance, * * Gets the width of the grid. * - * This function is part of the sp_char_grid module. + * This function is part of the char_grid module. */ size_t sp_char_grid_width(CharGrid */*notnull*/ instance); /** *Clones a [`BitmapCommand`] instance. * - * This function is part of the sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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,21 +1428,21 @@ void sp_cmd_bitvec_set_operation(struct BitVecCommand */*notnull*/ instance, * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the sp_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`]. * - * This function is part of the sp_cmd_brightness_global module. + * This function is part of the cmd_brightness_global module. */ Brightness sp_cmd_brightness_global_get_brightness(struct GlobalBrightnessCommand */*notnull*/ instance); /** * Turns the command into a packet * - * This function is part of the sp_cmd_brightness_global module. + * This function is part of the cmd_brightness_global module. */ struct Packet */*notnull*/ sp_cmd_brightness_global_into_packet(struct GlobalBrightnessCommand */*notnull*/ command); @@ -1451,14 +1451,14 @@ struct Packet */*notnull*/ sp_cmd_brightness_global_into_packet(struct GlobalBri * * Returns: a new [GlobalBrightnessCommand] instance. * - * This function is part of the sp_cmd_brightness_global module. + * 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 sp_cmd_brightness_global module. + * This function is part of the cmd_brightness_global module. */ void sp_cmd_brightness_global_set_brightness(struct GlobalBrightnessCommand */*notnull*/ instance, Brightness value); @@ -1467,7 +1467,7 @@ void sp_cmd_brightness_global_set_brightness(struct GlobalBrightnessCommand */*n * Moves the provided [BrightnessGrid] into a new [BrightnessGridCommand], * leaving other fields as their default values. * - * This function is part of the sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_from_grid(BrightnessGrid */*notnull*/ grid); @@ -1477,14 +1477,14 @@ 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 sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ BrightnessGrid */*notnull*/ sp_cmd_brightness_grid_get_grid_mut(struct BrightnessGridCommand */*notnull*/ instance); /** * Reads the origin field of the [`BrightnessGridCommand`]. * - * This function is part of the sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ void sp_cmd_brightness_grid_get_origin(struct BrightnessGridCommand */*notnull*/ command, size_t */*notnull*/ origin_x, @@ -1495,7 +1495,7 @@ void sp_cmd_brightness_grid_get_origin(struct BrightnessGridCommand */*notnull*/ * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ struct Packet *sp_cmd_brightness_grid_into_packet(struct BrightnessGridCommand */*notnull*/ command); @@ -1506,7 +1506,7 @@ struct Packet *sp_cmd_brightness_grid_into_packet(struct BrightnessGridCommand * * * Returns: a new [BrightnessGridCommand] instance. * - * This function is part of the sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_new(BrightnessGrid */*notnull*/ grid, size_t origin_x, @@ -1516,7 +1516,7 @@ struct BrightnessGridCommand */*notnull*/ sp_cmd_brightness_grid_new(BrightnessG * 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 sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ void sp_cmd_brightness_grid_set_grid(struct BrightnessGridCommand */*notnull*/ instance, BrightnessGrid */*notnull*/ value); @@ -1524,7 +1524,7 @@ void sp_cmd_brightness_grid_set_grid(struct BrightnessGridCommand */*notnull*/ i /** * Overwrites the origin field of the [`BrightnessGridCommand`]. * - * This function is part of the sp_cmd_brightness_grid module. + * This function is part of the cmd_brightness_grid module. */ void sp_cmd_brightness_grid_set_origin(struct BrightnessGridCommand */*notnull*/ command, size_t origin_x, @@ -1533,14 +1533,14 @@ void sp_cmd_brightness_grid_set_origin(struct BrightnessGridCommand */*notnull*/ /** *Clones a [`BrightnessGridCommand`] instance. * - * This function is part of the sp_cmd_brightnessgrid module. + * This function is part of the cmd_brightnessgrid module. */ struct BrightnessGridCommand */*notnull*/ sp_cmd_brightnessgrid_clone(struct BrightnessGridCommand */*notnull*/ instance); /** *Deallocates a [`BrightnessGridCommand`] instance. * - * This function is part of the sp_cmd_brightnessgrid module. + * This function is part of the cmd_brightnessgrid module. */ void sp_cmd_brightnessgrid_free(struct BrightnessGridCommand */*notnull*/ instance); @@ -1548,7 +1548,7 @@ void sp_cmd_brightnessgrid_free(struct BrightnessGridCommand */*notnull*/ instan * Moves the provided [CharGrid] into a new [CharGridCommand], * leaving other fields as their default values. * - * This function is part of the sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ struct CharGridCommand */*notnull*/ sp_cmd_char_grid_from_grid(CharGrid */*notnull*/ grid); @@ -1558,14 +1558,14 @@ 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 sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ CharGrid */*notnull*/ sp_cmd_char_grid_get_grid_mut(struct CharGridCommand */*notnull*/ instance); /** * Reads the origin field of the [`CharGridCommand`]. * - * This function is part of the sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ void sp_cmd_char_grid_get_origin(struct CharGridCommand */*notnull*/ command, size_t */*notnull*/ origin_x, @@ -1578,7 +1578,7 @@ void sp_cmd_char_grid_get_origin(struct CharGridCommand */*notnull*/ command, * * Returns: a new [CharGridCommand] instance. * - * This function is part of the sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ struct CharGridCommand */*notnull*/ sp_cmd_char_grid_new(CharGrid */*notnull*/ grid, size_t origin_x, @@ -1588,7 +1588,7 @@ struct CharGridCommand */*notnull*/ sp_cmd_char_grid_new(CharGrid */*notnull*/ g * 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 sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ void sp_cmd_char_grid_set_grid(struct CharGridCommand */*notnull*/ instance, CharGrid */*notnull*/ value); @@ -1596,7 +1596,7 @@ void sp_cmd_char_grid_set_grid(struct CharGridCommand */*notnull*/ instance, /** * Overwrites the origin field of the [`CharGridCommand`]. * - * This function is part of the sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ void sp_cmd_char_grid_set_origin(struct CharGridCommand */*notnull*/ command, size_t origin_x, @@ -1607,35 +1607,35 @@ void sp_cmd_char_grid_set_origin(struct CharGridCommand */*notnull*/ command, * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the sp_cmd_char_grid module. + * This function is part of the cmd_char_grid module. */ struct Packet *sp_cmd_char_grid_try_into_packet(struct CharGridCommand */*notnull*/ command); /** *Clones a [`CharGridCommand`] instance. * - * This function is part of the sp_cmd_chargrid module. + * 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 sp_cmd_chargrid module. + * This function is part of the cmd_chargrid module. */ void sp_cmd_chargrid_free(struct CharGridCommand */*notnull*/ instance); /** *Clones a [`ClearCommand`] instance. * - * This function is part of the sp_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 sp_cmd_clear module. + * This function is part of the cmd_clear module. */ void sp_cmd_clear_free(struct ClearCommand */*notnull*/ instance); @@ -1646,7 +1646,7 @@ void sp_cmd_clear_free(struct ClearCommand */*notnull*/ instance); * * Returns: a new [`ClearCommand`] instance. * - * This function is part of the sp_cmd_clear module. + * This function is part of the cmd_clear module. */ struct ClearCommand */*notnull*/ sp_cmd_clear_new(void); @@ -1654,7 +1654,7 @@ struct ClearCommand */*notnull*/ sp_cmd_clear_new(void); * Moves the provided [Cp437Grid] into a new [Cp437GridCommand], * leaving other fields as their default values. * - * This function is part of the sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_from_grid(Cp437Grid */*notnull*/ grid); @@ -1664,14 +1664,14 @@ 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 sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ Cp437Grid */*notnull*/ sp_cmd_cp437_grid_get_grid_mut(struct Cp437GridCommand */*notnull*/ instance); /** * Reads the origin field of the [`Cp437GridCommand`]. * - * This function is part of the sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ void sp_cmd_cp437_grid_get_origin(struct Cp437GridCommand */*notnull*/ command, size_t */*notnull*/ origin_x, @@ -1684,7 +1684,7 @@ 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 sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_new(Cp437Grid */*notnull*/ grid, size_t origin_x, @@ -1694,7 +1694,7 @@ struct Cp437GridCommand */*notnull*/ sp_cmd_cp437_grid_new(Cp437Grid */*notnull* * 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 sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ void sp_cmd_cp437_grid_set_grid(struct Cp437GridCommand */*notnull*/ instance, Cp437Grid */*notnull*/ value); @@ -1702,7 +1702,7 @@ void sp_cmd_cp437_grid_set_grid(struct Cp437GridCommand */*notnull*/ instance, /** * Overwrites the origin field of the [`Cp437GridCommand`]. * - * This function is part of the sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ void sp_cmd_cp437_grid_set_origin(struct Cp437GridCommand */*notnull*/ command, size_t origin_x, @@ -1713,35 +1713,35 @@ void sp_cmd_cp437_grid_set_origin(struct Cp437GridCommand */*notnull*/ command, * * Returns: NULL or a [Packet] containing the command. * - * This function is part of the sp_cmd_cp437_grid module. + * This function is part of the cmd_cp437_grid module. */ struct Packet *sp_cmd_cp437_grid_try_into_packet(struct Cp437GridCommand */*notnull*/ command); /** *Clones a [`Cp437GridCommand`] instance. * - * This function is part of the sp_cmd_cp437grid module. + * 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 sp_cmd_cp437grid module. + * This function is part of the cmd_cp437grid module. */ void sp_cmd_cp437grid_free(struct Cp437GridCommand */*notnull*/ instance); /** *Clones a [`FadeOutCommand`] instance. * - * This function is part of the sp_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 sp_cmd_fadeout module. + * This function is part of the cmd_fadeout module. */ void sp_cmd_fadeout_free(struct FadeOutCommand */*notnull*/ instance); @@ -1750,7 +1750,7 @@ void sp_cmd_fadeout_free(struct FadeOutCommand */*notnull*/ instance); * * Returns: a new [`FadeOutCommand`] instance. * - * This function is part of the sp_cmd_fadeout module. + * This function is part of the cmd_fadeout module. */ struct FadeOutCommand */*notnull*/ sp_cmd_fadeout_new(void); @@ -1759,7 +1759,7 @@ struct FadeOutCommand */*notnull*/ sp_cmd_fadeout_new(void); * * returns: a new [SPCommand] instance. * - * This function is part of the sp_cmd_generic module. + * This function is part of the cmd_generic module. */ struct Command sp_cmd_generic_clone(struct Command command); @@ -1775,7 +1775,7 @@ struct Command sp_cmd_generic_clone(struct Command command); * sp_command_free(c); * ``` * - * This function is part of the sp_cmd_generic module. + * This function is part of the cmd_generic module. */ void sp_cmd_generic_free(struct Command command); @@ -1785,7 +1785,7 @@ void sp_cmd_generic_free(struct Command command); * * Returns tag [CommandTag::Invalid] in case of an error. * - * This function is part of the sp_cmd_generic module. + * This function is part of the cmd_generic module. */ struct Packet *sp_cmd_generic_into_packet(struct Command command); @@ -1796,35 +1796,35 @@ 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 sp_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 sp_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 sp_cmd_globalbrightness module. + * This function is part of the cmd_globalbrightness module. */ void sp_cmd_globalbrightness_free(struct GlobalBrightnessCommand */*notnull*/ instance); /** *Clones a [`HardResetCommand`] instance. * - * This function is part of the sp_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 sp_cmd_hardreset module. + * This function is part of the cmd_hardreset module. */ void sp_cmd_hardreset_free(struct HardResetCommand */*notnull*/ instance); @@ -1835,14 +1835,14 @@ void sp_cmd_hardreset_free(struct HardResetCommand */*notnull*/ instance); * * Returns: a new [`HardResetCommand`] instance. * - * This function is part of the sp_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 sp_cp437_grid module. + * This function is part of the cp437_grid module. */ Cp437Grid */*notnull*/ sp_cp437_grid_clone(Cp437Grid */*notnull*/ instance); @@ -1853,7 +1853,7 @@ 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 sp_cp437_grid module. + * This function is part of the cp437_grid module. */ struct ByteSlice sp_cp437_grid_data_ref_mut(Cp437Grid */*notnull*/ instance); @@ -1867,14 +1867,14 @@ 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 sp_cp437_grid module. + * This function is part of the cp437_grid module. */ void sp_cp437_grid_fill(Cp437Grid */*notnull*/ instance, uint8_t value); /** *Deallocates a [`Cp437Grid`] instance. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ void sp_cp437_grid_free(Cp437Grid */*notnull*/ instance); @@ -1891,7 +1891,7 @@ void sp_cp437_grid_free(Cp437Grid */*notnull*/ instance); * * - when accessing `x` or `y` out of bounds * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ uint8_t sp_cp437_grid_get(Cp437Grid */*notnull*/ instance, size_t x, size_t y); @@ -1900,7 +1900,7 @@ uint8_t sp_cp437_grid_get(Cp437Grid */*notnull*/ instance, size_t x, size_t y); * * Gets the height of the grid. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ size_t sp_cp437_grid_height(Cp437Grid */*notnull*/ instance); @@ -1911,7 +1911,7 @@ size_t sp_cp437_grid_height(Cp437Grid */*notnull*/ instance); * * Returns NULL in case of an error. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ struct Packet *sp_cp437_grid_into_packet(Cp437Grid */*notnull*/ grid, size_t x, @@ -1920,7 +1920,7 @@ struct Packet *sp_cp437_grid_into_packet(Cp437Grid */*notnull*/ grid, /** * Loads a [Cp437Grid] with the specified dimensions from the provided data. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ Cp437Grid *sp_cp437_grid_load(size_t width, size_t height, @@ -1931,7 +1931,7 @@ Cp437Grid *sp_cp437_grid_load(size_t width, * * returns: [Cp437Grid] initialized to 0. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ Cp437Grid */*notnull*/ sp_cp437_grid_new(size_t width, size_t height); @@ -1951,7 +1951,7 @@ 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 sp_cp437_grid module. + * This function is part of the cp437_grid module. */ void sp_cp437_grid_set(Cp437Grid */*notnull*/ instance, size_t x, @@ -1963,7 +1963,7 @@ void sp_cp437_grid_set(Cp437Grid */*notnull*/ instance, * * Gets the width of the grid. * - * This function is part of the sp_cp437_grid module. + * This function is part of the cp437_grid module. */ size_t sp_cp437_grid_width(Cp437Grid */*notnull*/ instance); @@ -1971,21 +1971,21 @@ size_t sp_cp437_grid_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_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 sp_packet module. + * This function is part of the packet module. */ struct Packet *sp_packet_try_load(struct ByteSlice data); @@ -2073,13 +2073,13 @@ struct Packet *sp_packet_try_load(struct ByteSlice data); * * This function is part of the sp module. */ -bool sp_u16_to_command_code(uint16_t code, - CommandCode *result); +bool sp_sp_u16_to_command_code(uint16_t code, + CommandCode *result); /** *Deallocates a [`UdpSocket`] instance. * - * This function is part of the sp_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 sp_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 sp_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 sp_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 sp_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 sp_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/bitmap_command.rs b/src/commands/bitmap_command.rs index 14f7626..06cc53f 100644 --- a/src/commands/bitmap_command.rs +++ b/src/commands/bitmap_command.rs @@ -8,14 +8,14 @@ use std::ptr::NonNull; wrap_command!(Bitmap); -wrap_fields!(sp_cmd_bitmap::BitmapCommand; +wrap_fields!(cmd_bitmap::BitmapCommand; prop bitmap: Bitmap { mut get(); move set(value); }; prop compression: CompressionCode { get(); set(value); }; ); -wrap_origin_accessors!(sp_cmd_bitmap::BitmapCommand); +wrap_origin_accessors!(cmd_bitmap::BitmapCommand); -wrap_functions!(sp_cmd_bitmap; +wrap_functions!(cmd_bitmap; /// Sets a window of pixels to the specified values. /// /// The passed [Bitmap] gets consumed. diff --git a/src/commands/bitvec_command.rs b/src/commands/bitvec_command.rs index 38af213..100fc93 100644 --- a/src/commands/bitvec_command.rs +++ b/src/commands/bitvec_command.rs @@ -11,14 +11,14 @@ use std::ptr::NonNull; wrap_command!(BitVec); -wrap_fields!(sp_cmd_bitvec::BitVecCommand; +wrap_fields!(cmd_bitvec::BitVecCommand; prop bitvec: DisplayBitVec { mut get(); move set(value); }; prop offset: Offset { get(); set(value); }; prop operation: BinaryOperation { get(); set(value); }; prop compression: CompressionCode { get(); set(value); }; ); -wrap_functions!(sp_cmd_bitvec; +wrap_functions!(cmd_bitvec; /// Set pixel data starting at the pixel offset on screen. /// diff --git a/src/commands/brightness_grid_command.rs b/src/commands/brightness_grid_command.rs index 361ae8b..7a10389 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!(sp_cmd_brightness_grid::BrightnessGridCommand; +wrap_fields!(cmd_brightness_grid::BrightnessGridCommand; prop grid: BrightnessGrid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(sp_cmd_brightness_grid::BrightnessGridCommand); +wrap_origin_accessors!(cmd_brightness_grid::BrightnessGridCommand); -wrap_functions!(sp_cmd_brightness_grid; +wrap_functions!(cmd_brightness_grid; /// Set the brightness of individual tiles in a rectangular area of the display. /// diff --git a/src/commands/cc_only_commands.rs b/src/commands/cc_only_commands.rs index f90a045..0d72078 100644 --- a/src/commands/cc_only_commands.rs +++ b/src/commands/cc_only_commands.rs @@ -20,7 +20,7 @@ macro_rules! wrap_cc_only { ($(#[$meta:meta])* $command:ident) => { ::paste::paste!{ - wrap_cc_only!($(#[$meta])*; $command, [< sp_cmd_ $command:lower >], [< $command Command >]); + wrap_cc_only!($(#[$meta])*; $command, [< cmd_ $command:lower >], [< $command Command >]); } }; } diff --git a/src/commands/char_grid_command.rs b/src/commands/char_grid_command.rs index dfab435..07765b8 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!(sp_cmd_char_grid::CharGridCommand; +wrap_fields!(cmd_char_grid::CharGridCommand; prop grid: CharGrid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(sp_cmd_char_grid::CharGridCommand); +wrap_origin_accessors!(cmd_char_grid::CharGridCommand); -wrap_functions!(sp_cmd_char_grid; +wrap_functions!(cmd_char_grid; /// 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 cc43813..2e76e3c 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!(sp_cmd_cp437_grid::Cp437GridCommand; +wrap_fields!(cmd_cp437_grid::Cp437GridCommand; prop grid: Cp437Grid { mut get(); move set(grid); }; ); -wrap_origin_accessors!(sp_cmd_cp437_grid::Cp437GridCommand); +wrap_origin_accessors!(cmd_cp437_grid::Cp437GridCommand); -wrap_functions!(sp_cmd_cp437_grid; +wrap_functions!(cmd_cp437_grid; /// Show text on the screen. /// diff --git a/src/commands/generic_command.rs b/src/commands/generic_command.rs index 13dcd51..a4775d9 100644 --- a/src/commands/generic_command.rs +++ b/src/commands/generic_command.rs @@ -69,7 +69,7 @@ impl SPCommand { }; } -wrap_functions!(sp_cmd_generic; +wrap_functions!(cmd_generic; /// Tries to turn a [Packet] into a [SPCommand]. /// diff --git a/src/commands/global_brightness_command.rs b/src/commands/global_brightness_command.rs index 7f8f47c..6d00d7c 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!(sp_cmd_brightness_global; +wrap_functions!(cmd_brightness_global; /// Set the brightness of all tiles to the same value. /// @@ -25,7 +25,7 @@ wrap_functions!(sp_cmd_brightness_global; wrap_command!(GlobalBrightness); wrap_fields!( - sp_cmd_brightness_global::GlobalBrightnessCommand; + cmd_brightness_global::GlobalBrightnessCommand; prop brightness: Brightness { get(); set(value); diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 6ec78cb..0fce600 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -70,7 +70,7 @@ macro_rules! wrap_command { }; ($command:ident) => { ::paste::paste!{ - wrap_command!($command, [< sp_cmd_ $command:lower >], [< $command Command >]); + wrap_command!($command, [< cmd_ $command:lower >], [< $command Command >]); } }; } diff --git a/src/containers/bitmap.rs b/src/containers/bitmap.rs index 6d502d9..9ebf13a 100644 --- a/src/containers/bitmap.rs +++ b/src/containers/bitmap.rs @@ -9,10 +9,10 @@ use servicepoint::{ }; use std::ptr::NonNull; -wrap_clone!(sp_bitmap::Bitmap); -wrap_free!(sp_bitmap::Bitmap); +wrap_clone!(bitmap::Bitmap); +wrap_free!(bitmap::Bitmap); -wrap_functions!(sp_bitmap; +wrap_functions!(bitmap; /// Creates a new [Bitmap] with the specified dimensions. /// @@ -106,7 +106,7 @@ wrap_functions!(sp_bitmap; ); wrap_methods!( - sp_bitmap::Bitmap; + bitmap::Bitmap; /// Gets the current value at the specified position. /// @@ -148,7 +148,6 @@ wrap_methods!( /// /// The returned memory is valid for the lifetime of the bitmap. mut fn data_ref_mut() -> ByteSlice { - return(slice) { unsafe { ByteSlice::from_slice(slice) } }; }; ); diff --git a/src/containers/bitvec.rs b/src/containers/bitvec.rs index e232ab5..4512ac1 100644 --- a/src/containers/bitvec.rs +++ b/src/containers/bitvec.rs @@ -8,7 +8,7 @@ use servicepoint::{ }; use std::ptr::NonNull; -wrap_functions!(sp_bitvec; +wrap_functions!(bitvec; /// Creates a new [DisplayBitVec] instance. /// @@ -55,11 +55,11 @@ wrap_functions!(sp_bitvec; ); -wrap_clone!(sp_bitvec::DisplayBitVec); -wrap_free!(sp_bitvec::DisplayBitVec); +wrap_clone!(bitvec::DisplayBitVec); +wrap_free!(bitvec::DisplayBitVec); wrap_methods!( - sp_bitvec::DisplayBitVec; + bitvec::DisplayBitVec; /// Gets the value of a bit. /// diff --git a/src/containers/brightness_grid.rs b/src/containers/brightness_grid.rs index e266bef..4212ec5 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!(sp_brightness_grid; +wrap_functions!(brightness_grid; /// Creates a new [BrightnessGrid] with the specified dimensions. /// @@ -71,11 +71,11 @@ wrap_functions!(sp_brightness_grid; ); -wrap_clone!(sp_brightness_grid::BrightnessGrid); -wrap_free!(sp_brightness_grid::BrightnessGrid); +wrap_clone!(brightness_grid::BrightnessGrid); +wrap_free!(brightness_grid::BrightnessGrid); wrap_methods!( - sp_brightness_grid::BrightnessGrid; + brightness_grid::BrightnessGrid; /// Gets the current value at the specified position. /// diff --git a/src/containers/char_grid.rs b/src/containers/char_grid.rs index 782e2aa..2a3667b 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!(sp_char_grid; +wrap_functions!(char_grid; /// Creates a new [CharGrid] with the specified dimensions. /// @@ -58,11 +58,11 @@ wrap_functions!(sp_char_grid; ); -wrap_clone!(sp_char_grid::CharGrid); -wrap_free!(sp_char_grid::CharGrid); +wrap_clone!(char_grid::CharGrid); +wrap_free!(char_grid::CharGrid); wrap_methods!( - sp_char_grid::CharGrid; + char_grid::CharGrid; /// Returns the current value at the specified position. /// diff --git a/src/containers/cp437_grid.rs b/src/containers/cp437_grid.rs index 2ed9aba..a344b1a 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!(sp_cp437_grid; +wrap_functions!(cp437_grid; /// Creates a new [Cp437Grid] with the specified dimensions. /// @@ -50,11 +50,11 @@ wrap_functions!(sp_cp437_grid; ); -wrap_clone!(sp_cp437_grid::Cp437Grid); -wrap_free!(sp_cp437_grid::Cp437Grid); +wrap_clone!(cp437_grid::Cp437Grid); +wrap_free!(cp437_grid::Cp437Grid); wrap_methods!( - sp_cp437_grid::Cp437Grid; + cp437_grid::Cp437Grid; /// Gets the current value at the specified position. /// /// # Arguments diff --git a/src/containers/mod.rs b/src/containers/mod.rs index b9460e9..7576a7b 100644 --- a/src/containers/mod.rs +++ b/src/containers/mod.rs @@ -14,5 +14,6 @@ pub use cp437_grid::*; mod _hidden { /// This is a type only used by cbindgen to have a type for pointers. + #[allow(unused)] pub struct DisplayBitVec; } diff --git a/src/lib.rs b/src/lib.rs index 4df864c..5a1a5de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,8 +2,6 @@ //! //! # Examples //! -//! Make sure to check out [this GitHub repo](https://github.com/arfst23/ServicePoint) as well! -//! //! ```C //! #include //! #include "servicepoint.h" @@ -24,6 +22,8 @@ //! return 0; //! } //! ``` +//! +//! There are more examples in the source repository. /// Functions related to commands. pub mod commands; @@ -43,7 +43,7 @@ pub const SP_FRAME_PACING_MS: u128 = 30; mod feature_env_logger { use crate::macros::wrap_functions; - wrap_functions!(sp_envlogger; + wrap_functions!(envlogger; /// 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/). fn init() { diff --git a/src/macros.rs b/src/macros.rs index 3b35e1d..8f96746 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -223,7 +223,7 @@ macro_rules! wrap_functions { #[doc = ""] #[doc = concat!(" This function is part of the ", stringify!($module), " module.")] #[no_mangle] - pub unsafe extern "C" fn [< $module _ $function >]( + pub unsafe extern "C" fn [< sp_ $module _ $function >]( $($param_name: $param_type),* ) $(-> $return_type)? $block diff --git a/src/packet.rs b/src/packet.rs index 4278fe0..18d63bd 100644 --- a/src/packet.rs +++ b/src/packet.rs @@ -6,7 +6,7 @@ use crate::{ use servicepoint::{CommandCode, Header, Packet}; use std::ptr::NonNull; -wrap_functions!(sp_packet; +wrap_functions!(packet; /// Tries to load a [Packet] from the passed array with the specified length. /// @@ -68,11 +68,11 @@ wrap_functions!(sp_packet; } ); -wrap_clone!(sp_packet::Packet); -wrap_free!(sp_packet::Packet); +wrap_clone!(packet::Packet); +wrap_free!(packet::Packet); wrap_fields!( - sp_packet::Packet; + packet::Packet; prop header: Header { get(); mut get(); diff --git a/src/udp.rs b/src/udp.rs index 7eebe27..fd907be 100644 --- a/src/udp.rs +++ b/src/udp.rs @@ -10,9 +10,9 @@ use std::{ ptr::NonNull, }; -wrap_free!(sp_udp::UdpSocket); +wrap_free!(udp::UdpSocket); -wrap_functions!(sp_udp; +wrap_functions!(udp; /// Creates a new instance of [UdpSocket]. ///