diff options
author | Ivan Blinkov <ivan@blinkov.ru> | 2022-02-10 16:47:11 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:11 +0300 |
commit | 5b283123c882433dafbaf6b338adeea16c1a0ea0 (patch) | |
tree | 339adc63bce23800021202ae4a8328a843dc447a /contrib/libs/hyperscan/src/database.c | |
parent | 1aeb9a455974457866f78722ad98114bafc84e8a (diff) | |
download | ydb-5b283123c882433dafbaf6b338adeea16c1a0ea0.tar.gz |
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/database.c')
-rw-r--r-- | contrib/libs/hyperscan/src/database.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/libs/hyperscan/src/database.c b/contrib/libs/hyperscan/src/database.c index 54d9e6de030..6adf1419dde 100644 --- a/contrib/libs/hyperscan/src/database.c +++ b/contrib/libs/hyperscan/src/database.c @@ -49,7 +49,7 @@ int db_correctly_aligned(const void *db) { } HS_PUBLIC_API -hs_error_t HS_CDECL hs_free_database(hs_database_t *db) { +hs_error_t HS_CDECL hs_free_database(hs_database_t *db) { if (db && db->magic != HS_DB_MAGIC) { return HS_INVALID; } @@ -59,8 +59,8 @@ hs_error_t HS_CDECL hs_free_database(hs_database_t *db) { } HS_PUBLIC_API -hs_error_t HS_CDECL hs_serialize_database(const hs_database_t *db, char **bytes, - size_t *serialized_length) { +hs_error_t HS_CDECL hs_serialize_database(const hs_database_t *db, char **bytes, + size_t *serialized_length) { if (!db || !bytes || !serialized_length) { return HS_INVALID; } @@ -197,9 +197,9 @@ void db_copy_bytecode(const char *serialized, hs_database_t *db) { } HS_PUBLIC_API -hs_error_t HS_CDECL hs_deserialize_database_at(const char *bytes, - const size_t length, - hs_database_t *db) { +hs_error_t HS_CDECL hs_deserialize_database_at(const char *bytes, + const size_t length, + hs_database_t *db) { if (!bytes || !db) { return HS_INVALID; } @@ -240,9 +240,9 @@ hs_error_t HS_CDECL hs_deserialize_database_at(const char *bytes, } HS_PUBLIC_API -hs_error_t HS_CDECL hs_deserialize_database(const char *bytes, - const size_t length, - hs_database_t **db) { +hs_error_t HS_CDECL hs_deserialize_database(const char *bytes, + const size_t length, + hs_database_t **db) { if (!bytes || !db) { return HS_INVALID; } @@ -290,7 +290,7 @@ hs_error_t HS_CDECL hs_deserialize_database(const char *bytes, } HS_PUBLIC_API -hs_error_t HS_CDECL hs_database_size(const hs_database_t *db, size_t *size) { +hs_error_t HS_CDECL hs_database_size(const hs_database_t *db, size_t *size) { if (!size) { return HS_INVALID; } @@ -305,9 +305,9 @@ hs_error_t HS_CDECL hs_database_size(const hs_database_t *db, size_t *size) { } HS_PUBLIC_API -hs_error_t HS_CDECL hs_serialized_database_size(const char *bytes, - const size_t length, - size_t *size) { +hs_error_t HS_CDECL hs_serialized_database_size(const char *bytes, + const size_t length, + size_t *size) { // Decode and check the header hs_database_t header; hs_error_t ret = db_decode_header(&bytes, length, &header); @@ -404,7 +404,7 @@ hs_error_t print_database_string(char **s, u32 version, const platform_t plat, // that don't have snprintf but have a workalike. int p_len = SNPRINTF_COMPAT( buf, len, "Version: %u.%u.%u Features: %s Mode: %s", - major, minor, release, features, mode); + major, minor, release, features, mode); if (p_len < 0) { DEBUG_PRINTF("snprintf output error, returned %d\n", p_len); hs_misc_free(buf); @@ -423,27 +423,27 @@ hs_error_t print_database_string(char **s, u32 version, const platform_t plat, } HS_PUBLIC_API -hs_error_t HS_CDECL hs_serialized_database_info(const char *bytes, - size_t length, char **info) { +hs_error_t HS_CDECL hs_serialized_database_info(const char *bytes, + size_t length, char **info) { if (!info) { return HS_INVALID; } *info = NULL; - // Decode and check the header - hs_database_t header; - hs_error_t ret = db_decode_header(&bytes, length, &header); - if (ret != HS_SUCCESS) { - return ret; + // Decode and check the header + hs_database_t header; + hs_error_t ret = db_decode_header(&bytes, length, &header); + if (ret != HS_SUCCESS) { + return ret; } - u32 mode = unaligned_load_u32(bytes + offsetof(struct RoseEngine, mode)); + u32 mode = unaligned_load_u32(bytes + offsetof(struct RoseEngine, mode)); - return print_database_string(info, header.version, header.platform, mode); + return print_database_string(info, header.version, header.platform, mode); } HS_PUBLIC_API -hs_error_t HS_CDECL hs_database_info(const hs_database_t *db, char **info) { +hs_error_t HS_CDECL hs_database_info(const hs_database_t *db, char **info) { if (!info) { return HS_INVALID; } |