Clean up includes

All the headers are now self-contained (g++ Header.h -o /dev/null).

Some system headers where moved to the .cpp they are actually needed in,
some of our own headers are includes less. (Especially MD5.h)

Headers are sorted alphabetically while in e.g. FileUtils.cpp FileUtils.h
is the first file included.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@915 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-01-07 21:31:16 +00:00
parent 3637091b60
commit e72c445694
55 changed files with 123 additions and 285 deletions
+1
View File
@@ -11,6 +11,7 @@
#include "String.h"
#include <vector>
using std::vector;
class CBufLine {
+2 -3
View File
@@ -7,10 +7,9 @@
*/
#include "Chan.h"
#include "znc.h"
#include "User.h"
#include "Utils.h"
#include "IRCSock.h"
#include "User.h"
#include "znc.h"
CChan::CChan(const CString& sName, CUser* pUser, bool bInConfig) {
m_sName = sName.Token(0);
+4 -4
View File
@@ -9,20 +9,20 @@
#ifndef _CHAN_H
#define _CHAN_H
#include "main.h"
#include "FileUtils.h"
#include "Nick.h"
#include "String.h"
#include "FileUtils.h"
#include "Client.h"
#include <vector>
#include <map>
#include <set>
#include <vector>
using std::vector;
using std::map;
using std::set;
// Forward Declarations
class CUser;
class CClient;
// !Forward Declarations
class CChan {
+3 -4
View File
@@ -6,14 +6,13 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "Client.h"
#include "znc.h"
#include "User.h"
#include "IRCSock.h"
#include "Chan.h"
#include "DCCBounce.h"
#include "DCCSock.h"
#include "IRCSock.h"
#include "Server.h"
#include "User.h"
CClient::~CClient() {
if (!m_spAuth.IsNull()) {
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef _CLIENT_H
#define _CLIENT_H
#include "Utils.h"
#include "main.h"
// Forward Declarations
@@ -18,7 +19,6 @@ class CIRCSock;
class CClient;
// !Forward Declarations
class CAuthBase {
public:
CAuthBase() {}
+1
View File
@@ -7,6 +7,7 @@
*/
#include "DCCBounce.h"
#include "User.h"
void CDCCBounce::ReadLine(const CString& sData) {
CString sLine = sData;
-3
View File
@@ -9,9 +9,6 @@
#ifndef _DCCBOUNCE_H
#define _DCCBOUNCE_H
#include "main.h"
#include "Utils.h"
#include "User.h"
#include "znc.h"
class CDCCBounce : public Csock {
+1
View File
@@ -7,6 +7,7 @@
*/
#include "DCCSock.h"
#include "User.h"
void CDCCSock::ReadData(const char* data, int len) {
if (!m_pFile) {
+4 -3
View File
@@ -9,10 +9,11 @@
#ifndef _DCCSOCK_H
#define _DCCSOCK_H
#include "main.h"
#include "Utils.h"
#include "FileUtils.h"
#include "User.h"
// Forward Declarations
class CUser;
// !Forward Declarations
class CDCCSock : public Csock {
public:
+2 -5
View File
@@ -7,13 +7,10 @@
*/
#include "FileUtils.h"
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
using std::cout;
using std::cerr;
using std::endl;
CFile::CFile() {
m_iFD = -1;
m_bClose = false;
+5 -12
View File
@@ -9,20 +9,13 @@
#ifndef _FILEUTILS_H
#define _FILEUTILS_H
#include <unistd.h>
#include <ctype.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "Csocket.h"
#include "String.h"
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "main.h"
#include <vector>
#include <map>
#include <signal.h>
#include <vector>
using std::vector;
using std::map;
-3
View File
@@ -10,9 +10,6 @@
#define _HTTPSOCK_H
#include "main.h"
#include "Utils.h"
#include "FileUtils.h"
#include "User.h"
class CHTTPSock : public Csock {
public:
+3 -3
View File
@@ -6,11 +6,11 @@
* by the Free Software Foundation.
*/
#include "znc.h"
#include "IRCSock.h"
#include "DCCBounce.h"
#include "Chan.h"
#include "Client.h"
#include <time.h>
#include "DCCBounce.h"
#include "User.h"
CIRCSock::CIRCSock(CUser* pUser) : Csock() {
m_pUser = pUser;
+4 -5
View File
@@ -9,13 +9,12 @@
#ifndef _IRCSOCK_H
#define _IRCSOCK_H
#include "main.h"
#include "User.h"
#include "Chan.h"
#include "Buffer.h"
#include "Csocket.h"
#include "Nick.h"
// Forward Declarations
class CZNC;
class CChan;
class CUser;
// !Forward Declarations
class CIRCSock : public Csock {
+2 -2
View File
@@ -18,11 +18,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "MD5.h"
#include <stdio.h>
#include <string.h>
#include "MD5.h"
CMD5::CMD5()
{
*m_szMD5 = '\0';
+7 -5
View File
@@ -8,13 +8,15 @@
#ifdef _MODULES
#include "main.h"
#include "Modules.h"
#include "znc.h"
#include "Utils.h"
#include "User.h"
#include "Nick.h"
#include "Chan.h"
#include "znc.h"
#include <dlfcn.h>
#ifndef RTLD_LOCAL
# define RTLD_LOCAL 0
# warning "your crap box doesnt define RTLD_LOCAL !?"
#endif
#define MODUNLOADCHK(func) \
for (unsigned int a = 0; a < size(); a++) { \
+9 -9
View File
@@ -11,15 +11,20 @@
#ifndef _MODULES_H
#define _MODULES_H
#include "main.h"
#include "FileUtils.h"
#include "Client.h"
#include <dlfcn.h>
#include <vector>
#include "Utils.h"
#include <set>
#include <vector>
using std::vector;
using std::set;
// Forward Declarations
class CAuthBase;
class CChan;
class CClient;
// !Forward Declarations
// User Module Macros
#ifdef REQUIRESSL
#ifndef HAVE_LIBSSL
@@ -31,11 +36,6 @@ using std::set;
#endif
#endif
#ifndef RTLD_LOCAL
# define RTLD_LOCAL 0
# warning "your crap box doesnt define RTLD_LOCAL !?"
#endif
#define MODCONSTRUCTOR(CLASS) \
CLASS(void *pDLL, CUser* pUser, const CString& sModName, \
const CString& sModPath) \
+2 -2
View File
@@ -6,10 +6,10 @@
* by the Free Software Foundation.
*/
#include "Chan.h"
#include "Nick.h"
#include "User.h"
#include "Chan.h"
#include "IRCSock.h"
#include "User.h"
CNick::CNick() {
Reset();
+2 -1
View File
@@ -10,8 +10,9 @@
#define _NICK_H
#include "String.h"
#include <vector>
#include <set>
#include <vector>
using std::vector;
using std::set;
-1
View File
@@ -6,7 +6,6 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "Server.h"
CServer::CServer(const CString& sName, unsigned short uPort, const CString& sPass, bool bSSL, bool bIPV6) {
+4 -1
View File
@@ -6,10 +6,13 @@
* by the Free Software Foundation.
*/
#include <string.h>
#include "String.h"
#include "FileUtils.h"
#include "MD5.h"
#include "Utils.h"
#include <sstream>
using std::stringstream;
const char* g_szHTMLescapes[256] = {
"&#0;", 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-9
+2 -17
View File
@@ -9,40 +9,25 @@
#ifndef X_STRING_H
#define X_STRING_H
#ifdef USE_PCRE
#include <pcre.h>
#endif
#include <sys/types.h>
#include <set>
#include <map>
#include <set>
#include <string>
#include <sstream>
#include <vector>
using std::set;
using std::map;
using std::multimap;
using std::set;
using std::string;
using std::pair;
using std::vector;
using std::stringstream;
#define _SQL(s) CString("'" + CString(s).Escape_n(CString::ESQL) + "'")
#define _URL(s) CString("'" + CString(s).Escape_n(CString::EURL) + "'")
#define _HTML(s) CString("'" + CString(s).Escape_n(CString::EHTML) + "'")
class CString;
class MCString;
typedef set<CString> SCString;
typedef vector<CString> VCString;
typedef map<CString, VCString> MVCString;
typedef vector<MCString> VMCString;
typedef multimap<CString, CString> MMCString;
static const unsigned char XX = 0xff;
static const unsigned char base64_table[256] = {
+1 -2
View File
@@ -7,8 +7,7 @@
*/
#include "Template.h"
using std::cerr;
#include "FileUtils.h"
void CTemplateOptions::Parse(const CString& sLine) {
CString sName = sLine.Token(0, false, "=").Trim_n().AsUpper();
+1 -2
View File
@@ -9,13 +9,12 @@
#ifndef _TEMPLATE_H
#define _TEMPLATE_H
#include "FileUtils.h"
#include "Utils.h"
#include <iostream>
using std::ostream;
using std::cout;
using std::endl;
using std::ostream;
class CTemplate;
+4 -1
View File
@@ -9,7 +9,10 @@
#ifndef _TIMERS_H
#define _TIMERS_H
#include "main.h"
#include "Client.h"
#include "Csocket.h"
#include "FileUtils.h"
#include "User.h"
class CKeepNickTimer : public CCron {
public:
+5 -8
View File
@@ -6,16 +6,13 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "znc.h"
#include "User.h"
#include "Server.h"
#include "IRCSock.h"
#include "Client.h"
#include "DCCBounce.h"
#include "Chan.h"
#include "DCCSock.h"
#include "MD5.h"
#include "IRCSock.h"
#include "Server.h"
#include "Timers.h"
#include "znc.h"
CUser::CUser(const CString& sUserName) {
m_fTimezoneOffset = 0;
@@ -779,7 +776,7 @@ bool CUser::CheckPass(const CString& sPass) {
return (sPass == m_sPass);
}
return (m_sPass.CaseCmp((char*) CMD5(sPass)) == 0);
return (m_sPass.CaseCmp(sPass.MD5()) == 0);
}
/*CClient* CUser::GetClient() {
+9 -13
View File
@@ -9,28 +9,26 @@
#ifndef _USER_H
#define _USER_H
#include "main.h"
#include "Buffer.h"
#include "FileUtils.h"
#ifdef _MODULES
#include "Modules.h"
#endif
#include <vector>
#include <set>
#include "Nick.h"
#include "FileUtils.h"
#include "Buffer.h"
#include "Utils.h"
#include <set>
#include <vector>
using std::vector;
using std::set;
using std::vector;
class CZNC;
class CChan;
class CServer;
class CIRCSock;
class CClient;
class CKeepNickTimer;
class CIRCSock;
class CJoinTimer;
class CKeepNickTimer;
class CMiscTimer;
class CServer;
class CUser {
public:
@@ -62,9 +60,7 @@ public:
void DelClients();
#ifdef _MODULES
void DelModules();
#endif
#ifdef _MODULES
// Modules
CModules& GetModules() { return *m_pModules; }
const CModules& GetModules() const { return *m_pModules; }
+4 -7
View File
@@ -8,17 +8,14 @@
#include "Utils.h"
#include "MD5.h"
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <sstream>
#include <errno.h>
#ifdef HAVE_LIBSSL
#include <openssl/ssl.h>
#endif /* HAVE_LIBSSL */
#include <sstream>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
using std::stringstream;
+6 -9
View File
@@ -9,18 +9,15 @@
#ifndef _UTILS_H
#define _UTILS_H
#include <unistd.h>
#include <ctype.h>
#include <sys/time.h>
#include <sys/file.h>
#include <stdio.h>
#include <assert.h>
#include "String.h"
#include <vector>
#include <assert.h>
#include <map>
using std::vector;
#include <sys/file.h>
#include <sys/time.h>
#include <vector>
using std::map;
using std::vector;
#ifdef _DEBUG
#define DEBUG_ONLY(f) f
+1 -6
View File
@@ -6,13 +6,8 @@
* by the Free Software Foundation.
*/
#include <unistd.h>
#include <getopt.h>
#include <stdlib.h>
#include <signal.h>
#include "znc.h"
#include "Modules.h"
#include "MD5.h"
#include <getopt.h>
static struct option g_LongOpts[] = {
{ "help", no_argument, 0, 'h' },
-1
View File
@@ -63,6 +63,5 @@ using std::endl;
#include "String.h"
#include "Csocket.h"
#include "Utils.h"
#endif // !_MAIN_H
+1 -4
View File
@@ -6,11 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Modules.h"
class CChanAttach : public CModule {
public:
+1 -4
View File
@@ -6,11 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "User.h"
class CAutoOpMod;
+1 -8
View File
@@ -11,15 +11,8 @@
#define REQUIRESSL
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include <pwd.h>
#include <map>
#include <vector>
#include <sys/stat.h>
#define CRYPT_VERIFICATION_TOKEN "::__:AWAY:__::"
+1 -5
View File
@@ -7,12 +7,8 @@
*/
// @todo handle raw 433 (nick in use)
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "IRCSock.h"
#include "User.h"
class CAwayNickMod;
+2 -5
View File
@@ -6,12 +6,9 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "znc.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "User.h"
#include "znc.h"
class CChanSaverMod : public CModule {
public:
+1 -5
View File
@@ -22,12 +22,8 @@
// It is strongly suggested that you enable SSL between znc and your client otherwise the encryption stops at znc and gets sent to your client in plain text.
//
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "String.h"
#include "User.h"
#define REQUIRESSL 1
+4 -9
View File
@@ -9,18 +9,13 @@
* Author: imaginos <imaginos@imaginos.net>
*/
#include "znc.h"
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include "FileUtils.h"
#include "MD5.h"
#include <pwd.h>
#include "User.h"
#include "znc.h"
#include <sstream>
using std::stringstream;
struct EmailST
{
CString sFrom;
-7
View File
@@ -6,15 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "znc.h"
#include "HTTPSock.h"
#include "Server.h"
#include <map>
using std::map;
+1 -2
View File
@@ -12,8 +12,7 @@
* Usage: LoadModule = rejoin [delay]
*
*/
#include <main.h>
#include <Modules.h>
#include <Chan.h>
#include <User.h>
+1 -6
View File
@@ -7,13 +7,8 @@
*/
#ifdef HAVE_PERL
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "FileUtils.h"
#include "Csocket.h"
#include "User.h"
#include "znc.h"
// perl stuff
-8
View File
@@ -6,15 +6,7 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include <pwd.h>
#include <map>
#include <vector>
class CNickServ : public CModule
{
-6
View File
@@ -6,14 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "znc.h"
#include "HTTPSock.h"
#include "Server.h"
class CPartylineChannel {
public:
-8
View File
@@ -6,15 +6,7 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include <pwd.h>
#include <map>
#include <vector>
class CPerform : public CModule
{
-4
View File
@@ -6,11 +6,7 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
class CRawMod : public CModule {
public:
+1 -4
View File
@@ -6,11 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Modules.h"
class CSampleTimer : public CTimer {
public:
+1 -2
View File
@@ -10,10 +10,9 @@
* @brief SASL authentication module for znc.
*/
#include <sasl/sasl.h>
#include "Modules.h"
#include "znc.h"
#include <sasl/sasl.h>
class CSASLAuthMod : public CGlobalModule {
public:
+2 -7
View File
@@ -14,14 +14,9 @@
#define REQUIRESSL
#include "main.h"
#include "znc.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include <pwd.h>
#include "User.h"
#include <sys/stat.h>
/* TODO list
* store timestamp to be displayed
+2 -11
View File
@@ -11,21 +11,12 @@
#define REQUIRESSL
#include "main.h"
#include "znc.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include "String.h"
#include "FileUtils.h"
#include "Csocket.h"
#include "MD5.h"
#include <pwd.h>
#include "znc.h"
#include <sstream>
using std::pair;
using std::stringstream;
class CSChat;
-8
View File
@@ -6,16 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "Csocket.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include "FileUtils.h"
#include "znc.h"
#include <sys/wait.h>
// Forward Declaration
class CShellMod;
+1 -9
View File
@@ -6,16 +6,8 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Utils.h"
#include "FileUtils.h"
#include <pwd.h>
#include <map>
#include <vector>
#include "User.h"
class CStickyChan : public CModule
{
+2 -7
View File
@@ -6,15 +6,10 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "Buffer.h"
#include "Utils.h"
#include "User.h"
#include <list>
using std::list;
class CWatchSource {
+5 -7
View File
@@ -6,21 +6,19 @@
* by the Free Software Foundation.
*/
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "znc.h"
#include "HTTPSock.h"
#include "Client.h"
#include "Server.h"
#include "Template.h"
#include "User.h"
#include "znc.h"
#include <sstream>
using std::stringstream;
class CWebAdminMod;
class CWebAdminSock;
class CWebAdminAuth : public CAuthBase {
public:
CWebAdminAuth(CWebAdminSock* pWebAdminSock, const CString& sUsername, const CString& sPassword)
+3 -11
View File
@@ -7,19 +7,11 @@
*/
#include "znc.h"
#include "User.h"
#include "Server.h"
#include "Client.h"
#include "Chan.h"
#include "IRCSock.h"
#include "Utils.h"
#include "Server.h"
#include "User.h"
#include <pwd.h>
#include <signal.h>
#include <sys/types.h>
#ifdef _MODULES
#include "Modules.h"
#endif
CZNC::CZNC() {
#ifdef _MODULES
+3 -5
View File
@@ -9,19 +9,17 @@
#ifndef _ZNC_H
#define _ZNC_H
#include "main.h"
#include "FileUtils.h"
#include "Client.h"
#include "Csocket.h"
#include "FileUtils.h"
#ifdef _MODULES
#include "Modules.h"
#endif
#include <set>
#include <map>
using std::map;
using std::set;
class CUser;
class CClient;
class CListener;
class CSockManager : public TSocketManager<Csock> {