MT#59086 Unify header files inclusions.

In the file implementations follow the rules:

1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
   then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
   then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.

In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.

Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
pull/1783/head
Donat Zenichev 1 year ago
parent 3348f2a0ae
commit bebe291656

@ -1,4 +1,5 @@
#include "bencode.h"
#include <stdio.h>
#include <sys/uio.h>
#include <unistd.h>
@ -7,6 +8,7 @@
#include <string.h>
#include <ctype.h>
#include <json-glib/json-glib.h>
#include "helpers.h"
/* set to 0 for alloc debugging, e.g. through valgrind */

@ -24,7 +24,6 @@
#include "control_tcp.h"
#include "streambuf.h"
#include "redis.h"
#include "xt_RTPENGINE.h"
#include "bencode.h"
#include "sdp.h"
#include "str.h"
@ -52,6 +51,8 @@
#include "audio_player.h"
#include "sdp.h"
#include "xt_RTPENGINE.h"
struct iterator_helper {
uint64_t count;
GSList *del_timeout;

@ -31,7 +31,6 @@
#include "codec.h"
#include "dtmf.h"
typedef union {
const struct sdp_attr_helper *attr_helper;
str_q *q;

@ -1,6 +1,8 @@
#include "cdr.h"
#include <inttypes.h>
#include "rtplib.h"
#include "cdr.h"
#include "call.h"
#include "poller.h"
#include "str.h"

@ -1,3 +1,5 @@
#include "cli.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
@ -15,7 +17,6 @@
#include "log.h"
#include "log_funcs.h"
#include "call.h"
#include "cli.h"
#include "socket.h"
#include "redis.h"
#include "control_ng.h"
@ -30,10 +31,8 @@
#include "rtplib.h"
#include "ssrc.h"
#include "codec.h"
#include "rtpengine_config.h"
typedef void (*cli_handler_func)(str *, struct cli_writer *);
typedef struct {
const char *cmd;

@ -1,8 +1,10 @@
#include "codec.h"
#include <glib.h>
#include <assert.h>
#include <inttypes.h>
#include <sys/types.h>
#include "call.h"
#include "log.h"
#include "rtplib.h"
@ -22,9 +24,6 @@
#include "fix_frame_channel_layout.h"
#endif
struct codec_timer {
struct timerthread_obj tt_obj;
struct timeval next;

@ -20,9 +20,6 @@
#include "log_funcs.h"
#include "tcp_listener.h"
struct control_tcp {
struct obj obj;

@ -20,7 +20,6 @@
#include "socket.h"
#include "log_funcs.h"
static void control_udp_incoming(struct obj *obj, struct udp_buffer *udp_buf) {
struct control_udp *u = (void *) obj;
int ret;

@ -5,8 +5,6 @@
#include <openssl/hmac.h>
#include <glib.h>
#include "xt_RTPENGINE.h"
#include "str.h"
#include "helpers.h"
#include "rtp.h"
@ -18,13 +16,10 @@
#include "ssllib.h"
#include "types.h"
#include "xt_RTPENGINE.h"
__thread GString *crypto_debug_string;
static int aes_cm_encrypt_rtp(struct crypto_context *, struct rtp_header *, str *, uint64_t);
static int aes_cm_encrypt_rtcp(struct crypto_context *, struct rtcp_packet *, str *, uint64_t);
static int aes_gcm_encrypt_rtp(struct crypto_context *, struct rtp_header *, str *, uint64_t);

@ -1,5 +1,7 @@
#include <errno.h>
#include "dtmf.h"
#include <errno.h>
#include "bencode.h"
#include "control_ng.h"
#include "media_socket.h"

@ -1,9 +1,5 @@
/*
* graphite.c
*
* Created on: Jan 19, 2015
* Author: fmetz
*/
#include "graphite.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <poll.h>
@ -18,7 +14,6 @@
#include "log.h"
#include "call.h"
#include "graphite.h"
#include "socket.h"
#include "statistics.h"
#include "main.h"

@ -1,4 +1,5 @@
#include "helpers.h"
#include <string.h>
#include <stdio.h>
#include <glib.h>
@ -8,20 +9,16 @@
#include <sys/resource.h>
#include <errno.h>
#include <unistd.h>
#include "log.h"
#include "main.h"
#if 0
#define BSDB(x...) fprintf(stderr, x)
#else
#define BSDB(x...) ((void)0)
#endif
struct detach_thread {
void (*func)(void *);
void *data;

@ -14,14 +14,8 @@
#include "str.h"
#include "types.h"
#define SEND_QUEUE_LIMIT 200
TYPED_GQUEUE(gstring, GString)
struct homer_sender {

@ -1,7 +1,9 @@
#include "ice.h"
#include <glib.h>
#include <sys/time.h>
#include <unistd.h>
#include "str.h"
#include "call.h"
#include "helpers.h"
@ -13,8 +15,6 @@
#include "timerthread.h"
#include "call_interfaces.h"
#if __DEBUG
#define ICE_DEBUG 1
#else
@ -27,18 +27,12 @@
#define __DBG(x...) ilogs(internals, LOG_DEBUG, x)
#endif
#define PAIR_FORMAT STR_FORMAT_M ":" STR_FORMAT_M ":%lu"
#define PAIR_FMT(p) \
STR_FMT_M(&(p)->local_intf->ice_foundation), \
STR_FMT_M(&(p)->remote_candidate->foundation), \
(p)->remote_candidate->component_id
struct fragment_key {
str call_id;
str from_tag;

@ -1,6 +1,8 @@
#include "janus.h"
#include <json-glib/json-glib.h>
#include <stdbool.h>
#include "websocket.h"
#include "log.h"
#include "main.h"
@ -11,7 +13,6 @@
#include "rtplib.h"
#include "ice.h"
TYPED_GHASHTABLE(janus_handles_set, uint64_t, void, g_int64_hash, g_int64_equal, NULL, NULL)
TYPED_GHASHTABLE(janus_websockets_ht, struct websocket_conn, struct websocket_conn,
g_direct_hash, g_direct_equal, NULL, NULL)

@ -1,12 +1,14 @@
#include "jitter_buffer.h"
#include <math.h>
#include <errno.h>
#include "timerthread.h"
#include "media_socket.h"
#include "call.h"
#include "codec.h"
#include "main.h"
#include "rtcplib.h"
#include <math.h>
#include <errno.h>
#define INITIAL_PACKETS 0x1E
#define CONT_SEQ_COUNT 0x1F4

@ -9,25 +9,15 @@
#include <glib.h>
#include <errno.h>
#include "xt_RTPENGINE.h"
#include "helpers.h"
#include "log.h"
#include "xt_RTPENGINE.h"
#define PREFIX "/proc/rtpengine"
struct kernel_interface kernel;
static int kernel_action_table(const char *action, unsigned int id) {
char s[64];
int saved_errno;

@ -1,10 +1,12 @@
#include "load.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "helpers.h"
#include "log.h"
#include "main.h"

@ -1,8 +1,10 @@
#include "log.h"
#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include <glib.h>
#include "str.h"
#include "call.h"
#include "poller.h"
@ -10,9 +12,6 @@
#include "loglib.h"
#include "main.h"
__thread struct log_info log_info;
__thread GSList *log_info_stack;

@ -1,9 +1,11 @@
#include "media_player.h"
#include <glib.h>
#ifdef WITH_TRANSCODING
#include <mysql.h>
#include <mysql/errmsg.h>
#endif
#include "obj.h"
#include "log.h"
#include "timerthread.h"
@ -21,12 +23,8 @@
#endif
#include "kernel.h"
#define DEFAULT_AVIO_BUFSIZE 4096
#ifdef WITH_TRANSCODING
static struct timerthread media_player_thread;
static __thread MYSQL *mysql_conn;

@ -1,9 +1,11 @@
#include "media_socket.h"
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <errno.h>
#include <netinet/in.h>
#include "str.h"
#include "ice.h"
#include "socket.h"
@ -12,7 +14,6 @@
#include "ice.h"
#include "stun.h"
#include "kernel.h"
#include "xt_RTPENGINE.h"
#include "rtcp.h"
#include "sdp.h"
#include "helpers.h"
@ -31,6 +32,7 @@
#include "mqtt.h"
#include "janus.h"
#include "xt_RTPENGINE.h"
#ifndef PORT_RANDOM_MIN
#define PORT_RANDOM_MIN 6

@ -1,6 +1,7 @@
#ifdef HAVE_MQTT
#include "mqtt.h"
#include <mosquitto.h>
#include <errno.h>
#include <string.h>
@ -8,6 +9,7 @@
#include <glib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include "main.h"
#include "log.h"
#include "log_funcs.h"

@ -17,12 +17,9 @@
#include <libnftnl/rule.h>
#include <libnftnl/expr.h>
#include "xt_RTPENGINE.h"
#include "helpers.h"
#include "xt_RTPENGINE.h"
struct iterate_callbacks {
// called for each expression

@ -1,4 +1,5 @@
#include "recording.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
@ -13,8 +14,6 @@
#include <assert.h>
#include <stdarg.h>
#include "xt_RTPENGINE.h"
#include "call.h"
#include "kernel.h"
#include "bencode.h"
@ -23,7 +22,7 @@
#include "log.h"
#include "call_interfaces.h"
#include "xt_RTPENGINE.h"
struct rec_pcap_format {
int linktype;

@ -34,7 +34,6 @@
#include "main.h"
#include "codec.h"
typedef union {
GQueue *q;
stream_fd_q *sfds_q;

@ -18,8 +18,6 @@
#include "sdp.h"
#include "log_funcs.h"
/* This toggles between two different and incompatible interpretations of
* RFC 3711, namely sections 4.3.2 and 4.3.1.
* See http://www.ietf.org/mail-archive/web/avt/current/msg06124.html

@ -12,9 +12,6 @@
#include "ssrc.h"
#include "call.h"
INLINE int check_session_keys(struct crypto_context *c) {
str s;
const char *err;

@ -1,12 +1,12 @@
#include "ssrc.h"
#include <glib.h>
#include "helpers.h"
#include "call.h"
#include "rtplib.h"
#include "codeclib.h"
static void __free_ssrc_entry_call(void *e);

@ -1,12 +1,13 @@
#include "statistics.h"
#include <math.h>
#include <stdarg.h>
#include "call.h"
#include "statistics.h"
#include "graphite.h"
#include "main.h"
#include "control_ng.h"
struct timeval rtpe_started;

@ -15,8 +15,6 @@
#include "ice.h"
#include "ssllib.h"
#define STUN_CRC_XOR 0x5354554eUL
#define STUN_USERNAME 0x0006

@ -1,10 +1,6 @@
#include "t38.h"
#ifdef WITH_TRANSCODING
#include <assert.h>
#include <spandsp/t30.h>
#include <spandsp/logging.h>

@ -1,4 +1,5 @@
#include "timerthread.h"
#include "helpers.h"
#include "log_funcs.h"

@ -1,7 +1,9 @@
#include "websocket.h"
#include <libwebsockets.h>
#include <assert.h>
#include <json-glib/json-glib.h>
#include "log.h"
#include "main.h"
#include "str.h"

Loading…
Cancel
Save