{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE Trustworthy #-} module Network.Tox.C.Constants where import Data.Word (Word32) -------------------------------------------------------------------------------- -- -- :: Numeric constants -- -------------------------------------------------------------------------------- -- | The size of a Tox Public Key in bytes. foreign import ccall tox_public_key_size :: Word32 -- | The size of a Tox Secret Key in bytes. foreign import ccall tox_secret_key_size :: Word32 -- | 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)]. -- -- The checksum is computed over the Public Key and the nospam value. The first -- byte is an XOR of all the even bytes (0, 2, 4, ...), the second byte is an -- XOR of all the odd bytes (1, 3, 5, ...) of the Public Key and nospam. foreign import ccall tox_address_size :: Word32 -- | Maximum length of a nickname in bytes. foreign import ccall tox_max_name_length :: Word32 -- | Maximum length of a status message in bytes. foreign import ccall tox_max_status_message_length :: Word32 -- | Maximum length of a friend request message in bytes. foreign import ccall tox_max_friend_request_length :: Word32 -- | Maximum length of a single message after which it should be split. foreign import ccall tox_max_message_length :: Word32 -- | Maximum size of custom packets. TODO: should be LENGTH? foreign import ccall tox_max_custom_packet_size :: Word32 -- | The number of bytes in a hash generated by tox_hash. foreign import ccall tox_hash_length :: Word32 -- | The number of bytes in a file id. foreign import ccall tox_file_id_length :: Word32 -- | Maximum file name length for file transfers. foreign import ccall tox_max_filename_length :: Word32