diff options
author | Yorhel <git@yorhel.nl> | 2013-01-24 09:45:48 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2013-01-24 09:45:48 +0100 |
commit | 04f95f32f6e2dd784c17f64ede8f1bca407c4256 (patch) | |
tree | 97f36263dcdff450718c5f16f77079dbefafe794 /src | |
parent | effddc21d7532351bb3bdc358262e5f9cc1c417d (diff) |
Move all system #includes into ncdc.h
This simplifies having to figure out which headers to include in each
file, and also removes the need to make a distinction between headers
that define structs/typedefs for data that may be passed between
multiple c files, and all other headers that are only used locally.
In the current build system, this'd probably slow down compilation time
a bit. If/when precompiled headers are used, this change will probably
improve the compilation time. Either way I doubt it's too noticable.
Diffstat (limited to 'src')
-rw-r--r-- | src/cc.c | 6 | ||||
-rw-r--r-- | src/commands.c | 4 | ||||
-rw-r--r-- | src/db.c | 8 | ||||
-rw-r--r-- | src/dl.c | 4 | ||||
-rw-r--r-- | src/fl_load.c | 5 | ||||
-rw-r--r-- | src/fl_local.c | 4 | ||||
-rw-r--r-- | src/fl_save.c | 6 | ||||
-rw-r--r-- | src/fl_util.c | 1 | ||||
-rw-r--r-- | src/hub.c | 1 | ||||
-rw-r--r-- | src/listen.c | 8 | ||||
-rw-r--r-- | src/main.c | 8 | ||||
-rw-r--r-- | src/ncdc.h | 38 | ||||
-rw-r--r-- | src/net.c | 16 | ||||
-rw-r--r-- | src/proto.c | 1 | ||||
-rw-r--r-- | src/search.c | 2 | ||||
-rw-r--r-- | src/strutil.c | 3 | ||||
-rw-r--r-- | src/ui.c | 1 | ||||
-rw-r--r-- | src/ui_util.c | 6 | ||||
-rw-r--r-- | src/uit_fl.c | 1 | ||||
-rw-r--r-- | src/uit_userlist.c | 1 | ||||
-rw-r--r-- | src/util.c | 8 | ||||
-rw-r--r-- | src/vars.c | 8 | ||||
-rw-r--r-- | src/xmlread.c | 4 |
23 files changed, 34 insertions, 110 deletions
@@ -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 @@ -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 @@ -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 @@ -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 @@ -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> @@ -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 @@ -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. @@ -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]; @@ -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 @@ -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 |