From 5b14542d3b5af207170536c3e84fd80f6035cc03 Mon Sep 17 00:00:00 2001 From: cotox <39076296+cotox@users.noreply.github.com> Date: Tue, 26 Jun 2018 11:45:17 +0000 Subject: Make arg `host` understand clearly. Rename args `host:port` from `address:port`. The *address* is well known as *Tox Address* in this project. Then we should reserve *addres* to it, and use *host* to express the hostname or IP address in TCP domain. --- toxcore/tox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'toxcore/tox.c') diff --git a/toxcore/tox.c b/toxcore/tox.c index d2dcd93e..f7613d4f 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -248,9 +248,9 @@ void tox_get_savedata(const Tox *tox, uint8_t *savedata) } } -bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error) +bool tox_bootstrap(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error) { - if (!address || !public_key) { + if (!host || !public_key) { SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL); return 0; } @@ -262,7 +262,7 @@ bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t * IP_Port *root; - int32_t count = net_getipport(address, &root, TOX_SOCK_DGRAM); + int32_t count = net_getipport(host, &root, TOX_SOCK_DGRAM); if (count == -1) { net_freeipport(root); @@ -291,10 +291,10 @@ bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t * return 0; } -bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, +bool tox_add_tcp_relay(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error) { - if (!address || !public_key) { + if (!host || !public_key) { SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL); return 0; } @@ -306,7 +306,7 @@ bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8 IP_Port *root; - int32_t count = net_getipport(address, &root, TOX_SOCK_STREAM); + int32_t count = net_getipport(host, &root, TOX_SOCK_STREAM); if (count == -1) { net_freeipport(root); -- cgit v1.2.3