Skip to content

Commit

Permalink
add missing ngc constants getter declarations and definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Jun 10, 2023
1 parent 172f279 commit 043dc1b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
62d2c7ab2a14d1f9b00acaf13813b3ea916ccfb2173c9ba95ac82a843a258119 /usr/local/bin/tox-bootstrapd
93c9c4ba12e450afd01aabd31ae1da970c841e13984b68969d183b11e6266e1a /usr/local/bin/tox-bootstrapd
6 changes: 6 additions & 0 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
36 changes: 36 additions & 0 deletions toxcore/tox_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions toxcore/tox_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 043dc1b

Please sign in to comment.