From 2b1a6b0d23b580d435661f9ee60ffbba8cec4fa6 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 10 Jun 2023 11:56:09 +0200 Subject: [PATCH] add missing ngc constants getter declarations and definitions --- .../docker/tox-bootstrapd.sha256 | 2 +- toxcore/tox.h | 6 ++++ toxcore/tox_api.c | 36 +++++++++++++++++++ toxcore/tox_test.cc | 9 +++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index c8003c41..0f69abe5 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -57f46dbb45034232c62e29ad31fd433ad298591fd9d3ea06b92040d33b8d8660 /usr/local/bin/tox-bootstrapd +93c9c4ba12e450afd01aabd31ae1da970c841e13984b68969d183b11e6266e1a /usr/local/bin/tox-bootstrapd diff --git a/toxcore/tox.h b/toxcore/tox.h index 05134c2b..22e0c639 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -3303,16 +3303,22 @@ uint32_t tox_group_max_part_length(void); */ #define TOX_GROUP_MAX_MESSAGE_LENGTH 1372 +uint32_t tox_group_max_message_length(void); + /** * Maximum length of a group custom lossy packet. */ #define TOX_GROUP_MAX_CUSTOM_LOSSY_PACKET_LENGTH 500 +uint32_t tox_group_max_custom_lossy_packet_length(void); + /** * Maximum length of a group custom lossless packet. */ #define TOX_GROUP_MAX_CUSTOM_LOSSLESS_PACKET_LENGTH 1373 +uint32_t tox_group_max_custom_lossless_packet_length(void); + /** * Maximum length of a group name. */ diff --git a/toxcore/tox_api.c b/toxcore/tox_api.c index 00051e49..61c248c3 100644 --- a/toxcore/tox_api.c +++ b/toxcore/tox_api.c @@ -88,6 +88,42 @@ uint32_t tox_max_hostname_length(void) { return TOX_MAX_HOSTNAME_LENGTH; } +uint32_t tox_group_max_topic_length(void) +{ + return TOX_GROUP_MAX_TOPIC_LENGTH; +} +uint32_t tox_group_max_part_length(void) +{ + return TOX_GROUP_MAX_PART_LENGTH; +} +uint32_t tox_group_max_message_length(void) +{ + return TOX_GROUP_MAX_MESSAGE_LENGTH; +} +uint32_t tox_group_max_custom_lossy_packet_length(void) +{ + return TOX_GROUP_MAX_CUSTOM_LOSSY_PACKET_LENGTH; +} +uint32_t tox_group_max_custom_lossless_packet_length(void) +{ + return TOX_GROUP_MAX_CUSTOM_LOSSLESS_PACKET_LENGTH; +} +uint32_t tox_group_max_group_name_length(void) +{ + return TOX_GROUP_MAX_GROUP_NAME_LENGTH; +} +uint32_t tox_group_max_password_size(void) +{ + return TOX_GROUP_MAX_PASSWORD_SIZE; +} +uint32_t tox_group_chat_id_size(void) +{ + return TOX_GROUP_CHAT_ID_SIZE; +} +uint32_t tox_group_peer_public_key_size(void) +{ + return TOX_GROUP_PEER_PUBLIC_KEY_SIZE; +} uint32_t tox_dht_node_ip_string_size(void) { return TOX_DHT_NODE_IP_STRING_SIZE; diff --git a/toxcore/tox_test.cc b/toxcore/tox_test.cc index cae98e19..530c1390 100644 --- a/toxcore/tox_test.cc +++ b/toxcore/tox_test.cc @@ -48,6 +48,15 @@ TEST(Tox, ConstantsAreNonZero) EXPECT_GT(tox_file_id_length(), 0); EXPECT_GT(tox_max_filename_length(), 0); EXPECT_GT(tox_max_hostname_length(), 0); + EXPECT_GT(tox_group_max_topic_length(), 0); + EXPECT_GT(tox_group_max_part_length(), 0); + EXPECT_GT(tox_group_max_message_length(), 0); + EXPECT_GT(tox_group_max_custom_lossy_packet_length(), 0); + EXPECT_GT(tox_group_max_custom_lossless_packet_length(), 0); + EXPECT_GT(tox_group_max_group_name_length(), 0); + EXPECT_GT(tox_group_max_password_size(), 0); + EXPECT_GT(tox_group_chat_id_size(), 0); + EXPECT_GT(tox_group_peer_public_key_size(), 0); EXPECT_GT(tox_dht_node_ip_string_size(), 0); EXPECT_GT(tox_dht_node_public_key_size(), 0); }