Skip to content

Commit

Permalink
Update tox.h with constant functions.
Browse files Browse the repository at this point in the history
These are now generated by apidsl.
  • Loading branch information
iphydf committed Aug 29, 2016
1 parent 8e0eeff commit 74ecb0c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,15 @@ bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch);
*/
#define TOX_PUBLIC_KEY_SIZE 32

uint32_t tox_public_key_size(void);

/**
* The size of a Tox Secret Key in bytes.
*/
#define TOX_SECRET_KEY_SIZE 32

uint32_t tox_secret_key_size(void);

/**
* The size of a Tox address in bytes. Tox addresses are in the format
* [Public Key (TOX_PUBLIC_KEY_SIZE bytes)][nospam (4 bytes)][checksum (2 bytes)].
Expand All @@ -247,46 +251,64 @@ bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch);
*/
#define TOX_ADDRESS_SIZE (TOX_PUBLIC_KEY_SIZE + sizeof(uint32_t) + sizeof(uint16_t))

uint32_t tox_address_size(void);

/**
* Maximum length of a nickname in bytes.
*/
#define TOX_MAX_NAME_LENGTH 128

uint32_t tox_max_name_length(void);

/**
* Maximum length of a status message in bytes.
*/
#define TOX_MAX_STATUS_MESSAGE_LENGTH 1007

uint32_t tox_max_status_message_length(void);

/**
* Maximum length of a friend request message in bytes.
*/
#define TOX_MAX_FRIEND_REQUEST_LENGTH 1016

uint32_t tox_max_friend_request_length(void);

/**
* Maximum length of a single message after which it should be split.
*/
#define TOX_MAX_MESSAGE_LENGTH 1372

uint32_t tox_max_message_length(void);

/**
* Maximum size of custom packets. TODO: should be LENGTH?
*/
#define TOX_MAX_CUSTOM_PACKET_SIZE 1373

uint32_t tox_max_custom_packet_size(void);

/**
* The number of bytes in a hash generated by tox_hash.
*/
#define TOX_HASH_LENGTH 32

uint32_t tox_hash_length(void);

/**
* The number of bytes in a file id.
*/
#define TOX_FILE_ID_LENGTH 32

uint32_t tox_file_id_length(void);

/**
* Maximum file name length for file transfers.
*/
#define TOX_MAX_FILENAME_LENGTH 255

uint32_t tox_max_filename_length(void);


/*******************************************************************************
*
Expand Down

0 comments on commit 74ecb0c

Please sign in to comment.