Jump to Navigation

ToxCore API本次升级总结

在2015年早些时候,ToxCore完成了一次比较大的升级API升级,影响到所有的使用原API的程序。
最近又拾起来了toxcore项目,在些基础上做些项目与研究,在升级API的过程中整理了一下,公布在之儿。如有不完善不正确之处,请指正。

这次api从外面看主要是命名的规范化的提升,其中也不乏大的改动,像文件API部分,有API的增删。

friend_action() 合并到=> friend_message()
tox_callback_name_change => tox_callback_friend_name
tox_callback_user_status => tox_callback_friend_status
tox_callback_status_message => tox_callback_friend_status_message
tox_callback_typing_change => tox_callback_friend_typing
tox_callback_read_receipt => tox_callback_friend_read_receipt
tox_callback_connection_status => tox_callback_friend_connection_status
tox_callback_file_send_request =>
tox_callback_file_send_request => tox_callback_file_chunk_request
tox_callback_file_control => tox_callback_file_recv_control
无对应 => tox_callback_file_recv
tox_callback_file_data => tox_callback_file_recv_chunk
tox_new_file_sender => tox_file_send
tox_file_send_control => tox_file_control
tox_file_send_data => tox_file_send_chunk
tox_file_data_size => 无对应
tox_file_data_remaining => 无对应
无对应 => tox_file_seek
无对应 => tox_file_get_file_id
tox_get_address => tox_self_get_address
tox_add_friend => tox_friend_add
tox_add_friend_norequest => tox_friend_add_norequest
tox_get_friend_number => tox_friend_by_public_key
tox_get_client_id => tox_friend_get_public_key
tox_del_friend => tox_friend_delete
tox_get_friend_connection_status => tox_friend_get_connection_status
tox_send_message => tox_friend_send_message
tox_set_name => tox_self_set_name
tox_get_self_name => tox_self_get_name
tox_get_self_name_size => tox_self_get_name_size
tox_get_name => tox_friend_get_name
tox_get_name_size => tox_friend_get_name_size
tox_set_status_message => tox_self_set_status_message
tox_set_user_status => tox_self_set_status
tox_get_user_status => tox_self_get_status
tox_get_status_message_size => tox_friend_get_status_message_size
tox_get_status_message => tox_friend_get_status_message
tox_get_self_status_message => tox_self_get_status_message
tox_get_self_status_message_size => tox_self_get_status_message_size
tox_get_self_user_status =>
tox_get_last_online => tox_friend_get_last_online
tox_set_user_is_typing => tox_self_set_typing
tox_get_is_typing => tox_friend_get_typing
tox_get_num_online_friends => 取消了
tox_count_friendlist => tox_self_get_friend_list_size
tox_get_friendlist => tox_self_get_friend_list
tox_get_nospam => tox_self_get_nospam
tox_set_nospam => tox_self_set_nospam
tox_get_keys => tox_self_get_public_key
tox_self_get_secret_key
tox_bootstrap_from_address => tox_bootstrap
tox_isconnected => tox_self_get_connection_status
tox_do_interval => tox_iteration_interval
tox_do => tox_iterate
tox_size => tox_get_savedata_size
tox_save => tox_get_savedata

uint16_t length => size_t length
int32_t friendnumber => uint32_t friend_number
uint8_t smth => bool smth

TOX_CLIENT_ID_SIZE => TOX_PUBLIC_KEY_SIZE
TOX_FRIEND_ADDRESS_SIZE => TOX_ADDRESS_SIZE
TOX_FAERR_TOOLONG => TOX_ERR_FRIEND_ADD_TOO_LONG
TOX_FAERR_NOMESSAGE => TOX_ERR_FRIEND_ADD_NO_MESSAGE
TOX_FAERR_OWNKEY => TOX_ERR_FRIEND_ADD_OWN_KEY
TOX_FAERR_ALREADYSENT => TOX_ERR_FRIEND_ADD_ALREADY_SENT
TOX_FAERR_UNKNOWN => TOX_ERR_FRIEND_ADD_NULL
TOX_FAERR_BADCHECKSUM => TOX_ERR_FRIEND_ADD_BAD_CHECKSUM
TOX_FAERR_SETNEWNOSPAM => TOX_ERR_FRIEND_ADD_SET_NEW_NOSPAM
TOX_FAERR_NOMEM => TOX_ERR_FRIEND_ADD_MALLOC
TOX_MAX_STATUSMESSAGE_LENGTH => TOX_MAX_STATUS_MESSAGE_LENGTH

这次整理的成果,这篇文档算一个,另一个是toxcore的python封装PyTox,在原API版本的基础上,实现了一个比较完善的newapi分支。
https://github.com/kitech/PyTox/tree/newapi

添加新评论

Plain text

  • 不允许HTML标记。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.


Main menu 2

Story | by Dr. Radut