prefix enum names for better C consumption

This commit is contained in:
Vinzenz Schroeter 2024-10-13 17:36:32 +02:00
parent be17319993
commit 68d809c714
3 changed files with 9 additions and 6 deletions

View file

@ -31,3 +31,6 @@ all_features = true
[export]
include = []
exclude = []
[enum]
rename_variants = "QualifiedScreamingSnakeCase"

View file

@ -49,23 +49,23 @@ enum SPCompressionCode
/**
* no compression
*/
Uncompressed = 0,
SP_COMPRESSION_CODE_UNCOMPRESSED = 0,
/**
* compress using flate2 with zlib header
*/
Zlib = 26490,
SP_COMPRESSION_CODE_ZLIB = 26490,
/**
* compress using bzip2
*/
Bzip2 = 25210,
SP_COMPRESSION_CODE_BZIP2 = 25210,
/**
* compress using lzma
*/
Lzma = 27770,
SP_COMPRESSION_CODE_LZMA = 27770,
/**
* compress using Zstandard
*/
Zstd = 31347,
SP_COMPRESSION_CODE_ZSTD = 31347,
};
#ifndef __cplusplus
typedef uint16_t SPCompressionCode;

View file

@ -9,7 +9,7 @@ int main(void) {
SPPixelGrid *pixels = sp_pixel_grid_new(SP_PIXEL_WIDTH, SP_PIXEL_HEIGHT);
sp_pixel_grid_fill(pixels, true);
SPCommand *command = sp_command_bitmap_linear_win(0, 0, pixels, Uncompressed);
SPCommand *command = sp_command_bitmap_linear_win(0, 0, pixels, SP_COMPRESSION_CODE_UNCOMPRESSED);
while (sp_connection_send_command(connection, sp_command_clone(command)));
sp_command_free(command);