mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Group #include directives in 3-4 groups.
1. Current module (if C file). 2. Headers from current library. 3. Headers from other library (e.g. toxcore includes in toxav). 4. System headers.
This commit is contained in:
parent
2b2dc07f6f
commit
0aa2840164
|
@ -23,13 +23,14 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "audio.h"
|
||||
|
||||
#include "rtp.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static struct JitterBuffer *jbuf_new(uint32_t capacity);
|
||||
static void jbuf_clear(struct JitterBuffer *q);
|
||||
static void jbuf_free(struct JitterBuffer *q);
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#include <opus.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "toxav.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
|
||||
#include <opus.h>
|
||||
#include <pthread.h>
|
||||
|
||||
struct RTPMessage;
|
||||
|
||||
typedef struct ACSession_s {
|
||||
|
|
|
@ -23,9 +23,11 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "bwcontroller.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
#include "bwcontroller.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#define BWC_PACKET_ID 196
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#ifndef BWCONROLER_H
|
||||
#define BWCONROLER_H
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
|
||||
typedef struct BWController_s BWController;
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "group.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
#include "group.h"
|
||||
|
||||
#define GROUP_JBUF_SIZE 6
|
||||
#define GROUP_JBUF_DEAD_SECONDS 4
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
* along with Tox. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../toxcore/group.h"
|
||||
|
||||
/* Audio encoding/decoding */
|
||||
#include <opus.h>
|
||||
|
||||
#include "../toxcore/group.h"
|
||||
|
||||
#define GROUP_AUDIO_PACKET_ID 192
|
||||
|
||||
/* Create a new toxav group.
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "msi.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
#include "msi.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
#ifndef MSI_H
|
||||
#define MSI_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
#include "audio.h"
|
||||
#include "video.h"
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/**
|
||||
* Error codes.
|
||||
*/
|
||||
|
|
|
@ -23,11 +23,13 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "rtp.h"
|
||||
|
||||
#include "bwcontroller.h"
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
#include "bwcontroller.h"
|
||||
#include "rtp.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
#ifndef RTP_H
|
||||
#define RTP_H
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
#include "bwcontroller.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "../toxcore/Messenger.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* Payload type identifier. Also used as rtp callback prefix.
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "toxav.h"
|
||||
|
||||
#include "msi.h"
|
||||
#include "rtp.h"
|
||||
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
* This file contains the group chats code for the backwards compatibility.
|
||||
*/
|
||||
|
||||
#include "group.h"
|
||||
#include "toxav.h"
|
||||
|
||||
#include "group.h"
|
||||
|
||||
/* Create a new toxav group.
|
||||
*
|
||||
* return group number on success.
|
||||
|
|
|
@ -23,16 +23,17 @@
|
|||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "video.h"
|
||||
|
||||
#include "msi.h"
|
||||
#include "rtp.h"
|
||||
#include "video.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/network.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAX_DECODE_TIME_US 0 /* Good quality encode. */
|
||||
#define VIDEO_DECODE_BUFFER_SIZE 20
|
||||
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
#ifndef VIDEO_H
|
||||
#define VIDEO_H
|
||||
|
||||
#include "toxav.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
|
||||
#include <vpx/vpx_decoder.h>
|
||||
#include <vpx/vpx_encoder.h>
|
||||
#include <vpx/vpx_image.h>
|
||||
|
@ -33,11 +38,6 @@
|
|||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "toxav.h"
|
||||
|
||||
#include "../toxcore/logger.h"
|
||||
#include "../toxcore/util.h"
|
||||
|
||||
struct RTPMessage;
|
||||
|
||||
typedef struct VCSession_s {
|
||||
|
|
|
@ -27,23 +27,20 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include "DHT.h"
|
||||
|
||||
#ifdef ENABLE_ASSOC_DHT
|
||||
#include "assoc.h"
|
||||
#endif
|
||||
|
||||
#include "ping.h"
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
#include "logger.h"
|
||||
#include "misc_tools.h"
|
||||
#include "network.h"
|
||||
#include "ping.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/* The timeout after which a node is discarded completely. */
|
||||
#define KILL_NODE_TIMEOUT (BAD_NODE_TIMEOUT + PING_INTERVAL)
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* Used for get_broadcast(). */
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef LAN_DISCOVERY_H
|
||||
#define LAN_DISCOVERY_H
|
||||
|
||||
|
||||
#include "DHT.h"
|
||||
|
||||
/* Interval in seconds between LAN discovery packet sending. */
|
||||
|
|
|
@ -25,16 +25,17 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef TOX_DEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#include "Messenger.h"
|
||||
|
||||
#include "assoc.h"
|
||||
#include "logger.h"
|
||||
#include "network.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef TOX_DEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
|
||||
static void set_friend_status(Messenger *m, int32_t friendnumber, uint8_t status, void *userdata);
|
||||
static int write_cryptpacket_id(const Messenger *m, int32_t friendnumber, uint8_t packet_id, const uint8_t *data,
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
#include "TCP_client.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && !defined (WIN32)
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* return 1 on success
|
||||
* return 0 on failure
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include "TCP_connection.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* Set the size of the array to num.
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
#include "TCP_server.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && !defined (WIN32)
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* return 1 on success
|
||||
* return 0 on failure
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "onion.h"
|
||||
|
||||
#ifdef TCP_SERVER_USE_EPOLL
|
||||
#include "sys/epoll.h"
|
||||
#include <sys/epoll.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MACH__)
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "DHT.h"
|
||||
#include "assoc.h"
|
||||
|
||||
#include "DHT.h"
|
||||
#include "LAN_discovery.h"
|
||||
#include "logger.h"
|
||||
#include "ping.h"
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include "friend_connection.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* return 1 if the friendcon_id is not valid.
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "net_crypto.h"
|
||||
#include "onion_client.h"
|
||||
|
||||
|
||||
#define MAX_FRIEND_CONNECTION_CALLBACKS 2
|
||||
#define MESSENGER_CALLBACK_INDEX 0
|
||||
#define GROUPCHAT_CALLBACK_INDEX 1
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#endif
|
||||
|
||||
#include "friend_requests.h"
|
||||
#include "util.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* Set and get the nospam variable used to prevent one type of friend request spam. */
|
||||
void set_nospam(Friend_Requests *fr, uint32_t num)
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include "group.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
/* return 1 if the groupnumber is not valid.
|
||||
|
|
|
@ -27,10 +27,13 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "math.h"
|
||||
#include "net_crypto.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
static uint8_t crypt_connection_id_not_valid(const Net_Crypto *c, int crypt_connection_id)
|
||||
{
|
||||
if ((uint32_t)crypt_connection_id >= c->crypto_connections_length) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "LAN_discovery.h"
|
||||
#include "TCP_connection.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#define CRYPTO_CONN_NO_CONNECTION 0
|
||||
|
|
|
@ -29,7 +29,10 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "network.h"
|
||||
|
||||
#include "logger.h"
|
||||
#include "util.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && !defined (WIN32)
|
||||
#include <errno.h>
|
||||
|
@ -40,9 +43,6 @@
|
|||
#include <mach/mach.h>
|
||||
#endif
|
||||
|
||||
#include "network.h"
|
||||
#include "util.h"
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined (WIN32)
|
||||
|
||||
static const char *inet_ntop(sa_family_t family, void *addr, char *buf, size_t bufsize)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#endif
|
||||
|
||||
#include "onion.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define RETURN_1 ONION_RETURN_1
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
#include "onion_announce.h"
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
#include "util.h"
|
||||
|
||||
#define PING_ID_TIMEOUT 20
|
||||
|
|
|
@ -24,8 +24,9 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
#include "onion_client.h"
|
||||
|
||||
#include "LAN_discovery.h"
|
||||
#include "util.h"
|
||||
|
||||
/* defines for the array size and
|
||||
|
|
|
@ -27,15 +27,15 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "DHT.h"
|
||||
#include "ping.h"
|
||||
|
||||
#include "DHT.h"
|
||||
#include "network.h"
|
||||
#include "ping_array.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PING_NUM_MAX 512
|
||||
|
||||
/* Maximum newly announced nodes to ping per TIME_TO_PING seconds. */
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "crypto_core.h"
|
||||
#include "ping_array.h"
|
||||
|
||||
#include "crypto_core.h"
|
||||
#include "util.h"
|
||||
|
||||
static void clear_entry(Ping_Array *array, uint32_t index)
|
||||
|
|
|
@ -25,17 +25,16 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define TOX_DEFINED
|
||||
typedef struct Messenger Tox;
|
||||
#include "tox.h"
|
||||
|
||||
#include "Messenger.h"
|
||||
#include "group.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "../toxencryptsave/defines.h"
|
||||
|
||||
#define TOX_DEFINED
|
||||
typedef struct Messenger Tox;
|
||||
|
||||
#include "tox.h"
|
||||
|
||||
#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}}
|
||||
|
||||
#if TOX_HASH_LENGTH != crypto_hash_sha256_BYTES
|
||||
|
|
|
@ -25,13 +25,12 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "Messenger.h"
|
||||
#include "group.h"
|
||||
|
||||
#define TOX_DEFINED
|
||||
typedef struct Messenger Tox;
|
||||
#include "tox_group.h"
|
||||
|
||||
#include "tox.h"
|
||||
#include "Messenger.h"
|
||||
#include "group.h"
|
||||
|
||||
/**********GROUP CHAT FUNCTIONS: WARNING Group chats will be rewritten so this might change ************/
|
||||
|
||||
|
|
|
@ -26,13 +26,12 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/* for crypto_box_PUBLICKEYBYTES */
|
||||
#include "crypto_core.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "crypto_core.h" /* for crypto_box_PUBLICKEYBYTES */
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
||||
/* don't call into system billions of times for no reason */
|
||||
static uint64_t unix_time_value;
|
||||
|
|
Loading…
Reference in New Issue
Block a user