summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDubslow <bunslow@gmail.com>2015-02-13 22:24:39 -0600
committerDubslow <bunslow@gmail.com>2015-02-18 17:41:26 -0600
commitaca41475fa1d2f7ebcc76d84b3dfcbf3c694fb30 (patch)
tree749c36a8b5206398bac2282b334157ea43b25966
parent52a0753e52cb9095075c6fcc3538de965132e5b8 (diff)
Put const adjective before type nouns
(Done with two applications of "sed -i -r "s/(\\w+) const\\b/const \\1/g" toxcore/tox.*" ) Conflicts: toxcore/tox.c
-rw-r--r--toxcore/tox.c60
-rw-r--r--toxcore/tox.h104
2 files changed, 82 insertions, 82 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index a9c7d4dd..43a2c0d9 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -88,7 +88,7 @@ void tox_options_free(struct Tox_Options *options)
88 free(options); 88 free(options);
89} 89}
90 90
91Tox *tox_new(struct Tox_Options const *options, uint8_t const *data, size_t length, TOX_ERR_NEW *error) 91Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t length, TOX_ERR_NEW *error)
92{ 92{
93 if (!logger_get_global()) 93 if (!logger_get_global())
94 logger_set_global(logger_new(LOGGER_OUTPUT_FILE, LOGGER_LEVEL, "toxcore")); 94 logger_set_global(logger_new(LOGGER_OUTPUT_FILE, LOGGER_LEVEL, "toxcore"));
@@ -177,13 +177,13 @@ void tox_kill(Tox *tox)
177 logger_kill_global(); 177 logger_kill_global();
178} 178}
179 179
180size_t tox_save_size(Tox const *tox) 180size_t tox_save_size(const Tox *tox)
181{ 181{
182 const Messenger *m = tox; 182 const Messenger *m = tox;
183 return messenger_size(m); 183 return messenger_size(m);
184} 184}
185 185
186void tox_save(Tox const *tox, uint8_t *data) 186void tox_save(const Tox *tox, uint8_t *data)
187{ 187{
188 if (data) { 188 if (data) {
189 const Messenger *m = tox; 189 const Messenger *m = tox;
@@ -191,7 +191,7 @@ void tox_save(Tox const *tox, uint8_t *data)
191 } 191 }
192} 192}
193 193
194static int address_to_ip(Messenger *m, char const *address, IP_Port *ip_port, IP_Port *ip_port_v4) 194static int address_to_ip(Messenger *m, const char *address, IP_Port *ip_port, IP_Port *ip_port_v4)
195{ 195{
196 if (!addr_parse_ip(address, &ip_port->ip)) { 196 if (!addr_parse_ip(address, &ip_port->ip)) {
197 if (m->options.udp_disabled) { /* Disable DNS when udp is disabled. */ 197 if (m->options.udp_disabled) { /* Disable DNS when udp is disabled. */
@@ -216,7 +216,7 @@ static int address_to_ip(Messenger *m, char const *address, IP_Port *ip_port, IP
216 return 0; 216 return 0;
217} 217}
218 218
219bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, TOX_ERR_BOOTSTRAP *error) 219bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error)
220{ 220{
221 if (!address || !public_key) { 221 if (!address || !public_key) {
222 SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL); 222 SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL);
@@ -243,7 +243,7 @@ bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const *
243 } 243 }
244} 244}
245 245
246bool tox_add_tcp_relay(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, 246bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key,
247 TOX_ERR_BOOTSTRAP *error) 247 TOX_ERR_BOOTSTRAP *error)
248{ 248{
249 if (!address || !public_key) { 249 if (!address || !public_key) {
@@ -272,7 +272,7 @@ bool tox_add_tcp_relay(Tox *tox, char const *address, uint16_t port, uint8_t con
272 return 1; 272 return 1;
273} 273}
274 274
275TOX_CONNECTION tox_get_connection_status(Tox const *tox) 275TOX_CONNECTION tox_get_connection_status(const Tox *tox)
276{ 276{
277 const Messenger *m = tox; 277 const Messenger *m = tox;
278 278
@@ -293,7 +293,7 @@ void tox_callback_connection_status(Tox *tox, tox_connection_status_cb *function
293 //TODO 293 //TODO
294} 294}
295 295
296uint32_t tox_iteration_interval(Tox const *tox) 296uint32_t tox_iteration_interval(const Tox *tox)
297{ 297{
298 const Messenger *m = tox; 298 const Messenger *m = tox;
299 return messenger_run_interval(m); 299 return messenger_run_interval(m);
@@ -306,7 +306,7 @@ void tox_iteration(Tox *tox)
306 do_groupchats(m->group_chat_object); 306 do_groupchats(m->group_chat_object);
307} 307}
308 308
309void tox_self_get_address(Tox const *tox, uint8_t *address) 309void tox_self_get_address(const Tox *tox, uint8_t *address)
310{ 310{
311 if (address) { 311 if (address) {
312 const Messenger *m = tox; 312 const Messenger *m = tox;
@@ -320,13 +320,13 @@ void tox_self_set_nospam(Tox *tox, uint32_t nospam)
320 set_nospam(&(m->fr), nospam); 320 set_nospam(&(m->fr), nospam);
321} 321}
322 322
323uint32_t tox_self_get_nospam(Tox const *tox) 323uint32_t tox_self_get_nospam(const Tox *tox)
324{ 324{
325 const Messenger *m = tox; 325 const Messenger *m = tox;
326 return get_nospam(&(m->fr)); 326 return get_nospam(&(m->fr));
327} 327}
328 328
329void tox_self_get_public_key(Tox const *tox, uint8_t *public_key) 329void tox_self_get_public_key(const Tox *tox, uint8_t *public_key)
330{ 330{
331 const Messenger *m = tox; 331 const Messenger *m = tox;
332 332
@@ -334,7 +334,7 @@ void tox_self_get_public_key(Tox const *tox, uint8_t *public_key)
334 memcpy(public_key, m->net_crypto->self_public_key, crypto_box_PUBLICKEYBYTES); 334 memcpy(public_key, m->net_crypto->self_public_key, crypto_box_PUBLICKEYBYTES);
335} 335}
336 336
337void tox_self_get_private_key(Tox const *tox, uint8_t *private_key) 337void tox_self_get_private_key(const Tox *tox, uint8_t *private_key)
338{ 338{
339 const Messenger *m = tox; 339 const Messenger *m = tox;
340 340
@@ -342,7 +342,7 @@ void tox_self_get_private_key(Tox const *tox, uint8_t *private_key)
342 memcpy(private_key, m->net_crypto->self_secret_key, crypto_box_SECRETKEYBYTES); 342 memcpy(private_key, m->net_crypto->self_secret_key, crypto_box_SECRETKEYBYTES);
343} 343}
344 344
345bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET_INFO *error) 345bool tox_self_set_name(Tox *tox, const uint8_t *name, size_t length, TOX_ERR_SET_INFO *error)
346{ 346{
347 if (!name && length != 0) { 347 if (!name && length != 0) {
348 SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_NULL); 348 SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_NULL);
@@ -362,13 +362,13 @@ bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET
362 } 362 }
363} 363}
364 364
365size_t tox_self_get_name_size(Tox const *tox) 365size_t tox_self_get_name_size(const Tox *tox)
366{ 366{
367 const Messenger *m = tox; 367 const Messenger *m = tox;
368 return m_get_self_name_size(m); 368 return m_get_self_name_size(m);
369} 369}
370 370
371void tox_self_get_name(Tox const *tox, uint8_t *name) 371void tox_self_get_name(const Tox *tox, uint8_t *name)
372{ 372{
373 if (name) { 373 if (name) {
374 const Messenger *m = tox; 374 const Messenger *m = tox;
@@ -376,7 +376,7 @@ void tox_self_get_name(Tox const *tox, uint8_t *name)
376 } 376 }
377} 377}
378 378
379bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length, TOX_ERR_SET_INFO *error) 379bool tox_self_set_status_message(Tox *tox, const uint8_t *status, size_t length, TOX_ERR_SET_INFO *error)
380{ 380{
381 if (!status && length != 0) { 381 if (!status && length != 0) {
382 SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_NULL); 382 SET_ERROR_PARAMETER(error, TOX_ERR_SET_INFO_NULL);
@@ -394,13 +394,13 @@ bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length,
394 } 394 }
395} 395}
396 396
397size_t tox_self_get_status_message_size(Tox const *tox) 397size_t tox_self_get_status_message_size(const Tox *tox)
398{ 398{
399 const Messenger *m = tox; 399 const Messenger *m = tox;
400 return m_get_self_statusmessage_size(m); 400 return m_get_self_statusmessage_size(m);
401} 401}
402 402
403void tox_self_get_status_message(Tox const *tox, uint8_t *status) 403void tox_self_get_status_message(const Tox *tox, uint8_t *status)
404{ 404{
405 if (status) { 405 if (status) {
406 const Messenger *m = tox; 406 const Messenger *m = tox;
@@ -414,7 +414,7 @@ void tox_self_set_status(Tox *tox, TOX_STATUS user_status)
414 m_set_userstatus(m, user_status); 414 m_set_userstatus(m, user_status);
415} 415}
416 416
417TOX_STATUS tox_self_get_status(Tox const *tox) 417TOX_STATUS tox_self_get_status(const Tox *tox)
418{ 418{
419 const Messenger *m = tox; 419 const Messenger *m = tox;
420 return m_get_self_userstatus(m); 420 return m_get_self_userstatus(m);
@@ -454,7 +454,7 @@ static void set_friend_error(int32_t ret, TOX_ERR_FRIEND_ADD *error)
454 } 454 }
455} 455}
456 456
457uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message, size_t length, 457uint32_t tox_friend_add(Tox *tox, const uint8_t *address, const uint8_t *message, size_t length,
458 TOX_ERR_FRIEND_ADD *error) 458 TOX_ERR_FRIEND_ADD *error)
459{ 459{
460 if (!address || !message) { 460 if (!address || !message) {
@@ -474,7 +474,7 @@ uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message
474 return UINT32_MAX; 474 return UINT32_MAX;
475} 475}
476 476
477uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error) 477uint32_t tox_friend_add_norequest(Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_ADD *error)
478{ 478{
479 if (!public_key) { 479 if (!public_key) {
480 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_ADD_NULL); 480 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_ADD_NULL);
@@ -508,7 +508,7 @@ bool tox_friend_delete(Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_DELETE *
508 return 1; 508 return 1;
509} 509}
510 510
511uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error) 511uint32_t tox_friend_by_public_key(const Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error)
512{ 512{
513 if (!public_key) { 513 if (!public_key) {
514 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL); 514 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL);
@@ -527,7 +527,7 @@ uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX
527 return ret; 527 return ret;
528} 528}
529 529
530bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t *public_key, 530bool tox_friend_get_public_key(const Tox *tox, uint32_t friend_number, uint8_t *public_key,
531 TOX_ERR_FRIEND_GET_PUBLIC_KEY *error) 531 TOX_ERR_FRIEND_GET_PUBLIC_KEY *error)
532{ 532{
533 if (!public_key) { 533 if (!public_key) {
@@ -546,19 +546,19 @@ bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t *
546 return 1; 546 return 1;
547} 547}
548 548
549bool tox_friend_exists(Tox const *tox, uint32_t friend_number) 549bool tox_friend_exists(const Tox *tox, uint32_t friend_number)
550{ 550{
551 const Messenger *m = tox; 551 const Messenger *m = tox;
552 return m_friend_exists(m, friend_number); 552 return m_friend_exists(m, friend_number);
553} 553}
554 554
555size_t tox_friend_list_size(Tox const *tox) 555size_t tox_friend_list_size(const Tox *tox)
556{ 556{
557 const Messenger *m = tox; 557 const Messenger *m = tox;
558 return count_friendlist(m); 558 return count_friendlist(m);
559} 559}
560 560
561void tox_friend_list(Tox const *tox, uint32_t *list) 561void tox_friend_list(const Tox *tox, uint32_t *list)
562{ 562{
563 if (list) { 563 if (list) {
564 const Messenger *m = tox; 564 const Messenger *m = tox;
@@ -567,7 +567,7 @@ void tox_friend_list(Tox const *tox, uint32_t *list)
567 } 567 }
568} 568}
569 569
570size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error) 570size_t tox_friend_get_name_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error)
571{ 571{
572 const Messenger *m = tox; 572 const Messenger *m = tox;
573 int ret = m_get_name_size(m, friend_number); 573 int ret = m_get_name_size(m, friend_number);
@@ -581,7 +581,7 @@ size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_
581 return ret; 581 return ret;
582} 582}
583 583
584bool tox_friend_get_name(Tox const *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error) 584bool tox_friend_get_name(const Tox *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error)
585{ 585{
586 if (!name) { 586 if (!name) {
587 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_NULL); 587 SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_QUERY_NULL);
@@ -606,7 +606,7 @@ void tox_callback_friend_name(Tox *tox, tox_friend_name_cb *function, void *user
606 m_callback_friendmessage(m, function, user_data); 606 m_callback_friendmessage(m, function, user_data);
607} 607}
608 608
609size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error) 609size_t tox_friend_get_status_message_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error)
610{ 610{
611 const Messenger *m = tox; 611 const Messenger *m = tox;
612 int ret = m_get_statusmessage_size(m, friend_number); 612 int ret = m_get_statusmessage_size(m, friend_number);
@@ -620,7 +620,7 @@ size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number
620 return ret; 620 return ret;
621} 621}
622 622
623bool tox_friend_get_status_message(Tox const *tox, uint32_t friend_number, uint8_t *message, 623bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8_t *message,
624 TOX_ERR_FRIEND_QUERY *error) 624 TOX_ERR_FRIEND_QUERY *error)
625{ 625{
626 if (!message) { 626 if (!message) {
diff --git a/toxcore/tox.h b/toxcore/tox.h
index a3973ae9..2506779e 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -344,7 +344,7 @@ struct Tox_Options {
344 * 344 *
345 * This member is ignored (it can be NULL) if proxy_enabled is false. 345 * This member is ignored (it can be NULL) if proxy_enabled is false.
346 */ 346 */
347 char const *proxy_address; 347 const char *proxy_address;
348 348
349 /** 349 /**
350 * The port to use to connect to the proxy server. 350 * The port to use to connect to the proxy server.
@@ -474,7 +474,7 @@ typedef uint8_t TOX_ERR_NEW;
474 * 474 *
475 * @see tox_iteration for the event loop. 475 * @see tox_iteration for the event loop.
476 */ 476 */
477Tox *tox_new(struct Tox_Options const *options, uint8_t const *data, size_t length, TOX_ERR_NEW *error); 477Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t length, TOX_ERR_NEW *error);
478 478
479 479
480/** 480/**
@@ -493,7 +493,7 @@ void tox_kill(Tox *tox);
493 * 493 *
494 * @see threading for concurrency implications. 494 * @see threading for concurrency implications.
495 */ 495 */
496size_t tox_save_size(Tox const *tox); 496size_t tox_save_size(const Tox *tox);
497 497
498/** 498/**
499 * Store all information associated with the tox instance to a byte array. 499 * Store all information associated with the tox instance to a byte array.
@@ -502,7 +502,7 @@ size_t tox_save_size(Tox const *tox);
502 * Call tox_save_size to find the number of bytes required. If this parameter 502 * Call tox_save_size to find the number of bytes required. If this parameter
503 * is NULL, this function has no effect. 503 * is NULL, this function has no effect.
504 */ 504 */
505void tox_save(Tox const *tox, uint8_t *data); 505void tox_save(const Tox *tox, uint8_t *data);
506 506
507 507
508/******************************************************************************* 508/*******************************************************************************
@@ -546,7 +546,7 @@ typedef uint8_t TOX_ERR_BOOTSTRAP;
546 * (TOX_PUBLIC_KEY_SIZE bytes). 546 * (TOX_PUBLIC_KEY_SIZE bytes).
547 * @return true on success. 547 * @return true on success.
548 */ 548 */
549bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, TOX_ERR_BOOTSTRAP *error); 549bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error);
550 550
551 551
552/** 552/**
@@ -562,7 +562,7 @@ bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const *
562 * (TOX_PUBLIC_KEY_SIZE bytes). 562 * (TOX_PUBLIC_KEY_SIZE bytes).
563 * @return true on success. 563 * @return true on success.
564 */ 564 */
565bool tox_add_tcp_relay(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, 565bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key,
566 TOX_ERR_BOOTSTRAP *error); 566 TOX_ERR_BOOTSTRAP *error);
567 567
568 568
@@ -592,7 +592,7 @@ typedef uint8_t TOX_CONNECTION;
592 * Return whether we are connected to the DHT. The return value is equal to the 592 * Return whether we are connected to the DHT. The return value is equal to the
593 * last value received through the `connection_status` callback. 593 * last value received through the `connection_status` callback.
594 */ 594 */
595TOX_CONNECTION tox_get_connection_status(Tox const *tox); 595TOX_CONNECTION tox_get_connection_status(const Tox *tox);
596 596
597/** 597/**
598 * The function type for the `connection_status` callback. 598 * The function type for the `connection_status` callback.
@@ -620,7 +620,7 @@ void tox_callback_connection_status(Tox *tox, tox_connection_status_cb *function
620 * Return the time in milliseconds before tox_iteration() should be called again 620 * Return the time in milliseconds before tox_iteration() should be called again
621 * for optimal performance. 621 * for optimal performance.
622 */ 622 */
623uint32_t tox_iteration_interval(Tox const *tox); 623uint32_t tox_iteration_interval(const Tox *tox);
624 624
625 625
626/** 626/**
@@ -646,7 +646,7 @@ void tox_iteration(Tox *tox);
646 * parameter is NULL, this function has no effect. 646 * parameter is NULL, this function has no effect.
647 * @see TOX_ADDRESS_SIZE for the address format. 647 * @see TOX_ADDRESS_SIZE for the address format.
648 */ 648 */
649void tox_self_get_address(Tox const *tox, uint8_t *address); 649void tox_self_get_address(const Tox *tox, uint8_t *address);
650 650
651 651
652/** 652/**
@@ -659,7 +659,7 @@ void tox_self_set_nospam(Tox *tox, uint32_t nospam);
659/** 659/**
660 * Get the 4-byte nospam part of the address. 660 * Get the 4-byte nospam part of the address.
661 */ 661 */
662uint32_t tox_self_get_nospam(Tox const *tox); 662uint32_t tox_self_get_nospam(const Tox *tox);
663 663
664/** 664/**
665 * Copy the Tox Public Key (long term public key) from the Tox object. 665 * Copy the Tox Public Key (long term public key) from the Tox object.
@@ -667,7 +667,7 @@ uint32_t tox_self_get_nospam(Tox const *tox);
667 * @param public_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If 667 * @param public_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If
668 * this parameter is NULL, this function has no effect. 668 * this parameter is NULL, this function has no effect.
669 */ 669 */
670void tox_self_get_public_key(Tox const *tox, uint8_t *public_key); 670void tox_self_get_public_key(const Tox *tox, uint8_t *public_key);
671 671
672/** 672/**
673 * Copy the private key from the Tox object. 673 * Copy the private key from the Tox object.
@@ -675,7 +675,7 @@ void tox_self_get_public_key(Tox const *tox, uint8_t *public_key);
675 * @param private_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If 675 * @param private_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If
676 * this parameter is NULL, this function has no effect. 676 * this parameter is NULL, this function has no effect.
677 */ 677 */
678void tox_self_get_private_key(Tox const *tox, uint8_t *private_key); 678void tox_self_get_private_key(const Tox *tox, uint8_t *private_key);
679 679
680 680
681/******************************************************************************* 681/*******************************************************************************
@@ -710,7 +710,7 @@ typedef uint8_t TOX_ERR_SET_INFO;
710 * 710 *
711 * @return true on success. 711 * @return true on success.
712 */ 712 */
713bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET_INFO *error); 713bool tox_self_set_name(Tox *tox, const uint8_t *name, size_t length, TOX_ERR_SET_INFO *error);
714 714
715/** 715/**
716 * Return the length of the current nickname as passed to tox_self_set_name. 716 * Return the length of the current nickname as passed to tox_self_set_name.
@@ -720,7 +720,7 @@ bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET
720 * 720 *
721 * @see threading for concurrency implications. 721 * @see threading for concurrency implications.
722 */ 722 */
723size_t tox_self_get_name_size(Tox const *tox); 723size_t tox_self_get_name_size(const Tox *tox);
724 724
725/** 725/**
726 * Write the nickname set by tox_self_set_name to a byte array. 726 * Write the nickname set by tox_self_set_name to a byte array.
@@ -734,7 +734,7 @@ size_t tox_self_get_name_size(Tox const *tox);
734 * @param name A valid memory location large enough to hold the nickname. 734 * @param name A valid memory location large enough to hold the nickname.
735 * If this parameter is NULL, the function has no effect. 735 * If this parameter is NULL, the function has no effect.
736 */ 736 */
737void tox_self_get_name(Tox const *tox, uint8_t *name); 737void tox_self_get_name(const Tox *tox, uint8_t *name);
738 738
739/** 739/**
740 * Set the client's status message. 740 * Set the client's status message.
@@ -743,7 +743,7 @@ void tox_self_get_name(Tox const *tox, uint8_t *name);
743 * length is 0, the status parameter is ignored (it can be NULL), and the 743 * length is 0, the status parameter is ignored (it can be NULL), and the
744 * user status is set back to empty. 744 * user status is set back to empty.
745 */ 745 */
746bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length, TOX_ERR_SET_INFO *error); 746bool tox_self_set_status_message(Tox *tox, const uint8_t *status, size_t length, TOX_ERR_SET_INFO *error);
747 747
748/** 748/**
749 * Return the length of the current status message as passed to 749 * Return the length of the current status message as passed to
@@ -754,7 +754,7 @@ bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length,
754 * 754 *
755 * @see threading for concurrency implications. 755 * @see threading for concurrency implications.
756 */ 756 */
757size_t tox_self_get_status_message_size(Tox const *tox); 757size_t tox_self_get_status_message_size(const Tox *tox);
758 758
759/** 759/**
760 * Write the status message set by tox_self_set_status_message to a byte array. 760 * Write the status message set by tox_self_set_status_message to a byte array.
@@ -768,7 +768,7 @@ size_t tox_self_get_status_message_size(Tox const *tox);
768 * @param status A valid memory location large enough to hold the status message. 768 * @param status A valid memory location large enough to hold the status message.
769 * If this parameter is NULL, the function has no effect. 769 * If this parameter is NULL, the function has no effect.
770 */ 770 */
771void tox_self_get_status_message(Tox const *tox, uint8_t *status); 771void tox_self_get_status_message(const Tox *tox, uint8_t *status);
772 772
773 773
774/** 774/**
@@ -781,7 +781,7 @@ void tox_self_set_status(Tox *tox, TOX_STATUS user_status);
781/** 781/**
782 * Returns the client's user status. 782 * Returns the client's user status.
783 */ 783 */
784TOX_STATUS tox_self_get_status(Tox const *tox); 784TOX_STATUS tox_self_get_status(const Tox *tox);
785 785
786 786
787/******************************************************************************* 787/*******************************************************************************
@@ -850,7 +850,7 @@ typedef uint8_t TOX_ERR_FRIEND_ADD;
850 * 850 *
851 * @return the friend number on success, UINT32_MAX on failure. 851 * @return the friend number on success, UINT32_MAX on failure.
852 */ 852 */
853uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message, size_t length, 853uint32_t tox_friend_add(Tox *tox, const uint8_t *address, const uint8_t *message, size_t length,
854 TOX_ERR_FRIEND_ADD *error); 854 TOX_ERR_FRIEND_ADD *error);
855 855
856 856
@@ -872,7 +872,7 @@ uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message
872 * @return the friend number on success, UINT32_MAX on failure. 872 * @return the friend number on success, UINT32_MAX on failure.
873 * @see tox_friend_add for a more detailed description of friend numbers. 873 * @see tox_friend_add for a more detailed description of friend numbers.
874 */ 874 */
875uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error); 875uint32_t tox_friend_add_norequest(Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_ADD *error);
876 876
877 877
878enum TOX_ERR_FRIEND_DELETE { 878enum TOX_ERR_FRIEND_DELETE {
@@ -921,7 +921,7 @@ typedef uint8_t TOX_ERR_FRIEND_BY_PUBLIC_KEY;
921 * @return the friend number on success, UINT32_MAX on failure. 921 * @return the friend number on success, UINT32_MAX on failure.
922 * @param public_key A byte array containing the Public Key. 922 * @param public_key A byte array containing the Public Key.
923 */ 923 */
924uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); 924uint32_t tox_friend_by_public_key(const Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error);
925 925
926 926
927enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { 927enum TOX_ERR_FRIEND_GET_PUBLIC_KEY {
@@ -943,7 +943,7 @@ typedef uint8_t TOX_ERR_FRIEND_GET_PUBLIC_KEY;
943 * 943 *
944 * @return true on success. 944 * @return true on success.
945 */ 945 */
946bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t *public_key, 946bool tox_friend_get_public_key(const Tox *tox, uint32_t friend_number, uint8_t *public_key,
947 TOX_ERR_FRIEND_GET_PUBLIC_KEY *error); 947 TOX_ERR_FRIEND_GET_PUBLIC_KEY *error);
948 948
949 949
@@ -951,7 +951,7 @@ bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t *
951 * Checks if a friend with the given friend number exists and returns true if 951 * Checks if a friend with the given friend number exists and returns true if
952 * it does. 952 * it does.
953 */ 953 */
954bool tox_friend_exists(Tox const *tox, uint32_t friend_number); 954bool tox_friend_exists(const Tox *tox, uint32_t friend_number);
955 955
956 956
957/** 957/**
@@ -960,7 +960,7 @@ bool tox_friend_exists(Tox const *tox, uint32_t friend_number);
960 * This function can be used to determine how much memory to allocate for 960 * This function can be used to determine how much memory to allocate for
961 * tox_friend_list. 961 * tox_friend_list.
962 */ 962 */
963size_t tox_friend_list_size(Tox const *tox); 963size_t tox_friend_list_size(const Tox *tox);
964 964
965 965
966/** 966/**
@@ -971,7 +971,7 @@ size_t tox_friend_list_size(Tox const *tox);
971 * @param list A memory region with enough space to hold the friend list. If 971 * @param list A memory region with enough space to hold the friend list. If
972 * this parameter is NULL, this function has no effect. 972 * this parameter is NULL, this function has no effect.
973 */ 973 */
974void tox_friend_list(Tox const *tox, uint32_t *list); 974void tox_friend_list(const Tox *tox, uint32_t *list);
975 975
976 976
977 977
@@ -1007,7 +1007,7 @@ typedef uint8_t TOX_ERR_FRIEND_QUERY;
1007 * The return value is equal to the `length` argument received by the last 1007 * The return value is equal to the `length` argument received by the last
1008 * `friend_name` callback. 1008 * `friend_name` callback.
1009 */ 1009 */
1010size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); 1010size_t tox_friend_get_name_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
1011 1011
1012/** 1012/**
1013 * Write the name of the friend designated by the given friend number to a byte 1013 * Write the name of the friend designated by the given friend number to a byte
@@ -1023,7 +1023,7 @@ size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_
1023 * 1023 *
1024 * @return true on success. 1024 * @return true on success.
1025 */ 1025 */
1026bool tox_friend_get_name(Tox const *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error); 1026bool tox_friend_get_name(const Tox *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error);
1027 1027
1028/** 1028/**
1029 * The function type for the `friend_name` callback. 1029 * The function type for the `friend_name` callback.
@@ -1034,7 +1034,7 @@ bool tox_friend_get_name(Tox const *tox, uint32_t friend_number, uint8_t *name,
1034 * @param length A value equal to the return value of 1034 * @param length A value equal to the return value of
1035 * tox_friend_get_name_size. 1035 * tox_friend_get_name_size.
1036 */ 1036 */
1037typedef void tox_friend_name_cb(Tox *tox, uint32_t friend_number, uint8_t const *name, size_t length, void *user_data); 1037typedef void tox_friend_name_cb(Tox *tox, uint32_t friend_number, const uint8_t *name, size_t length, void *user_data);
1038 1038
1039/** 1039/**
1040 * Set the callback for the `friend_name` event. Pass NULL to unset. 1040 * Set the callback for the `friend_name` event. Pass NULL to unset.
@@ -1048,7 +1048,7 @@ void tox_callback_friend_name(Tox *tox, tox_friend_name_cb *function, void *user
1048 * Return the length of the friend's status message. If the friend number is 1048 * Return the length of the friend's status message. If the friend number is
1049 * invalid, the return value is SIZE_MAX. 1049 * invalid, the return value is SIZE_MAX.
1050 */ 1050 */
1051size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); 1051size_t tox_friend_get_status_message_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
1052 1052
1053/** 1053/**
1054 * Write the name of the friend designated by the given friend number to a byte 1054 * Write the name of the friend designated by the given friend number to a byte
@@ -1062,7 +1062,7 @@ size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number
1062 * 1062 *
1063 * @param name A valid memory region large enough to store the friend's name. 1063 * @param name A valid memory region large enough to store the friend's name.
1064 */ 1064 */
1065bool tox_friend_get_status_message(Tox const *tox, uint32_t friend_number, uint8_t *message, 1065bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8_t *message,
1066 TOX_ERR_FRIEND_QUERY *error); 1066 TOX_ERR_FRIEND_QUERY *error);
1067 1067
1068/** 1068/**
@@ -1075,7 +1075,7 @@ bool tox_friend_get_status_message(Tox const *tox, uint32_t friend_number, uint8
1075 * @param length A value equal to the return value of 1075 * @param length A value equal to the return value of
1076 * tox_friend_get_status_message_size. 1076 * tox_friend_get_status_message_size.
1077 */ 1077 */
1078typedef void tox_friend_status_message_cb(Tox *tox, uint32_t friend_number, uint8_t const *message, size_t length, 1078typedef void tox_friend_status_message_cb(Tox *tox, uint32_t friend_number, const uint8_t *message, size_t length,
1079 void *user_data); 1079 void *user_data);
1080 1080
1081/** 1081/**
@@ -1093,7 +1093,7 @@ void tox_callback_friend_status_message(Tox *tox, tox_friend_status_message_cb *
1093 * The status returned is equal to the last status received through the 1093 * The status returned is equal to the last status received through the
1094 * `friend_status` callback. 1094 * `friend_status` callback.
1095 */ 1095 */
1096TOX_STATUS tox_friend_get_status(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); 1096TOX_STATUS tox_friend_get_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
1097 1097
1098/** 1098/**
1099 * The function type for the `friend_status` callback. 1099 * The function type for the `friend_status` callback.
@@ -1124,7 +1124,7 @@ void tox_callback_friend_status(Tox *tox, tox_friend_status_cb *function, void *
1124 * @return the friend's connection status as it was received through the 1124 * @return the friend's connection status as it was received through the
1125 * `friend_connection_status` event. 1125 * `friend_connection_status` event.
1126 */ 1126 */
1127TOX_CONNECTION tox_friend_get_connection_status(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); 1127TOX_CONNECTION tox_friend_get_connection_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
1128 1128
1129/** 1129/**
1130 * The function type for the `friend_connection_status` callback. 1130 * The function type for the `friend_connection_status` callback.
@@ -1159,7 +1159,7 @@ void tox_callback_friend_connection_status(Tox *tox, tox_friend_connection_statu
1159 * @return false if the friend is not typing, or the friend number was 1159 * @return false if the friend is not typing, or the friend number was
1160 * invalid. Inspect the error code to determine which case it is. 1160 * invalid. Inspect the error code to determine which case it is.
1161 */ 1161 */
1162bool tox_friend_get_typing(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); 1162bool tox_friend_get_typing(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
1163 1163
1164/** 1164/**
1165 * The function type for the `friend_typing` callback. 1165 * The function type for the `friend_typing` callback.
@@ -1251,7 +1251,7 @@ typedef uint8_t TOX_ERR_SEND_MESSAGE;
1251 * incremented by 1 each time a message is sent. If UINT32_MAX messages were 1251 * incremented by 1 each time a message is sent. If UINT32_MAX messages were
1252 * sent, the next message ID is 0. 1252 * sent, the next message ID is 0.
1253 */ 1253 */
1254uint32_t tox_send_message(Tox *tox, uint32_t friend_number, uint8_t const *message, size_t length, 1254uint32_t tox_send_message(Tox *tox, uint32_t friend_number, const uint8_t *message, size_t length,
1255 TOX_ERR_SEND_MESSAGE *error); 1255 TOX_ERR_SEND_MESSAGE *error);
1256 1256
1257 1257
@@ -1266,7 +1266,7 @@ uint32_t tox_send_message(Tox *tox, uint32_t friend_number, uint8_t const *messa
1266 * 1266 *
1267 * @see tox_send_message for more details. 1267 * @see tox_send_message for more details.
1268 */ 1268 */
1269uint32_t tox_send_action(Tox *tox, uint32_t friend_number, uint8_t const *action, size_t length, 1269uint32_t tox_send_action(Tox *tox, uint32_t friend_number, const uint8_t *action, size_t length,
1270 TOX_ERR_SEND_MESSAGE *error); 1270 TOX_ERR_SEND_MESSAGE *error);
1271 1271
1272 1272
@@ -1310,7 +1310,7 @@ void tox_callback_read_receipt(Tox *tox, tox_read_receipt_cb *function, void *us
1310 * @param message The message they sent along with the request. 1310 * @param message The message they sent along with the request.
1311 * @param length The size of the message byte array. 1311 * @param length The size of the message byte array.
1312 */ 1312 */
1313typedef void tox_friend_request_cb(Tox *tox, uint8_t const *public_key, /*uint32_t time_delta, */uint8_t const *message, 1313typedef void tox_friend_request_cb(Tox *tox, const uint8_t *public_key, /*uint32_t time_delta, */const uint8_t *message,
1314 size_t length, void *user_data); 1314 size_t length, void *user_data);
1315 1315
1316/** 1316/**
@@ -1331,7 +1331,7 @@ void tox_callback_friend_request(Tox *tox, tox_friend_request_cb *function, void
1331 * 1331 *
1332 * @see tox_friend_request_cb for more information on time_delta. 1332 * @see tox_friend_request_cb for more information on time_delta.
1333 */ 1333 */
1334typedef void tox_friend_message_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */uint8_t const *message, 1334typedef void tox_friend_message_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */const uint8_t *message,
1335 size_t length, void *user_data); 1335 size_t length, void *user_data);
1336 1336
1337/** 1337/**
@@ -1352,7 +1352,7 @@ void tox_callback_friend_message(Tox *tox, tox_friend_message_cb *function, void
1352 * 1352 *
1353 * @see tox_friend_request_cb for more information on time_delta. 1353 * @see tox_friend_request_cb for more information on time_delta.
1354 */ 1354 */
1355typedef void tox_friend_action_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */uint8_t const *action, 1355typedef void tox_friend_action_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */const uint8_t *action,
1356 size_t length, void *user_data); 1356 size_t length, void *user_data);
1357 1357
1358/** 1358/**
@@ -1416,7 +1416,7 @@ typedef uint8_t TOX_FILE_KIND;
1416 * 1416 *
1417 * @return true if hash was not NULL. 1417 * @return true if hash was not NULL.
1418 */ 1418 */
1419bool tox_hash(uint8_t *hash, uint8_t const *data, size_t length); 1419bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length);
1420 1420
1421 1421
1422enum TOX_FILE_CONTROL { 1422enum TOX_FILE_CONTROL {
@@ -1597,7 +1597,7 @@ typedef uint8_t TOX_ERR_FILE_SEND;
1597 * number is per friend. File numbers are reused after a transfer terminates. 1597 * number is per friend. File numbers are reused after a transfer terminates.
1598 */ 1598 */
1599uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uint64_t file_size, 1599uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uint64_t file_size,
1600 uint8_t const *filename, size_t filename_length, TOX_ERR_FILE_SEND *error); 1600 const uint8_t *filename, size_t filename_length, TOX_ERR_FILE_SEND *error);
1601 1601
1602 1602
1603enum TOX_ERR_FILE_SEND_CHUNK { 1603enum TOX_ERR_FILE_SEND_CHUNK {
@@ -1640,7 +1640,7 @@ typedef uint8_t TOX_ERR_FILE_SEND_CHUNK;
1640 * 1640 *
1641 * @return true on success. 1641 * @return true on success.
1642 */ 1642 */
1643bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number, uint8_t const *data, size_t length, 1643bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number, const uint8_t *data, size_t length,
1644 TOX_ERR_FILE_SEND_CHUNK *error); 1644 TOX_ERR_FILE_SEND_CHUNK *error);
1645 1645
1646 1646
@@ -1702,7 +1702,7 @@ void tox_callback_file_request_chunk(Tox *tox, tox_file_request_chunk_cb *functi
1702 * associated with. 1702 * associated with.
1703 */ 1703 */
1704typedef void tox_file_receive_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_KIND kind, 1704typedef void tox_file_receive_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_KIND kind,
1705 uint64_t file_size, uint8_t const *filename, size_t filename_length, void *user_data); 1705 uint64_t file_size, const uint8_t *filename, size_t filename_length, void *user_data);
1706 1706
1707/** 1707/**
1708 * Set the callback for the `file_receive` event. Pass NULL to unset. 1708 * Set the callback for the `file_receive` event. Pass NULL to unset.
@@ -1734,7 +1734,7 @@ void tox_callback_file_receive(Tox *tox, tox_file_receive_cb *function, void *us
1734 * @param length The length of the received chunk. 1734 * @param length The length of the received chunk.
1735 */ 1735 */
1736typedef void tox_file_receive_chunk_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position, 1736typedef void tox_file_receive_chunk_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position,
1737 uint8_t const *data, size_t length, void *user_data); 1737 const uint8_t *data, size_t length, void *user_data);
1738 1738
1739/** 1739/**
1740 * Set the callback for the `file_receive_chunk` event. Pass NULL to unset. 1740 * Set the callback for the `file_receive_chunk` event. Pass NULL to unset.
@@ -1814,7 +1814,7 @@ typedef uint8_t TOX_ERR_SEND_CUSTOM_PACKET;
1814 * 1814 *
1815 * @return true on success. 1815 * @return true on success.
1816 */ 1816 */
1817bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, 1817bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length,
1818 TOX_ERR_SEND_CUSTOM_PACKET *error); 1818 TOX_ERR_SEND_CUSTOM_PACKET *error);
1819 1819
1820/** 1820/**
@@ -1824,7 +1824,7 @@ bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, uint8_t const *data
1824 * @param data A byte array containing the received packet data. 1824 * @param data A byte array containing the received packet data.
1825 * @param length The length of the packet data byte array. 1825 * @param length The length of the packet data byte array.
1826 */ 1826 */
1827typedef void tox_friend_lossy_packet_cb(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, 1827typedef void tox_friend_lossy_packet_cb(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length,
1828 void *user_data); 1828 void *user_data);
1829 1829
1830/** 1830/**
@@ -1849,7 +1849,7 @@ void tox_callback_friend_lossy_packet(Tox *tox, tox_friend_lossy_packet_cb *func
1849 * 1849 *
1850 * @return true on success. 1850 * @return true on success.
1851 */ 1851 */
1852bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, 1852bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length,
1853 TOX_ERR_SEND_CUSTOM_PACKET *error); 1853 TOX_ERR_SEND_CUSTOM_PACKET *error);
1854 1854
1855/** 1855/**
@@ -1859,7 +1859,7 @@ bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, uint8_t const *d
1859 * @param data A byte array containing the received packet data. 1859 * @param data A byte array containing the received packet data.
1860 * @param length The length of the packet data byte array. 1860 * @param length The length of the packet data byte array.
1861 */ 1861 */
1862typedef void tox_friend_lossless_packet_cb(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, 1862typedef void tox_friend_lossless_packet_cb(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length,
1863 void *user_data); 1863 void *user_data);
1864 1864
1865/** 1865/**
@@ -1888,7 +1888,7 @@ void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb
1888 * @param dht_id A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If this 1888 * @param dht_id A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If this
1889 * parameter is NULL, this function has no effect. 1889 * parameter is NULL, this function has no effect.
1890 */ 1890 */
1891void tox_get_dht_id(Tox const *tox, uint8_t *dht_id); 1891void tox_get_dht_id(const Tox *tox, uint8_t *dht_id);
1892 1892
1893 1893
1894enum TOX_ERR_GET_PORT { 1894enum TOX_ERR_GET_PORT {
@@ -1903,13 +1903,13 @@ typedef uint8_t TOX_ERR_GET_PORT;
1903/** 1903/**
1904 * Return the UDP port this Tox instance is bound to. 1904 * Return the UDP port this Tox instance is bound to.
1905 */ 1905 */
1906uint16_t tox_get_udp_port(Tox const *tox, TOX_ERR_GET_PORT *error); 1906uint16_t tox_get_udp_port(const Tox *tox, TOX_ERR_GET_PORT *error);
1907 1907
1908/** 1908/**
1909 * Return the TCP port this Tox instance is bound to. This is only relevant if 1909 * Return the TCP port this Tox instance is bound to. This is only relevant if
1910 * the instance is acting as a TCP relay. 1910 * the instance is acting as a TCP relay.
1911 */ 1911 */
1912uint16_t tox_get_tcp_port(Tox const *tox, TOX_ERR_GET_PORT *error); 1912uint16_t tox_get_tcp_port(const Tox *tox, TOX_ERR_GET_PORT *error);
1913 1913
1914 1914
1915#ifdef __cplusplus 1915#ifdef __cplusplus