diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-01 00:33:20 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-01 16:35:46 +0100 |
commit | 77db27331eb326615395fa59f3741424f85887bb (patch) | |
tree | 233270b558c30f9a045e30e09c2d5681c800a139 /toxcore | |
parent | ad135181531e567255c314593984d16cdb839eba (diff) |
Sort #includes in all source files.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/DHT.c | 2 | ||||
-rw-r--r-- | toxcore/LAN_discovery.c | 2 | ||||
-rw-r--r-- | toxcore/Messenger.c | 2 | ||||
-rw-r--r-- | toxcore/Messenger.h | 2 | ||||
-rw-r--r-- | toxcore/TCP_client.h | 2 | ||||
-rw-r--r-- | toxcore/TCP_server.h | 2 | ||||
-rw-r--r-- | toxcore/assoc.c | 2 | ||||
-rw-r--r-- | toxcore/crypto_core.h | 4 | ||||
-rw-r--r-- | toxcore/friend_connection.h | 2 | ||||
-rw-r--r-- | toxcore/list.h | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.c | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.h | 2 | ||||
-rw-r--r-- | toxcore/network.h | 17 | ||||
-rw-r--r-- | toxcore/onion_announce.c | 2 | ||||
-rw-r--r-- | toxcore/onion_client.c | 2 | ||||
-rw-r--r-- | toxcore/onion_client.h | 2 | ||||
-rw-r--r-- | toxcore/ping.c | 2 | ||||
-rw-r--r-- | toxcore/ping_array.c | 2 | ||||
-rw-r--r-- | toxcore/util.h | 2 |
19 files changed, 28 insertions, 27 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 538cd220..c9fa9939 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -41,9 +41,9 @@ | |||
41 | 41 | ||
42 | #include "ping.h" | 42 | #include "ping.h" |
43 | 43 | ||
44 | #include "network.h" | ||
45 | #include "LAN_discovery.h" | 44 | #include "LAN_discovery.h" |
46 | #include "misc_tools.h" | 45 | #include "misc_tools.h" |
46 | #include "network.h" | ||
47 | #include "util.h" | 47 | #include "util.h" |
48 | 48 | ||
49 | /* The timeout after which a node is discarded completely. */ | 49 | /* The timeout after which a node is discarded completely. */ |
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index d430c3fe..ab28f612 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -30,9 +30,9 @@ | |||
30 | 30 | ||
31 | /* Used for get_broadcast(). */ | 31 | /* Used for get_broadcast(). */ |
32 | #ifdef __linux | 32 | #ifdef __linux |
33 | #include <sys/ioctl.h> | ||
34 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
35 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
35 | #include <sys/ioctl.h> | ||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #define MAX_INTERFACES 16 | 38 | #define MAX_INTERFACES 16 |
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 0d3f10b5..81e17b7b 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -29,9 +29,9 @@ | |||
29 | #include <assert.h> | 29 | #include <assert.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #include "logger.h" | ||
33 | #include "Messenger.h" | 32 | #include "Messenger.h" |
34 | #include "assoc.h" | 33 | #include "assoc.h" |
34 | #include "logger.h" | ||
35 | #include "network.h" | 35 | #include "network.h" |
36 | #include "util.h" | 36 | #include "util.h" |
37 | 37 | ||
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index 75427965..a59f8c4e 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #ifndef MESSENGER_H | 26 | #ifndef MESSENGER_H |
27 | #define MESSENGER_H | 27 | #define MESSENGER_H |
28 | 28 | ||
29 | #include "friend_requests.h" | ||
30 | #include "friend_connection.h" | 29 | #include "friend_connection.h" |
30 | #include "friend_requests.h" | ||
31 | #include "logger.h" | 31 | #include "logger.h" |
32 | 32 | ||
33 | #define MAX_NAME_LENGTH 128 | 33 | #define MAX_NAME_LENGTH 128 |
diff --git a/toxcore/TCP_client.h b/toxcore/TCP_client.h index 37ab30a7..44049698 100644 --- a/toxcore/TCP_client.h +++ b/toxcore/TCP_client.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #ifndef TCP_CLIENT_H | 24 | #ifndef TCP_CLIENT_H |
25 | #define TCP_CLIENT_H | 25 | #define TCP_CLIENT_H |
26 | 26 | ||
27 | #include "crypto_core.h" | ||
28 | #include "TCP_server.h" | 27 | #include "TCP_server.h" |
28 | #include "crypto_core.h" | ||
29 | 29 | ||
30 | #define TCP_CONNECTION_TIMEOUT 10 | 30 | #define TCP_CONNECTION_TIMEOUT 10 |
31 | 31 | ||
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h index 3f6b18ae..908916ef 100644 --- a/toxcore/TCP_server.h +++ b/toxcore/TCP_server.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define TCP_SERVER_H | 24 | #define TCP_SERVER_H |
25 | 25 | ||
26 | #include "crypto_core.h" | 26 | #include "crypto_core.h" |
27 | #include "onion.h" | ||
28 | #include "list.h" | 27 | #include "list.h" |
28 | #include "onion.h" | ||
29 | 29 | ||
30 | #ifdef TCP_SERVER_USE_EPOLL | 30 | #ifdef TCP_SERVER_USE_EPOLL |
31 | #include "sys/epoll.h" | 31 | #include "sys/epoll.h" |
diff --git a/toxcore/assoc.c b/toxcore/assoc.c index 14f56fb3..3a033851 100644 --- a/toxcore/assoc.c +++ b/toxcore/assoc.c | |||
@@ -3,9 +3,9 @@ | |||
3 | #include "config.h" | 3 | #include "config.h" |
4 | #endif | 4 | #endif |
5 | 5 | ||
6 | #include "logger.h" | ||
7 | #include "DHT.h" | 6 | #include "DHT.h" |
8 | #include "assoc.h" | 7 | #include "assoc.h" |
8 | #include "logger.h" | ||
9 | #include "ping.h" | 9 | #include "ping.h" |
10 | 10 | ||
11 | #include "LAN_discovery.h" | 11 | #include "LAN_discovery.h" |
diff --git a/toxcore/crypto_core.h b/toxcore/crypto_core.h index 1c9d7f94..2e89896b 100644 --- a/toxcore/crypto_core.h +++ b/toxcore/crypto_core.h | |||
@@ -30,12 +30,12 @@ | |||
30 | #include <sodium.h> | 30 | #include <sodium.h> |
31 | #else | 31 | #else |
32 | #include <crypto_box.h> | 32 | #include <crypto_box.h> |
33 | #include <randombytes.h> | ||
34 | #include <crypto_hash_sha256.h> | 33 | #include <crypto_hash_sha256.h> |
35 | #include <crypto_hash_sha512.h> | 34 | #include <crypto_hash_sha512.h> |
35 | #include <crypto_scalarmult_curve25519.h> | ||
36 | #include <crypto_verify_16.h> | 36 | #include <crypto_verify_16.h> |
37 | #include <crypto_verify_32.h> | 37 | #include <crypto_verify_32.h> |
38 | #include <crypto_scalarmult_curve25519.h> | 38 | #include <randombytes.h> |
39 | #define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES) | 39 | #define crypto_box_MACBYTES (crypto_box_ZEROBYTES - crypto_box_BOXZEROBYTES) |
40 | /* I know */ | 40 | /* I know */ |
41 | #define sodium_memcmp(a, b, c) memcmp(a, b, c) | 41 | #define sodium_memcmp(a, b, c) memcmp(a, b, c) |
diff --git a/toxcore/friend_connection.h b/toxcore/friend_connection.h index ecfc55ab..cbc6b9a1 100644 --- a/toxcore/friend_connection.h +++ b/toxcore/friend_connection.h | |||
@@ -25,9 +25,9 @@ | |||
25 | #ifndef FRIEND_CONNECTION_H | 25 | #ifndef FRIEND_CONNECTION_H |
26 | #define FRIEND_CONNECTION_H | 26 | #define FRIEND_CONNECTION_H |
27 | 27 | ||
28 | #include "net_crypto.h" | ||
29 | #include "DHT.h" | 28 | #include "DHT.h" |
30 | #include "LAN_discovery.h" | 29 | #include "LAN_discovery.h" |
30 | #include "net_crypto.h" | ||
31 | #include "onion_client.h" | 31 | #include "onion_client.h" |
32 | 32 | ||
33 | 33 | ||
diff --git a/toxcore/list.h b/toxcore/list.h index b04177e1..aac72e81 100644 --- a/toxcore/list.h +++ b/toxcore/list.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #ifndef LIST_H | 26 | #ifndef LIST_H |
27 | #define LIST_H | 27 | #define LIST_H |
28 | 28 | ||
29 | #include <stdlib.h> | ||
30 | #include <stdint.h> | 29 | #include <stdint.h> |
30 | #include <stdlib.h> | ||
31 | #include <string.h> | 31 | #include <string.h> |
32 | 32 | ||
33 | typedef struct { | 33 | typedef struct { |
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 8ae8acf8..63043494 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -27,9 +27,9 @@ | |||
27 | #include "config.h" | 27 | #include "config.h" |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #include "math.h" | ||
30 | #include "net_crypto.h" | 31 | #include "net_crypto.h" |
31 | #include "util.h" | 32 | #include "util.h" |
32 | #include "math.h" | ||
33 | 33 | ||
34 | static uint8_t crypt_connection_id_not_valid(const Net_Crypto *c, int crypt_connection_id) | 34 | static uint8_t crypt_connection_id_not_valid(const Net_Crypto *c, int crypt_connection_id) |
35 | { | 35 | { |
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index 9be71020..6a3ba40f 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -24,11 +24,11 @@ | |||
24 | #ifndef NET_CRYPTO_H | 24 | #ifndef NET_CRYPTO_H |
25 | #define NET_CRYPTO_H | 25 | #define NET_CRYPTO_H |
26 | 26 | ||
27 | #include <pthread.h> | ||
27 | #include "DHT.h" | 28 | #include "DHT.h" |
28 | #include "LAN_discovery.h" | 29 | #include "LAN_discovery.h" |
29 | #include "TCP_connection.h" | 30 | #include "TCP_connection.h" |
30 | #include "logger.h" | 31 | #include "logger.h" |
31 | #include <pthread.h> | ||
32 | 32 | ||
33 | #define CRYPTO_CONN_NO_CONNECTION 0 | 33 | #define CRYPTO_CONN_NO_CONNECTION 0 |
34 | #define CRYPTO_CONN_COOKIE_REQUESTING 1 //send cookie request packets | 34 | #define CRYPTO_CONN_COOKIE_REQUESTING 1 //send cookie request packets |
diff --git a/toxcore/network.h b/toxcore/network.h index 1cd1c999..5cc16523 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -25,15 +25,16 @@ | |||
25 | #define NETWORK_H | 25 | #define NETWORK_H |
26 | 26 | ||
27 | #ifdef PLAN9 | 27 | #ifdef PLAN9 |
28 | #include <u.h> //Plan 9 requires this is imported first | 28 | #include <u.h> // Plan 9 requires this is imported first |
29 | // Comment line here to avoid reordering by source code formatters. | ||
29 | #include <libc.h> | 30 | #include <libc.h> |
30 | #endif | 31 | #endif |
31 | 32 | ||
32 | #include "logger.h" | 33 | #include "logger.h" |
33 | 34 | ||
34 | #include <stdlib.h> | ||
35 | #include <stdio.h> | ||
36 | #include <stdint.h> | 35 | #include <stdint.h> |
36 | #include <stdio.h> | ||
37 | #include <stdlib.h> | ||
37 | #include <string.h> | 38 | #include <string.h> |
38 | #include <time.h> | 39 | #include <time.h> |
39 | 40 | ||
@@ -42,8 +43,8 @@ | |||
42 | //Windows XP | 43 | //Windows XP |
43 | #define WINVER 0x0501 | 44 | #define WINVER 0x0501 |
44 | #endif | 45 | #endif |
45 | #include <winsock2.h> | ||
46 | #include <windows.h> | 46 | #include <windows.h> |
47 | #include <winsock2.h> | ||
47 | #include <ws2tcpip.h> | 48 | #include <ws2tcpip.h> |
48 | 49 | ||
49 | #ifndef IPV6_V6ONLY | 50 | #ifndef IPV6_V6ONLY |
@@ -60,14 +61,14 @@ typedef short sa_family_t; | |||
60 | 61 | ||
61 | #else // Linux includes | 62 | #else // Linux includes |
62 | 63 | ||
63 | #include <fcntl.h> | ||
64 | #include <sys/socket.h> | ||
65 | #include <netinet/in.h> | ||
66 | #include <arpa/inet.h> | 64 | #include <arpa/inet.h> |
67 | #include <errno.h> | 65 | #include <errno.h> |
66 | #include <fcntl.h> | ||
67 | #include <netdb.h> | ||
68 | #include <netinet/in.h> | ||
69 | #include <sys/socket.h> | ||
68 | #include <sys/time.h> | 70 | #include <sys/time.h> |
69 | #include <sys/types.h> | 71 | #include <sys/types.h> |
70 | #include <netdb.h> | ||
71 | #include <unistd.h> | 72 | #include <unistd.h> |
72 | 73 | ||
73 | typedef int sock_t; | 74 | typedef int sock_t; |
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 08492bb9..cebd56bb 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #include "onion_announce.h" | ||
27 | #include "LAN_discovery.h" | 26 | #include "LAN_discovery.h" |
27 | #include "onion_announce.h" | ||
28 | #include "util.h" | 28 | #include "util.h" |
29 | 29 | ||
30 | #define PING_ID_TIMEOUT 20 | 30 | #define PING_ID_TIMEOUT 20 |
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index c6528c97..9d573240 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -24,9 +24,9 @@ | |||
24 | #include "config.h" | 24 | #include "config.h" |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #include "LAN_discovery.h" | ||
27 | #include "onion_client.h" | 28 | #include "onion_client.h" |
28 | #include "util.h" | 29 | #include "util.h" |
29 | #include "LAN_discovery.h" | ||
30 | 30 | ||
31 | /* defines for the array size and | 31 | /* defines for the array size and |
32 | timeout for onion announce packets. */ | 32 | timeout for onion announce packets. */ |
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h index 91056a09..cdf2c16f 100644 --- a/toxcore/onion_client.h +++ b/toxcore/onion_client.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #ifndef ONION_CLIENT_H | 24 | #ifndef ONION_CLIENT_H |
25 | #define ONION_CLIENT_H | 25 | #define ONION_CLIENT_H |
26 | 26 | ||
27 | #include "onion_announce.h" | ||
28 | #include "net_crypto.h" | 27 | #include "net_crypto.h" |
28 | #include "onion_announce.h" | ||
29 | #include "ping_array.h" | 29 | #include "ping_array.h" |
30 | 30 | ||
31 | #define MAX_ONION_CLIENTS 8 | 31 | #define MAX_ONION_CLIENTS 8 |
diff --git a/toxcore/ping.c b/toxcore/ping.c index 8993c6b2..a0cfbf18 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -33,8 +33,8 @@ | |||
33 | #include "ping.h" | 33 | #include "ping.h" |
34 | 34 | ||
35 | #include "network.h" | 35 | #include "network.h" |
36 | #include "util.h" | ||
37 | #include "ping_array.h" | 36 | #include "ping_array.h" |
37 | #include "util.h" | ||
38 | 38 | ||
39 | #define PING_NUM_MAX 512 | 39 | #define PING_NUM_MAX 512 |
40 | 40 | ||
diff --git a/toxcore/ping_array.c b/toxcore/ping_array.c index 59eb7018..8c5d72e9 100644 --- a/toxcore/ping_array.c +++ b/toxcore/ping_array.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #include "config.h" | 26 | #include "config.h" |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #include "ping_array.h" | ||
30 | #include "crypto_core.h" | 29 | #include "crypto_core.h" |
30 | #include "ping_array.h" | ||
31 | #include "util.h" | 31 | #include "util.h" |
32 | 32 | ||
33 | static void clear_entry(Ping_Array *array, uint32_t index) | 33 | static void clear_entry(Ping_Array *array, uint32_t index) |
diff --git a/toxcore/util.h b/toxcore/util.h index bdbf7d3b..17b1a27b 100644 --- a/toxcore/util.h +++ b/toxcore/util.h | |||
@@ -25,9 +25,9 @@ | |||
25 | #ifndef __UTIL_H__ | 25 | #ifndef __UTIL_H__ |
26 | #define __UTIL_H__ | 26 | #define __UTIL_H__ |
27 | 27 | ||
28 | #include <pthread.h> | ||
28 | #include <stdbool.h> | 29 | #include <stdbool.h> |
29 | #include <stdint.h> | 30 | #include <stdint.h> |
30 | #include <pthread.h> | ||
31 | 31 | ||
32 | #define MIN(a,b) (((a)<(b))?(a):(b)) | 32 | #define MIN(a,b) (((a)<(b))?(a):(b)) |
33 | #define PAIR(TYPE1__, TYPE2__) struct { TYPE1__ first; TYPE2__ second; } | 33 | #define PAIR(TYPE1__, TYPE2__) struct { TYPE1__ first; TYPE2__ second; } |