all btpd headers are included through btpd.h.master
@@ -1,9 +1,3 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/stat.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
void | void | ||||
@@ -1,10 +1,8 @@ | |||||
#include "btpd.h" | |||||
#include <signal.h> | #include <signal.h> | ||||
#include <string.h> | |||||
#include <time.h> | #include <time.h> | ||||
#include "btpd.h" | |||||
#include "active.h" | |||||
static uint8_t m_peer_id[20]; | static uint8_t m_peer_id[20]; | ||||
static struct event m_sigint; | static struct event m_sigint; | ||||
static struct event m_sigterm; | static struct event m_sigterm; | ||||
@@ -2,23 +2,35 @@ | |||||
#define BTPD_H | #define BTPD_H | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/socket.h> | |||||
#include <sys/stat.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/socket.h> | |||||
#include <netinet/in.h> | |||||
#include <arpa/inet.h> | |||||
#include <assert.h> | #include <assert.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <event.h> | |||||
#include <fcntl.h> | |||||
#include <math.h> | |||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
#include <stddef.h> | #include <stddef.h> | ||||
#include <stdio.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "queue.h" | |||||
#include <benc.h> | |||||
#define DAEMON | |||||
#include <btpd_if.h> | |||||
#undef DAEMON | |||||
#include <event.h> | |||||
#include <metainfo.h> | |||||
#include <queue.h> | |||||
#include <subr.h> | |||||
#include "benc.h" | |||||
#include "metainfo.h" | |||||
#include "subr.h" | |||||
#include "iobuf.h" | |||||
#include "active.h" | |||||
#include "hashtable.h" | #include "hashtable.h" | ||||
#include "net_buf.h" | #include "net_buf.h" | ||||
#include "net_types.h" | #include "net_types.h" | ||||
@@ -30,9 +42,7 @@ | |||||
#include "upload.h" | #include "upload.h" | ||||
#include "content.h" | #include "content.h" | ||||
#include "opts.h" | #include "opts.h" | ||||
#define DAEMON | |||||
#include "btpd_if.h" | |||||
#undef DAEMON | |||||
#include "tracker_req.h" | |||||
#define BTPD_VERSION PACKAGE_NAME "/" PACKAGE_VERSION | #define BTPD_VERSION PACKAGE_NAME "/" PACKAGE_VERSION | ||||
@@ -1,19 +1,7 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/socket.h> | |||||
#include <sys/un.h> | |||||
#include <arpa/inet.h> | |||||
#include <sys/stat.h> | |||||
#include <inttypes.h> | |||||
#include <limits.h> | |||||
#include <stdarg.h> | |||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
#include "active.h" | |||||
#include "tracker_req.h" | |||||
#include <sys/un.h> | |||||
#include <iobuf.h> | |||||
struct cli { | struct cli { | ||||
int sd; | int sd; | ||||
@@ -1,16 +1,7 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/stat.h> | |||||
#include <fcntl.h> | |||||
#include <math.h> | |||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
#include <openssl/sha.h> | #include <openssl/sha.h> | ||||
#include "btpd.h" | |||||
#include "stream.h" | |||||
#include <stream.h> | |||||
struct content { | struct content { | ||||
enum { CM_INACTIVE, CM_STARTING, CM_ACTIVE } state; | enum { CM_INACTIVE, CM_STARTING, CM_ACTIVE } state; | ||||
@@ -1,7 +1,4 @@ | |||||
#include <math.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
#include "tracker_req.h" | |||||
/* | /* | ||||
* Called when a peer announces it's got a new piece. | * Called when a peer announces it's got a new piece. | ||||
@@ -19,15 +19,10 @@ | |||||
* | * | ||||
*/ | */ | ||||
#include <fcntl.h> | |||||
#include <math.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
#include <openssl/sha.h> | #include <openssl/sha.h> | ||||
#include "btpd.h" | |||||
#include "stream.h" | |||||
#include <stream.h> | |||||
static struct piece * | static struct piece * | ||||
piece_alloc(struct net *n, uint32_t index) | piece_alloc(struct net *n, uint32_t index) | ||||
@@ -1,10 +1,6 @@ | |||||
#include <arpa/inet.h> | |||||
#include <netinet/in.h> | |||||
#include <string.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
#include "tracker_req.h" | |||||
#include "http_client.h" | |||||
#include <http_client.h> | |||||
#define MAX_DOWNLOAD (1 << 18) // 256kB | #define MAX_DOWNLOAD (1 << 18) // 256kB | ||||
@@ -1,19 +1,9 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/file.h> | |||||
#include <sys/stat.h> | |||||
#include <arpa/inet.h> | |||||
#include "btpd.h" | |||||
#include <sys/file.h> | |||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | |||||
#include <event.h> | |||||
#include <evdns.h> | #include <evdns.h> | ||||
#include <fcntl.h> | |||||
#include <getopt.h> | #include <getopt.h> | ||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
static void | static void | ||||
writepid(int pidfd) | writepid(int pidfd) | ||||
@@ -1,23 +1,8 @@ | |||||
#include <sys/types.h> | |||||
#include "btpd.h" | |||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <sys/socket.h> | |||||
#include <netinet/in.h> | |||||
#include <netdb.h> | #include <netdb.h> | ||||
#include <sys/mman.h> | |||||
#include <sys/wait.h> | |||||
#include <assert.h> | |||||
#include <errno.h> | |||||
#include <fcntl.h> | |||||
#include <math.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
static unsigned long m_bw_bytes_in; | static unsigned long m_bw_bytes_in; | ||||
static unsigned long m_bw_bytes_out; | static unsigned long m_bw_bytes_out; | ||||
@@ -1,6 +1,3 @@ | |||||
#include <math.h> | |||||
#include <string.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
static struct net_buf *m_choke; | static struct net_buf *m_choke; | ||||
@@ -1,5 +1,4 @@ | |||||
#include <btpd.h> | |||||
#include <netinet/in.h> | |||||
#include "btpd.h" | |||||
const char *btpd_dir; | const char *btpd_dir; | ||||
#ifdef DEBUG | #ifdef DEBUG | ||||
@@ -1,13 +1,6 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/socket.h> | |||||
#include <netinet/in.h> | |||||
#include "btpd.h" | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <math.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
void | void | ||||
peer_kill(struct peer *p) | peer_kill(struct peer *p) | ||||
@@ -1,13 +1,8 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/stat.h> | |||||
#include <sys/mman.h> | |||||
#include "btpd.h" | |||||
#include <sys/mman.h> | |||||
#include <dirent.h> | #include <dirent.h> | ||||
#include <fcntl.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
#include <iobuf.h> | |||||
HTBL_TYPE(numtbl, tlib, unsigned, num, nchain); | HTBL_TYPE(numtbl, tlib, unsigned, num, nchain); | ||||
HTBL_TYPE(hashtbl, tlib, uint8_t, hash, hchain); | HTBL_TYPE(hashtbl, tlib, uint8_t, hash, hchain); | ||||
@@ -1,21 +1,7 @@ | |||||
#include <sys/types.h> | |||||
#include <assert.h> | |||||
#include <errno.h> | |||||
#include <fcntl.h> | |||||
#include <math.h> | |||||
#include <limits.h> | |||||
#include <stdarg.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <string.h> | |||||
#include <unistd.h> | |||||
#include "btpd.h" | |||||
#include <openssl/sha.h> | #include <openssl/sha.h> | ||||
#include "btpd.h" | |||||
#include "tracker_req.h" | |||||
#include "stream.h" | |||||
#define SAVE_INTERVAL 300 | #define SAVE_INTERVAL 300 | ||||
static unsigned m_ntorrents; | static unsigned m_ntorrents; | ||||
@@ -1,8 +1,4 @@ | |||||
#include <string.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
#include "subr.h" | |||||
#include "tracker_req.h" | |||||
#define REQ_DELAY 1 | #define REQ_DELAY 1 | ||||
#define STOP_ERRORS 5 | #define STOP_ERRORS 5 | ||||
@@ -1,13 +1,6 @@ | |||||
#include <sys/types.h> | |||||
#include <sys/socket.h> | |||||
#include <netinet/in.h> | |||||
#include "btpd.h" | |||||
#include <event.h> | |||||
#include <evdns.h> | #include <evdns.h> | ||||
#include <string.h> | |||||
#include "btpd.h" | |||||
#include "tracker_req.h" | |||||
struct udp_tr_req { | struct udp_tr_req { | ||||
enum { UDP_RESOLVE, UDP_CONN_SEND, UDP_CONN_RECV, | enum { UDP_RESOLVE, UDP_CONN_SEND, UDP_CONN_RECV, | ||||
@@ -1,5 +1,3 @@ | |||||
#include <string.h> | |||||
#include "btpd.h" | #include "btpd.h" | ||||
#define CHOKE_INTERVAL (& (struct timeval) { 10, 0 }) | #define CHOKE_INTERVAL (& (struct timeval) { 10, 0 }) | ||||
@@ -1,10 +1,8 @@ | |||||
#include "btpd.h" | |||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <time.h> | #include <time.h> | ||||
#include "btpd.h" | |||||
void * | void * | ||||
btpd_malloc(size_t size) | btpd_malloc(size_t size) | ||||
{ | { | ||||