summaryrefslogtreecommitdiff
path: root/toxcore/TCP_connection.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-13 22:01:45 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-13 22:01:45 +0100
commit45d28904b92c825d1ac88be9edae8baabcd4bba1 (patch)
tree7b1b259ba09d35867c141cf072707e6a0891f97a /toxcore/TCP_connection.h
parenta8823830d39bdbde8d4f4f34bfcb26dc4bf79741 (diff)
Use <stdbool.h> and replace _Bool with bool.
This header is a requirement for the public API, therefore is assumed to exist. It is a C99 standard library header, and _Bool is not intended to be used directly, except in legacy code that defines bool (and true/false) itself. We don't use or depend on such code. None of our client code uses or depends on such code. There is no reason to not use bool.
Diffstat (limited to 'toxcore/TCP_connection.h')
-rw-r--r--toxcore/TCP_connection.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h
index e080c7e2..e0a3988e 100644
--- a/toxcore/TCP_connection.h
+++ b/toxcore/TCP_connection.h
@@ -70,12 +70,12 @@ typedef struct {
70 uint64_t connected_time; 70 uint64_t connected_time;
71 uint32_t lock_count; 71 uint32_t lock_count;
72 uint32_t sleep_count; 72 uint32_t sleep_count;
73 _Bool onion; 73 bool onion;
74 74
75 /* Only used when connection is sleeping. */ 75 /* Only used when connection is sleeping. */
76 IP_Port ip_port; 76 IP_Port ip_port;
77 uint8_t relay_pk[crypto_box_PUBLICKEYBYTES]; 77 uint8_t relay_pk[crypto_box_PUBLICKEYBYTES];
78 _Bool unsleep; /* set to 1 to unsleep connection. */ 78 bool unsleep; /* set to 1 to unsleep connection. */
79} TCP_con; 79} TCP_con;
80 80
81typedef struct { 81typedef struct {
@@ -102,7 +102,7 @@ typedef struct {
102 102
103 TCP_Proxy_Info proxy_info; 103 TCP_Proxy_Info proxy_info;
104 104
105 _Bool onion_status; 105 bool onion_status;
106 uint16_t onion_num_conns; 106 uint16_t onion_num_conns;
107} TCP_Connections; 107} TCP_Connections;
108 108
@@ -138,7 +138,7 @@ int tcp_send_onion_request(TCP_Connections *tcp_c, unsigned int tcp_connections_
138 * return 0 on success. 138 * return 0 on success.
139 * return -1 on failure. 139 * return -1 on failure.
140 */ 140 */
141int set_tcp_onion_status(TCP_Connections *tcp_c, _Bool status); 141int set_tcp_onion_status(TCP_Connections *tcp_c, bool status);
142 142
143/* Send an oob packet via the TCP relay corresponding to tcp_connections_number. 143/* Send an oob packet via the TCP relay corresponding to tcp_connections_number.
144 * 144 *
@@ -190,7 +190,7 @@ int kill_tcp_connection_to(TCP_Connections *tcp_c, int connections_number);
190 * return 0 on success. 190 * return 0 on success.
191 * return -1 on failure. 191 * return -1 on failure.
192 */ 192 */
193int set_tcp_connection_to_status(TCP_Connections *tcp_c, int connections_number, _Bool status); 193int set_tcp_connection_to_status(TCP_Connections *tcp_c, int connections_number, bool status);
194 194
195/* return number of online tcp relays tied to the connection on success. 195/* return number of online tcp relays tied to the connection on success.
196 * return 0 on failure. 196 * return 0 on failure.