ngircd

Free, portable and lightweight Internet Relay Chat server http://ngircd.barton.de/
Log | Files | Refs | README | LICENSE

commit b130b35f48d19450240748425e12d21f2c38350f
parent 37090a28e8319650e49b4bd3e0518c2f8cbc8ae4
Author: Alexander Barton <alex@barton.de>
Date:   Mon, 17 Mar 2014 02:28:39 +0100

Update #include's: remove unused and add missing ones

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

Diffstat:
Msrc/ipaddr/ng_ipaddr.h | 1+
Msrc/ngircd/array.c | 5++++-
Msrc/ngircd/channel.c | 3+--
Msrc/ngircd/class.c | 6+-----
Msrc/ngircd/client-cap.c | 4----
Msrc/ngircd/client.c | 4+---
Msrc/ngircd/conf.c | 6+-----
Msrc/ngircd/conn-encoding.c | 9++++-----
Msrc/ngircd/conn-func.c | 7++++---
Msrc/ngircd/conn.c | 17++++++-----------
Msrc/ngircd/hash.c | 2--
Msrc/ngircd/io.c | 2+-
Msrc/ngircd/irc-cap.c | 5+----
Msrc/ngircd/irc-channel.c | 3---
Msrc/ngircd/irc-encoding.c | 6++----
Msrc/ngircd/irc-info.c | 5+----
Msrc/ngircd/irc-login.c | 5+----
Msrc/ngircd/irc-metadata.c | 6+-----
Msrc/ngircd/irc-mode.c | 3---
Msrc/ngircd/irc-op.c | 4----
Msrc/ngircd/irc-oper.c | 4+---
Msrc/ngircd/irc-server.c | 6------
Msrc/ngircd/irc-write.c | 2--
Msrc/ngircd/irc.c | 8+++++---
Msrc/ngircd/lists.c | 12++++--------
Msrc/ngircd/log.c | 10++++------
Msrc/ngircd/login.c | 10+++++-----
Msrc/ngircd/match.c | 1-
Msrc/ngircd/ngircd.c | 6------
Msrc/ngircd/numeric.c | 9++-------
Msrc/ngircd/op.c | 3---
Msrc/ngircd/pam.c | 17+++++++----------
Msrc/ngircd/parse.c | 10++++------
Msrc/ngircd/proc.c | 4+++-
Msrc/ngircd/resolve.c | 8++------
Msrc/ngircd/sighandlers.c | 3+--
36 files changed, 68 insertions(+), 148 deletions(-)

diff --git a/src/ipaddr/ng_ipaddr.h b/src/ipaddr/ng_ipaddr.h @@ -13,6 +13,7 @@ */ #include <assert.h> +#include <string.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/src/ngircd/array.c b/src/ngircd/array.c @@ -19,8 +19,11 @@ #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 */ diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c @@ -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" diff --git a/src/ngircd/class.c b/src/ngircd/class.c @@ -17,15 +17,11 @@ */ #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" diff --git a/src/ngircd/client-cap.c b/src/ngircd/client-cap.c @@ -20,13 +20,9 @@ #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) { diff --git a/src/ngircd/client.c b/src/ngircd/client.c @@ -24,12 +24,10 @@ #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" diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c @@ -17,7 +17,6 @@ */ #include <assert.h> -#include <ctype.h> #include <errno.h> #ifdef PROTOTYPES # include <stdarg.h> @@ -28,21 +27,18 @@ #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" diff --git a/src/ngircd/conn-encoding.c b/src/ngircd/conn-encoding.c @@ -23,17 +23,16 @@ #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)); /** diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c @@ -19,11 +19,12 @@ */ #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" diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c @@ -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> @@ -50,25 +49,21 @@ # 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) diff --git a/src/ngircd/hash.c b/src/ngircd/hash.c @@ -22,8 +22,6 @@ #include "defines.h" #include "tool.h" -#include "hash.h" - static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval)); /** diff --git a/src/ngircd/io.c b/src/ngircd/io.c @@ -16,10 +16,10 @@ */ #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" diff --git a/src/ngircd/irc-cap.c b/src/ngircd/irc-cap.c @@ -18,20 +18,17 @@ #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 */ /** diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c @@ -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. * diff --git a/src/ngircd/irc-encoding.c b/src/ngircd/irc-encoding.c @@ -16,6 +16,8 @@ * IRC encoding commands */ +#ifdef ICONV + #include <assert.h> #include <string.h> @@ -27,10 +29,6 @@ #include "parse.h" #include "tool.h" -#include "irc-encoding.h" - -#ifdef ICONV - /** * Handler for the IRC+ "CHARCONV" command. * diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c @@ -17,11 +17,11 @@ */ #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" @@ -29,12 +29,9 @@ #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" diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c @@ -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" @@ -31,12 +31,9 @@ #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)); diff --git a/src/ngircd/irc-metadata.c b/src/ngircd/irc-metadata.c @@ -19,19 +19,15 @@ */ #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. diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c @@ -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, diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c @@ -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 diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c @@ -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. diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c @@ -22,25 +22,19 @@ #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. * diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c @@ -23,9 +23,7 @@ # include <varargs.h> #endif #include <stdio.h> -#include <string.h> -#include "defines.h" #include "conn-func.h" #include "channel.h" diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c @@ -19,13 +19,16 @@ #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" diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c @@ -17,18 +17,14 @@ */ #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" diff --git a/src/ngircd/log.c b/src/ngircd/log.c @@ -17,23 +17,21 @@ */ #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" diff --git a/src/ngircd/login.c b/src/ngircd/login.c @@ -20,22 +20,17 @@ #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" @@ -43,7 +38,12 @@ #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 /** diff --git a/src/ngircd/match.c b/src/ngircd/match.c @@ -19,7 +19,6 @@ #include <assert.h> #include <string.h> -#include "match.h" #include "defines.h" #include "tool.h" diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c @@ -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> @@ -35,18 +34,13 @@ #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" diff --git a/src/ngircd/numeric.c b/src/ngircd/numeric.c @@ -20,22 +20,17 @@ #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. */ diff --git a/src/ngircd/op.c b/src/ngircd/op.c @@ -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. */ diff --git a/src/ngircd/pam.c b/src/ngircd/pam.c @@ -19,23 +19,20 @@ */ #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; diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c @@ -18,24 +18,24 @@ #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 )); diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c @@ -21,12 +21,14 @@ #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" /** diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c @@ -23,10 +23,11 @@ #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 @@ -34,16 +35,11 @@ #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 )); diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c @@ -24,15 +24,14 @@ #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];