Browse Source

Clean up the #include sections in the btpd files. Most common headers and

all btpd headers are included through btpd.h.
master
Richard Nyberg 17 years ago
parent
commit
2886768d30
19 changed files with 44 additions and 145 deletions
  1. +0
    -6
      btpd/active.c
  2. +2
    -4
      btpd/btpd.c
  3. +20
    -10
      btpd/btpd.h
  4. +3
    -15
      btpd/cli_if.c
  5. +2
    -11
      btpd/content.c
  6. +0
    -3
      btpd/download.c
  7. +2
    -7
      btpd/download_subr.c
  8. +2
    -6
      btpd/http_tr_if.c
  9. +2
    -12
      btpd/main.c
  10. +2
    -17
      btpd/net.c
  11. +0
    -3
      btpd/net_buf.c
  12. +1
    -2
      btpd/opts.c
  13. +1
    -8
      btpd/peer.c
  14. +3
    -8
      btpd/tlib.c
  15. +1
    -15
      btpd/torrent.c
  16. +0
    -4
      btpd/tracker_req.c
  17. +1
    -8
      btpd/udp_tr_if.c
  18. +0
    -2
      btpd/upload.c
  19. +2
    -4
      btpd/util.c

+ 0
- 6
btpd/active.c View File

@@ -1,9 +1,3 @@
#include <sys/types.h>
#include <sys/stat.h>

#include <string.h>
#include <unistd.h>

#include "btpd.h"

void


+ 2
- 4
btpd/btpd.c View File

@@ -1,10 +1,8 @@
#include "btpd.h"

#include <signal.h>
#include <string.h>
#include <time.h>

#include "btpd.h"
#include "active.h"

static uint8_t m_peer_id[20];
static struct event m_sigint;
static struct event m_sigterm;


+ 20
- 10
btpd/btpd.h View File

@@ -2,23 +2,35 @@
#define BTPD_H

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <assert.h>
#include <errno.h>
#include <event.h>
#include <fcntl.h>
#include <math.h>
#include <inttypes.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.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 "net_buf.h"
#include "net_types.h"
@@ -30,9 +42,7 @@
#include "upload.h"
#include "content.h"
#include "opts.h"
#define DAEMON
#include "btpd_if.h"
#undef DAEMON
#include "tracker_req.h"

#define BTPD_VERSION PACKAGE_NAME "/" PACKAGE_VERSION



+ 3
- 15
btpd/cli_if.c View File

@@ -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 "active.h"
#include "tracker_req.h"

#include <sys/un.h>
#include <iobuf.h>

struct cli {
int sd;


+ 2
- 11
btpd/content.c View File

@@ -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 "btpd.h"
#include "stream.h"
#include <stream.h>

struct content {
enum { CM_INACTIVE, CM_STARTING, CM_ACTIVE } state;


+ 0
- 3
btpd/download.c View File

@@ -1,7 +1,4 @@
#include <math.h>

#include "btpd.h"
#include "tracker_req.h"

/*
* Called when a peer announces it's got a new piece.


+ 2
- 7
btpd/download_subr.c View File

@@ -19,15 +19,10 @@
*
*/

#include <fcntl.h>
#include <math.h>
#include <string.h>
#include <unistd.h>
#include "btpd.h"

#include <openssl/sha.h>

#include "btpd.h"
#include "stream.h"
#include <stream.h>

static struct piece *
piece_alloc(struct net *n, uint32_t index)


+ 2
- 6
btpd/http_tr_if.c View File

@@ -1,10 +1,6 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <string.h>

#include "btpd.h"
#include "tracker_req.h"
#include "http_client.h"

#include <http_client.h>

#define MAX_DOWNLOAD (1 << 18) // 256kB



+ 2
- 12
btpd/main.c View File

@@ -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 <errno.h>
#include <event.h>
#include <evdns.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include "btpd.h"

static void
writepid(int pidfd)


+ 2
- 17
btpd/net.c View File

@@ -1,23 +1,8 @@
#include <sys/types.h>
#include "btpd.h"

#include <sys/uio.h>
#include <sys/socket.h>
#include <netinet/in.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_out;



+ 0
- 3
btpd/net_buf.c View File

@@ -1,6 +1,3 @@
#include <math.h>
#include <string.h>

#include "btpd.h"

static struct net_buf *m_choke;


+ 1
- 2
btpd/opts.c View File

@@ -1,5 +1,4 @@
#include <btpd.h>
#include <netinet/in.h>
#include "btpd.h"

const char *btpd_dir;
#ifdef DEBUG


+ 1
- 8
btpd/peer.c View File

@@ -1,13 +1,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "btpd.h"

#include <ctype.h>
#include <math.h>
#include <string.h>
#include <unistd.h>

#include "btpd.h"

void
peer_kill(struct peer *p)


+ 3
- 8
btpd/tlib.c View File

@@ -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 <fcntl.h>
#include <string.h>
#include <unistd.h>

#include "btpd.h"
#include <iobuf.h>

HTBL_TYPE(numtbl, tlib, unsigned, num, nchain);
HTBL_TYPE(hashtbl, tlib, uint8_t, hash, hchain);


+ 1
- 15
btpd/torrent.c View File

@@ -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 "btpd.h"
#include "tracker_req.h"
#include "stream.h"

#define SAVE_INTERVAL 300

static unsigned m_ntorrents;


+ 0
- 4
btpd/tracker_req.c View File

@@ -1,8 +1,4 @@
#include <string.h>

#include "btpd.h"
#include "subr.h"
#include "tracker_req.h"

#define REQ_DELAY 1
#define STOP_ERRORS 5


+ 1
- 8
btpd/udp_tr_if.c View File

@@ -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 <string.h>

#include "btpd.h"
#include "tracker_req.h"

struct udp_tr_req {
enum { UDP_RESOLVE, UDP_CONN_SEND, UDP_CONN_RECV,


+ 0
- 2
btpd/upload.c View File

@@ -1,5 +1,3 @@
#include <string.h>

#include "btpd.h"

#define CHOKE_INTERVAL (& (struct timeval) { 10, 0 })


+ 2
- 4
btpd/util.c View File

@@ -1,10 +1,8 @@
#include "btpd.h"

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

#include "btpd.h"

void *
btpd_malloc(size_t size)
{


Loading…
Cancel
Save