Update #include's: remove unused and add missing ones
authorAlexander Barton <alex@barton.de>
Mon, 17 Mar 2014 01:28:39 +0000 (02:28 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 17 Mar 2014 10:37:25 +0000 (11:37 +0100)
The "deheader" tool (<http://www.catb.org/~esr/deheader/>) has been
used to find unused #include directives as well as missing ones.

Tested on:

- A/UX 3.1.1
- ArchLinux (2014-03-17)
- Debian GNU/Hurd
- Debian GNU/Linux 6.0.9
- Debian GNU/Linux 7.4
- Fedora 20
- FreeBSD 9.2
- OpenBSD 4.8
- OpenBSD 5.1
- OS X 10.9
- Solaris 11

36 files changed:
src/ipaddr/ng_ipaddr.h
src/ngircd/array.c
src/ngircd/channel.c
src/ngircd/class.c
src/ngircd/client-cap.c
src/ngircd/client.c
src/ngircd/conf.c
src/ngircd/conn-encoding.c
src/ngircd/conn-func.c
src/ngircd/conn.c
src/ngircd/hash.c
src/ngircd/io.c
src/ngircd/irc-cap.c
src/ngircd/irc-channel.c
src/ngircd/irc-encoding.c
src/ngircd/irc-info.c
src/ngircd/irc-login.c
src/ngircd/irc-metadata.c
src/ngircd/irc-mode.c
src/ngircd/irc-op.c
src/ngircd/irc-oper.c
src/ngircd/irc-server.c
src/ngircd/irc-write.c
src/ngircd/irc.c
src/ngircd/lists.c
src/ngircd/log.c
src/ngircd/login.c
src/ngircd/match.c
src/ngircd/ngircd.c
src/ngircd/numeric.c
src/ngircd/op.c
src/ngircd/pam.c
src/ngircd/parse.c
src/ngircd/proc.c
src/ngircd/resolve.c
src/ngircd/sighandlers.c

index 799aa88f9dc928d2391ab3eea46369a5bacd03ac..f8409de99288e7f6b666e1f18c0a63c10b4ec8ad 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <assert.h>
+#include <string.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 
index ad4f8dac7cda4a57fd5f57a4901829872900e4ac..af66edd9305580aea5b53471a00a1300bfe0aaac 100644 (file)
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
-#include "log.h"
+#ifdef DEBUG_ARRAY
+# include "log.h"
+#endif
 
 /* Enable more Debug messages in alloc / append / memmove code. */
 /* #define DEBUG_ARRAY */
index e879dcdd7368f694c2a7aa44bcf1bb9e78a7e087..a05b5938adbeb7a3e7fc7b1f34beaa94ca533897 100644 (file)
@@ -24,8 +24,8 @@
 #include <errno.h>
 #include <stdio.h>
 #include <strings.h>
+#include <time.h>
 
-#include "defines.h"
 #include "conn-func.h"
 
 #include "channel.h"
@@ -33,7 +33,6 @@
 #include "irc-write.h"
 #include "conf.h"
 #include "hash.h"
-#include "lists.h"
 #include "log.h"
 #include "messages.h"
 #include "match.h"
index df444fec115c9e3052982df102d18d8cfdc027c4..9ffa8b147471b18b8ee2a97d4914c162e21e6f44 100644 (file)
  */
 
 #include <assert.h>
+#include <stdio.h>
 #include <string.h>
 
-#include "defines.h"
-#include "array.h"
 #include "conn.h"
-#include "client.h"
 #include "lists.h"
-#include "match.h"
-#include "stdio.h"
 
 #include "class.h"
 
index 42463b792aa54b1a6ca9520a6490003d92daa39f..3ccc6cbfbca1cb0d0e142bea208aadcbf2487981 100644 (file)
 
 #include <assert.h>
 
-#include "defines.h"
 #include "conn.h"
-#include "client.h"
 #include "log.h"
 
-#include "client-cap.h"
-
 GLOBAL int
 Client_Cap(CLIENT *Client)
 {
index befb779c663840bdb52df730d88e1a1fbca9b9c7..8e1848df784281327834b4e248af8a83674e61db 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <time.h>
 #include <netdb.h>
 
-#include "defines.h"
 #include "conn.h"
-#include "client.h"
-
 #include "ngircd.h"
 #include "channel.h"
 #include "conf.h"
index 90ba72d3cf6398b2ce6693cafbdfed54e54c5841..2f234dad542ec7dc4aaf973fe7af068c3e72706d 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include <assert.h>
-#include <ctype.h>
 #include <errno.h>
 #ifdef PROTOTYPES
 #      include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <time.h>
 #include <unistd.h>
 #include <pwd.h>
 #include <grp.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <dirent.h>
 
-#include "array.h"
 #include "ngircd.h"
 #include "conn.h"
 #include "channel.h"
-#include "defines.h"
 #include "log.h"
 #include "match.h"
-#include "tool.h"
 
 #include "conf.h"
 
index c0710d8b07237e29202880b78c254a7128db636c..8bce3d2e629d90683d312905c81b24fe6df6e55c 100644 (file)
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 
-#include "defines.h"
 #include "conn.h"
-#include "log.h"
-
-#include "conn-encoding.h"
 
 #ifdef ICONV
 
-char Encoding_Buffer[COMMAND_LEN];
+#include "log.h"
+#include "conn-encoding.h"
 
+char Encoding_Buffer[COMMAND_LEN];
 char *Convert_Message PARAMS((iconv_t Handle, char *Message));
 
 /**
index 758315894604f8cafecf1da2dbc6a88857fba437..c72a94c40a42e9bb96016c3d6a3aca2ef3e90702 100644 (file)
  */
 
 #include <assert.h>
-#include <string.h>
-#include "log.h"
+#include <time.h>
 
+#ifdef DEBUG
+# include "log.h"
+#endif
 #include "conn.h"
-#include "client.h"
 
 #include "conn-func.h"
 
index 5ef28dc064f8bbcb09646d95237643fd3264429d..75b77942d966858da2200fd6e7cb660b981b141b 100644 (file)
@@ -14,8 +14,6 @@
 #define CONN_MODULE
 
 #include "portab.h"
-#include "conf-ssl.h"
-#include "io.h"
 
 /**
  * @file
@@ -33,8 +31,9 @@
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
+#include <strings.h>
 #include <sys/socket.h>
-#include <sys/time.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <time.h>
 #include <netinet/in.h>
 # include <tcpd.h>                     /* for TCP Wrappers */
 #endif
 
-#include "array.h"
-#include "defines.h"
-
 #include "conn.h"
 
 #include "ngircd.h"
-#include "array.h"
-#include "client.h"
 #include "class.h"
-#include "conf.h"
-#include "conn-encoding.h"
+#ifdef ICONV
+# include "conn-encoding.h"
+#endif
 #include "conn-ssl.h"
 #include "conn-zip.h"
 #include "conn-func.h"
+#include "io.h"
 #include "log.h"
 #include "ng_ipaddr.h"
 #include "parse.h"
 #include "resolve.h"
-#include "tool.h"
 
 #define SERVER_WAIT (NONE - 1)
 
index 46d1a7b40f931bf16376bec15cef19e288a08d40..fdf1c0ef75464cf8d61eb74f078889de3c910bcf 100644 (file)
@@ -22,8 +22,6 @@
 #include "defines.h"
 #include "tool.h"
 
-#include "hash.h"
-
 static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval));
 
 /**
index 791190fed8fee134eca794d5b75e1876f6b9d7ba..b2127f255af0faf135b07ba40f5113f60f17d266 100644 (file)
  */
 
 #include <assert.h>
-#include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <sys/stat.h>
 #include <fcntl.h>
 
 #include "array.h"
index c780921ea8e64742507fe221c05281452b9a62d3..23ad5f69079632f93c6c98c575c68b175492ceea 100644 (file)
 
 #include <assert.h>
 #include <string.h>
+#include <strings.h>
 
-#include "defines.h"
 #include "conn.h"
 #include "channel.h"
 #include "client-cap.h"
-#include "irc-macros.h"
 #include "irc-write.h"
 #include "log.h"
 #include "login.h"
 #include "messages.h"
 #include "parse.h"
 
-#include "irc-cap.h"
-
 /* Local functions */
 
 /**
index 4eee5046763d95ad96e354224e87cb6af07885a4..c98176f1f3b6fbb44efc33d00607155cae47457e 100644 (file)
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "defines.h"
 #include "conn.h"
 #include "channel.h"
 #include "conn-func.h"
@@ -36,8 +35,6 @@
 #include "irc-write.h"
 #include "conf.h"
 
-#include "irc-channel.h"
-
 /**
  * Part from all channels.
  *
index dfc412bc9a107a1a9a682f8dcc4d1db980f8921f..0b8e9d4b9b0e9d84561f3dbf7a5e42bdf4572d2f 100644 (file)
@@ -16,6 +16,8 @@
  * IRC encoding commands
  */
 
+#ifdef ICONV
+
 #include <assert.h>
 #include <string.h>
 
 #include "parse.h"
 #include "tool.h"
 
-#include "irc-encoding.h"
-
-#ifdef ICONV
-
 /**
  * Handler for the IRC+ "CHARCONV" command.
  *
index 6a4057292f42820547afb9d3a8ff5b01171eb676..763c9302341bf18e6fb6f961e0a8d8b32ff9a4ea 100644 (file)
  */
 
 #include <assert.h>
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <time.h>
 
 #include "ngircd.h"
 #include "conn-func.h"
 #include "channel.h"
 #include "class.h"
 #include "conf.h"
-#include "defines.h"
 #include "lists.h"
-#include "log.h"
 #include "messages.h"
 #include "match.h"
-#include "tool.h"
 #include "parse.h"
 #include "irc.h"
 #include "irc-macros.h"
index c8cff24d845debc3f4bdb415cfd74c36cb1231dc..303ab973e6dff6c84eb5df86c18f003fc0939750 100644 (file)
@@ -21,9 +21,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <time.h>
 
 #include "conn-func.h"
-#include "class.h"
 #include "conf.h"
 #include "channel.h"
 #include "log.h"
 #include "messages.h"
 #include "parse.h"
 #include "irc.h"
-#include "irc-info.h"
 #include "irc-macros.h"
 #include "irc-write.h"
 
-#include "irc-login.h"
-
 static void Change_Nick PARAMS((CLIENT * Origin, CLIENT * Target, char *NewNick,
                                bool InformClient));
 
index 9a3a94b363fd59e76544c849c86af884b2773626..463060b410f39146b83d5014ec4ccf018e8a78a3 100644 (file)
  */
 
 #include <assert.h>
-#include <string.h>
+#include <strings.h>
 #include <stdio.h>
 
 #include "conn-func.h"
 #include "channel.h"
-#include "conn-encoding.h"
 #include "irc-write.h"
 #include "log.h"
 #include "messages.h"
 #include "parse.h"
-#include "tool.h"
-
-#include "irc-metadata.h"
 
 /**
  * Handler for the IRC+ "METADATA" command.
index b83c1eb49bc179119b278f75064737bc6f099b24..00d3d98fa6ffda5da7d5a7a89bd10c76e7bd1c18 100644 (file)
@@ -21,7 +21,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "defines.h"
 #include "conn.h"
 #include "channel.h"
 #include "irc-macros.h"
@@ -32,8 +31,6 @@
 #include "messages.h"
 #include "conf.h"
 
-#include "irc-mode.h"
-
 static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
                                CLIENT *Target));
 static bool Channel_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
index 0934285ccf3d67751d6a3a5f17518d010ab29748..437e8c434547faa797e4685f2e352658240b50fb 100644 (file)
@@ -18,9 +18,7 @@
 
 #include <assert.h>
 #include <string.h>
-#include <stdio.h>
 
-#include "defines.h"
 #include "conn.h"
 #include "channel.h"
 #include "irc-macros.h"
@@ -30,8 +28,6 @@
 #include "messages.h"
 #include "parse.h"
 
-#include "irc-op.h"
-
 /* Local functions */
 
 static bool
index 1a2150f175bfd6e009c641e61176f5b7f758a0db..01bfa9491119314b8fa957b377d1e9abf3b56546 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
+#include <time.h>
 
 #include "ngircd.h"
 #include "conn-func.h"
@@ -29,7 +30,6 @@
 #include "class.h"
 #include "parse.h"
 #include "irc.h"
-#include "irc-macros.h"
 #include "irc-write.h"
 #include "lists.h"
 #include "log.h"
@@ -37,8 +37,6 @@
 #include "messages.h"
 #include "op.h"
 
-#include "irc-oper.h"
-
 /**
  * Handle invalid received OPER command.
  * Log OPER attempt and send error message to client.
index fa1ca966aff877ae5d4fd3f46cd1ff9b84a61286..e85e9beda214a0dd77bf4fc367007503fb6a57fd 100644 (file)
 #include <string.h>
 #include <strings.h>
 
-#include "defines.h"
-#include "conn.h"
 #include "conn-func.h"
 #include "conn-zip.h"
 #include "conf.h"
 #include "channel.h"
-#include "lists.h"
 #include "log.h"
 #include "messages.h"
 #include "parse.h"
 #include "numeric.h"
 #include "ngircd.h"
 #include "irc-info.h"
-#include "irc-macros.h"
 #include "irc-write.h"
 #include "op.h"
 
-#include "irc-server.h"
-
 /**
  * Handler for the IRC "SERVER" command.
  *
index c6a3dce23c00b42a7363a0857c162502e4247dd3..9c0c39871500648ec95c18c6b8af05bd49a00fe0 100644 (file)
@@ -23,9 +23,7 @@
 #      include <varargs.h>
 #endif
 #include <stdio.h>
-#include <string.h>
 
-#include "defines.h"
 #include "conn-func.h"
 #include "channel.h"
 
index e99f42ff23633d06deaf5b10f4c4ffa46f824688..008dd350d9682c58fa52af1a69e6d409ecfe182a 100644 (file)
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
+#include <time.h>
 
 #include "ngircd.h"
 #include "conn-func.h"
 #include "conf.h"
 #include "channel.h"
-#include "conn-encoding.h"
-#include "defines.h"
+#ifdef ICONV
+# include "conn-encoding.h"
+#endif
 #include "irc-macros.h"
 #include "irc-write.h"
 #include "log.h"
@@ -33,7 +36,6 @@
 #include "messages.h"
 #include "parse.h"
 #include "op.h"
-#include "tool.h"
 
 #include "irc.h"
 
index d3efb1f7386e746ecbad05979b9b84cf6a92b8ed..ab2aeb3c32069fec47fa101d44660749db22ba27 100644 (file)
  */
 
 #include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <time.h>
 
-#include "defines.h"
 #include "conn.h"
-#include "channel.h"
 #include "log.h"
 #include "match.h"
-#include "messages.h"
-#include "irc-write.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
 
 #include "lists.h"
 
index cc819ad7533f26b88da5e1254502f506f3c3d9c9..31e5d59f73cb3ae405ab07d67ac9d547215c0d68 100644 (file)
  */
 
 #include <assert.h>
-#include <errno.h>
 #ifdef PROTOTYPES
-#      include <stdarg.h>
+# include <stdarg.h>
 #else
-#      include <varargs.h>
+# include <varargs.h>
 #endif
 #include <stdio.h>
-#include <string.h>
 #include <sys/types.h>
+#include <time.h>
 #include <unistd.h>
 
 #ifdef SYSLOG
-#include <syslog.h>
+# include <syslog.h>
 #endif
 
 #include "ngircd.h"
-#include "defines.h"
 #include "conn.h"
 #include "channel.h"
 #include "irc-write.h"
index b3ab2ed3cf70138efb7326d7e9158bcf0b29e713..8218ed14b4bed2092bf9209dfcbc121a96e24984 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <strings.h>
 #include <unistd.h>
 
-#include "defines.h"
 #include "conn.h"
 #include "class.h"
-#include "client.h"
 #include "client-cap.h"
 #include "channel.h"
 #include "conf.h"
-#include "io.h"
 #include "parse.h"
 #include "log.h"
 #include "messages.h"
 #include "ngircd.h"
-#include "pam.h"
 #include "irc-info.h"
 #include "irc-mode.h"
 #include "irc-write.h"
 #include "login.h"
 
 #ifdef PAM
+
+#include "io.h"
+#include "pam.h"
+
 static void cb_Read_Auth_Result PARAMS((int r_fd, UNUSED short events));
+
 #endif
 
 /**
index f1a0875ebb3582b46b47fc2c75f388389878c19b..ce454bd34d2a52a4fd3103d2156076a0b7ba3fcf 100644 (file)
@@ -19,7 +19,6 @@
 #include <assert.h>
 #include <string.h>
 
-#include "match.h"
 #include "defines.h"
 #include "tool.h"
 
index b266c534fc51567b7fd94faf3269d47d078f0687..1b20597d8aa26cf7dbd0c2e490786ea910bab8d5 100644 (file)
@@ -21,7 +21,6 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <signal.h>
 #include <string.h>
 #include <unistd.h>
 #include <time.h>
 #include <mcheck.h>
 #endif
 
-#include "defines.h"
 #include "conn.h"
 #include "class.h"
-#include "conf-ssl.h"
 #include "channel.h"
 #include "conf.h"
-#include "lists.h"
 #include "log.h"
-#include "parse.h"
 #include "sighandlers.h"
 #include "io.h"
-#include "irc.h"
 
 #include "ngircd.h"
 
index e1b160b374554b91c80d967f92b89d0f198bc88b..b1facceaf0f4e1296baa9f803dc4b3f73d1dd1d6 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 
-#include "defines.h"
-#include "conn.h"
-#include "conf.h"
-#include "conn.h"
 #include "conn-func.h"
+#include "conf.h"
 #include "channel.h"
 #include "class.h"
 #include "irc-write.h"
 #include "lists.h"
 #include "log.h"
-#include "messages.h"
 #include "parse.h"
 
-#include "numeric.h"
-
 /**
  * Announce a channel and its users in the network.
  */
index 66e9d5a2bfc31fa9eaceb6cbd4f00b088c753f57..6cb914353e72984a26f8c772c4aab066f6cb3216 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include <assert.h>
-#include <string.h>
 
 #include "conn.h"
 #include "channel.h"
@@ -27,8 +26,6 @@
 #include "messages.h"
 #include "irc-write.h"
 
-#include "op.h"
-
 /**
  * Return and log a "no privileges" message.
  */
index dd15052f008539ca4780d7d2a21dfb35b6e4cee1..cfaa508f9a8e34d2b60306b1621b88d7da81fcb1 100644 (file)
  */
 
 #include <assert.h>
-
-#include "defines.h"
-#include "log.h"
-#include "conn.h"
-#include "client.h"
-
 #include <stdlib.h>
 #include <string.h>
-
 #ifdef HAVE_SECURITY_PAM_APPL_H
-#include <security/pam_appl.h>
+# include <security/pam_appl.h>
 #endif
-
 #ifdef HAVE_PAM_PAM_APPL_H
-#include <pam/pam_appl.h>
+# include <pam/pam_appl.h>
 #endif
 
+#include "defines.h"
+#include "log.h"
+#include "conn.h"
+#include "client.h"
+
 #include "pam.h"
 
 static char *password;
index fa91a9b1eb538ab289be6767d65223b1251aa3cf..28c198fde421e5c0f9e3cedd98fe4ce0dfe4f939 100644 (file)
 
 #include <assert.h>
 #include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
 #include <strings.h>
 
 #include "ngircd.h"
-#include "defines.h"
 #include "conn-func.h"
+#include "conf.h"
 #include "channel.h"
 #include "log.h"
 #include "messages.h"
-#include "tool.h"
 
 #include "parse.h"
 
 #include "irc.h"
 #include "irc-cap.h"
 #include "irc-channel.h"
-#include "irc-encoding.h"
+#ifdef ICONV
+# include "irc-encoding.h"
+#endif
 #include "irc-info.h"
 #include "irc-login.h"
 #include "irc-metadata.h"
@@ -46,8 +46,6 @@
 #include "irc-write.h"
 #include "numeric.h"
 
-#include "conf.h"
-
 struct _NUMERIC {
        int numeric;
        bool (*function) PARAMS(( CLIENT *Client, REQUEST *Request ));
index 4220f1ab16f9101550e40df8e351caa777545b21..4da73474427861b75e5ac34d4d66cc364809ad44 100644 (file)
 #include <signal.h>
 #include <string.h>
 #include <stdlib.h>
+#include <sys/types.h>
 #include <unistd.h>
+#include <time.h>
 
 #include "log.h"
 #include "io.h"
-#include "conn.h"
 #include "sighandlers.h"
+
 #include "proc.h"
 
 /**
index d3c89f89ef1ce6810c9150c08c13a004978129ef..8aac6b86be8d4f28b6d21a74d541cf3dcc26c7bb 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#include <signal.h>
 
 #ifdef IDENTAUTH
 #ifdef HAVE_IDENT_H
 #endif
 #endif
 
-#include "array.h"
 #include "conn.h"
 #include "conf.h"
-#include "defines.h"
 #include "log.h"
 #include "ng_ipaddr.h"
 
-#include "resolve.h"
-#include "io.h"
-
 static void Do_ResolveAddr PARAMS(( const ng_ipaddr_t *Addr, int Sock, int w_fd ));
 static void Do_ResolveName PARAMS(( const char *Host, int w_fd ));
 
index a953d02b9d92013e99181c2303ca470ccf1869ea..c1f7835901cec9241e8af2edb1a4ae5d4201d800 100644 (file)
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <time.h>
 
 #include "conn.h"
-#include "conf-ssl.h"
 #include "channel.h"
 #include "conf.h"
 #include "io.h"
 #include "log.h"
 #include "ngircd.h"
-#include "sighandlers.h"
 
 static int signalpipe[2];