summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cc.c6
-rw-r--r--src/commands.c4
-rw-r--r--src/db.c8
-rw-r--r--src/dl.c4
-rw-r--r--src/fl_load.c5
-rw-r--r--src/fl_local.c4
-rw-r--r--src/fl_save.c6
-rw-r--r--src/fl_util.c1
-rw-r--r--src/hub.c1
-rw-r--r--src/listen.c8
-rw-r--r--src/main.c8
-rw-r--r--src/ncdc.h38
-rw-r--r--src/net.c16
-rw-r--r--src/proto.c1
-rw-r--r--src/search.c2
-rw-r--r--src/strutil.c3
-rw-r--r--src/ui.c1
-rw-r--r--src/ui_util.c6
-rw-r--r--src/uit_fl.c1
-rw-r--r--src/uit_userlist.c1
-rw-r--r--src/util.c8
-rw-r--r--src/vars.c8
-rw-r--r--src/xmlread.c4
23 files changed, 34 insertions, 110 deletions
diff --git a/src/cc.c b/src/cc.c
index 2270d21..27010ec 100644
--- a/src/cc.c
+++ b/src/cc.c
@@ -26,12 +26,6 @@
#include "ncdc.h"
#include "cc.h"
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
// List (well, table) of users who are granted a slot. Key = UID (g_memdup'ed),
diff --git a/src/commands.c b/src/commands.c
index 6f695ef..03f48e3 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -27,10 +27,6 @@
#include "ncdc.h"
#include "commands.h"
-#include <limits.h>
-#include <stdlib.h>
-#include <errno.h>
-
#define DOC_CMD
#define DOC_KEY
#define DOC_SET
diff --git a/src/db.c b/src/db.c
index fb7e80a..69acdd0 100644
--- a/src/db.c
+++ b/src/db.c
@@ -26,14 +26,6 @@
#include "ncdc.h"
#include "db.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <sqlite3.h>
-#include <glib/gstdio.h>
// Most of the db_* functions can be used from multiple threads. The database
// is only accessed from within the database thread (db_thread_func()). All
diff --git a/src/dl.c b/src/dl.c
index da6d7df..79a0655 100644
--- a/src/dl.c
+++ b/src/dl.c
@@ -26,10 +26,6 @@
#include "ncdc.h"
#include "dl.h"
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
#if INTERFACE
diff --git a/src/fl_load.c b/src/fl_load.c
index 4d30555..2e50d94 100644
--- a/src/fl_load.c
+++ b/src/fl_load.c
@@ -26,11 +26,6 @@
#include "ncdc.h"
#include "fl_load.h"
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <bzlib.h>
#define S_START 0 // waiting for <FileListing>
diff --git a/src/fl_local.c b/src/fl_local.c
index 2bc9064..7fc3a04 100644
--- a/src/fl_local.c
+++ b/src/fl_local.c
@@ -26,10 +26,6 @@
#include "ncdc.h"
#include "fl_local.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
char *fl_local_list_file;
diff --git a/src/fl_save.c b/src/fl_save.c
index 6fbca7c..460e3af 100644
--- a/src/fl_save.c
+++ b/src/fl_save.c
@@ -26,12 +26,6 @@
#include "ncdc.h"
#include "fl_save.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <bzlib.h>
-#include <zlib.h>
/* The "targetsize algorithm" (I thought of that name myself, googling won't help you. Probably):
*
diff --git a/src/fl_util.c b/src/fl_util.c
index 9ead769..647df48 100644
--- a/src/fl_util.c
+++ b/src/fl_util.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "fl_util.h"
-#include <string.h>
#if INTERFACE
diff --git a/src/hub.c b/src/hub.c
index a4fde59..04ea6da 100644
--- a/src/hub.c
+++ b/src/hub.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "hub.h"
-#include <stdlib.h>
#if INTERFACE
diff --git a/src/listen.c b/src/listen.c
index 20b5c59..73296f8 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -26,14 +26,6 @@
#include "ncdc.h"
#include "listen.h"
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-
#if INTERFACE
diff --git a/src/main.c b/src/main.c
index f48650f..7bcf383 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,14 +26,6 @@
#include "ncdc.h"
#include "main.h"
-#include <stdlib.h>
-#include <locale.h>
-#include <signal.h>
-#include <wchar.h>
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sqlite3.h>
diff --git a/src/ncdc.h b/src/ncdc.h
index 6fcd999..1d27087 100644
--- a/src/ncdc.h
+++ b/src/ncdc.h
@@ -24,8 +24,42 @@
*/
#include "config.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <time.h>
+#include <math.h>
+#include <setjmp.h>
+
+#include <wchar.h>
+#include <locale.h>
+#include <signal.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#ifdef HAVE_LINUX_SENDFILE
+# include <sys/sendfile.h>
+#elif HAVE_BSD_SENDFILE
+# include <sys/socket.h>
+# include <sys/uio.h>
+#endif
+
+#include <zlib.h>
+#include <bzlib.h>
+#include <sqlite3.h>
#include <glib.h>
#include <glib/gprintf.h>
+#include <glib/gstdio.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#ifdef USE_GCRYPT
@@ -33,10 +67,6 @@
#else
#include <gnutls/crypto.h>
#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <string.h>
#define _XOPEN_SOURCE_EXTENDED
#ifdef HAVE_NCURSESW_NCURSES_H
diff --git a/src/net.c b/src/net.c
index 719cddc..51b11cd 100644
--- a/src/net.c
+++ b/src/net.c
@@ -26,22 +26,6 @@
#include "ncdc.h"
#include "net.h"
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#ifdef HAVE_LINUX_SENDFILE
-# include <sys/sendfile.h>
-#elif HAVE_BSD_SENDFILE
-# include <sys/socket.h>
-# include <sys/uio.h>
-#endif
// global network stats
diff --git a/src/proto.c b/src/proto.c
index 646e278..85ba454 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "proto.h"
-#include <stdlib.h>
// NMDC support
diff --git a/src/search.c b/src/search.c
index 014c7ca..8aebc57 100644
--- a/src/search.c
+++ b/src/search.c
@@ -26,8 +26,6 @@
#include "ncdc.h"
#include "search.h"
-#include <stdlib.h>
-#include <string.h>
#if INTERFACE
diff --git a/src/strutil.c b/src/strutil.c
index 1d0bacf..5a381ed 100644
--- a/src/strutil.c
+++ b/src/strutil.c
@@ -26,9 +26,6 @@
#include "ncdc.h"
#include "strutil.h"
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
/* A best-effort character conversion function.
diff --git a/src/ui.c b/src/ui.c
index c025c2e..116985e 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "ui.h"
-#include <math.h>
#if INTERFACE
diff --git a/src/ui_util.c b/src/ui_util.c
index 98a7692..a4dff01 100644
--- a/src/ui_util.c
+++ b/src/ui_util.c
@@ -25,12 +25,6 @@
#include "ncdc.h"
#include "ui_util.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <limits.h>
-#include <glib/gstdio.h>
-#include <glib/gprintf.h>
diff --git a/src/uit_fl.c b/src/uit_fl.c
index 2f0a8e6..fca5444 100644
--- a/src/uit_fl.c
+++ b/src/uit_fl.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "uit_fl.h"
-#include <unistd.h>
ui_tab_type_t uit_fl[1];
diff --git a/src/uit_userlist.c b/src/uit_userlist.c
index 51508f6..4e6ebf5 100644
--- a/src/uit_userlist.c
+++ b/src/uit_userlist.c
@@ -26,7 +26,6 @@
#include "ncdc.h"
#include "uit_userlist.h"
-#include <math.h>
ui_tab_type_t uit_userlist[1];
diff --git a/src/util.c b/src/util.c
index c12dc5c..c85742c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -26,14 +26,6 @@
#include "ncdc.h"
#include "util.h"
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <glib/gstdio.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <fcntl.h>
#if INTERFACE
diff --git a/src/vars.c b/src/vars.c
index eebfb3c..2e06bf6 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -27,14 +27,6 @@
#include "ncdc.h"
#include "vars.h"
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
// Internal (low-level) utility functions
diff --git a/src/xmlread.c b/src/xmlread.c
index 95ea2fc..88d65be 100644
--- a/src/xmlread.c
+++ b/src/xmlread.c
@@ -61,10 +61,6 @@
#include "ncdc.h"
#include "xmlread.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <setjmp.h>
#if INTERFACE