From f1271614679843191bb247c0db2716acb5ac0e4b Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 3 Feb 2008 23:20:20 +0000 Subject: Clear up header insanity git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8808 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/bancache.h | 2 -- include/base.h | 2 -- include/channels.h | 8 ----- include/command_parse.h | 7 ---- include/ctables.h | 9 ----- include/dns.h | 14 +------- include/dynamic.h | 2 -- include/filelogger.h | 6 ---- include/globals.h | 5 --- include/hash_map.h | 2 -- include/hashcomp.h | 17 +++------- include/inspircd.h | 12 +++++-- include/inspsocket.h | 7 ---- include/inspstring.h | 3 +- include/mode.h | 7 ---- include/snomasks.h | 6 ---- include/socket.h | 1 - include/timer.h | 2 +- include/typedefs.h | 8 ++--- include/u_listmode.h | 6 ---- include/users.h | 89 +++++++++++++++++++++++-------------------------- include/wildcard.h | 2 -- include/xline.h | 6 ++-- 23 files changed, 66 insertions(+), 157 deletions(-) (limited to 'include') diff --git a/include/bancache.h b/include/bancache.h index b00bcbae5..3aee3cffd 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -14,8 +14,6 @@ #ifndef __BANCACHE_H #define __BANCACHE_H -#include - class CoreExport BanCacheHit : public classbase { private: diff --git a/include/base.h b/include/base.h index c0513e64d..904a1005c 100644 --- a/include/base.h +++ b/include/base.h @@ -14,8 +14,6 @@ #ifndef __BASE_H__ #define __BASE_H__ -#include "inspircd_config.h" -#include #include #include #include diff --git a/include/channels.h b/include/channels.h index 92dd9a1a3..3419e4c69 100644 --- a/include/channels.h +++ b/include/channels.h @@ -14,13 +14,6 @@ #ifndef __CHANNELS_H__ #define __CHANNELS_H__ -#include "inspircd_config.h" -#include "base.h" -#include -#include -#include -#include - /** RFC1459 channel modes */ enum ChannelModes { @@ -36,7 +29,6 @@ enum ChannelModes { /* Forward declarations - needed */ class User; -class Channel; /** Holds an entry for a ban list, exemption list, or invite list. * This class contains a single element in a channel list, such as a banlist. diff --git a/include/command_parse.h b/include/command_parse.h index c2fa78177..13b70997b 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -14,13 +14,6 @@ #ifndef __COMMAND_PARSE_H #define __COMMAND_PARSE_H -#include -#include "ctables.h" - -/** Required forward declaration - */ -class InspIRCd; - /** A list of dll/so files containing the command handlers for the core */ typedef std::map SharedObjectList; diff --git a/include/ctables.h b/include/ctables.h index 0bd767df0..8daddf192 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -14,15 +14,6 @@ #ifndef __CTABLES_H__ #define __CTABLES_H__ - -#include "inspircd_config.h" -#include "hash_map.h" -#include "base.h" - -/* Forward declarations - required */ -class User; -class InspIRCd; - /** Used to indicate command success codes */ enum CmdResult diff --git a/include/dns.h b/include/dns.h index 6972a1fb2..09ba10d25 100644 --- a/include/dns.h +++ b/include/dns.h @@ -32,21 +32,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _DNS_H #define _DNS_H -#include -#include "inspircd_config.h" -#include "base.h" -#include "socketengine.h" #include "socket.h" -#include "hash_map.h" #include "hashcomp.h" -using namespace std; -using irc::sockets::insp_aton; -using irc::sockets::insp_ntoa; -using irc::sockets::insp_sockaddr; -using irc::sockets::insp_inaddr; - -class InspIRCd; class Module; /** @@ -419,7 +407,7 @@ class CoreExport DNS : public EventHandler * e.g. use ipv6 reverse lookup when built for ipv6, * or ipv4 lookup when built for ipv4. */ - int GetName(const insp_inaddr* ip); + int GetName(const irc::sockets::insp_inaddr* ip); /** * Start lookup of a hostname from an ip, but diff --git a/include/dynamic.h b/include/dynamic.h index 63229febb..4cf299c1f 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -14,8 +14,6 @@ #ifndef __DLL_H #define __DLL_H -#include "inspircd_config.h" - /** The DLLManager class is able to load a module file by filename, * and locate its init_module symbol. */ diff --git a/include/filelogger.h b/include/filelogger.h index 36e50b11c..1aeeb7750 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -14,12 +14,6 @@ #ifndef __LOG_H__ #define __LOG_H__ -#include -#include -#include -#include "socketengine.h" - - /** Debug levels for use with InspIRCd::Log() * */ enum DebugLevel diff --git a/include/globals.h b/include/globals.h index 463f85300..01a8b48e0 100644 --- a/include/globals.h +++ b/include/globals.h @@ -14,11 +14,6 @@ #ifndef __WORLD_H #define __WORLD_H -#include -#include -#include -#include - /** A cached text file stored with its contents as lines */ typedef std::deque file_cache; diff --git a/include/hash_map.h b/include/hash_map.h index 3c3703ce4..b922f6173 100644 --- a/include/hash_map.h +++ b/include/hash_map.h @@ -14,8 +14,6 @@ #ifndef INSPIRCD_HASHMAP_H #define INSPIRCD_HASHMAP_H -#include "inspircd_config.h" - /** Where hash_map is varies from compiler to compiler * as it is not standard. */ diff --git a/include/hashcomp.h b/include/hashcomp.h index dc07c190e..eafc74abf 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -14,8 +14,8 @@ #ifndef _HASHCOMP_H_ #define _HASHCOMP_H_ -#include "inspircd_config.h" -#include "socket.h" +//#include "inspircd_config.h" +//#include "socket.h" #include "hash_map.h" /******************************************************* @@ -33,15 +33,6 @@ * aware of irc::string. *******************************************************/ -/** Required namespaces and symbols */ -using namespace std; - -/** aton() */ -using irc::sockets::insp_aton; - -/** nota() */ -using irc::sockets::insp_ntoa; - #ifndef LOWERMAP #define LOWERMAP /** A mapping of uppercase to lowercase, including scandinavian @@ -133,7 +124,7 @@ namespace irc /** This typedef declares irc::string based upon irc_char_traits. */ - typedef basic_string > string; + typedef std::basic_string > string; /** irc::stringjoiner joins string lists into a string, using * the given seperator string. @@ -711,7 +702,7 @@ namespace nspace * @param s A string to hash * @return The hash value */ - size_t operator()(const string &s) const; + size_t operator()(const std::string &s) const; }; #endif diff --git a/include/inspircd.h b/include/inspircd.h index d78e25b48..71a809be9 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -36,17 +36,23 @@ #include "uid.h" #include "users.h" #include "channels.h" +#include "timer.h" #include "hashcomp.h" #include "typedefs.h" #include "usermanager.h" #include "socket.h" +#include "ctables.h" +#include "command_parse.h" #include "mode.h" #include "socketengine.h" -#include "command_parse.h" #include "snomasks.h" #include "cull_list.h" #include "filelogger.h" #include "caller.h" +//#include "inspsocket.h" +#include "modules.h" +#include "configreader.h" +#include "inspstring.h" /** * Used to define the maximum number of parameters a command may have. @@ -295,7 +301,7 @@ class CoreExport InspIRCd : public classbase /** Used when connecting clients */ - insp_sockaddr client, server; + irc::sockets::insp_sockaddr client, server; /** Used when connecting clients */ @@ -706,7 +712,7 @@ class CoreExport InspIRCd : public classbase * @param LinePrefix text to prefix each complete line with * @param TextStream the text to send to the user */ - void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream); + void DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream); /** Check if the given nickmask matches too many users, send errors to the given user * @param nick A nickmask to match against diff --git a/include/inspsocket.h b/include/inspsocket.h index fd5d4dd18..77c283f7f 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -14,13 +14,6 @@ #ifndef __INSP_SOCKET_H__ #define __INSP_SOCKET_H__ -#include -#include -#include -#include "dns.h" -#include "inspircd_config.h" -#include "socket.h" -#include "inspsocket.h" #include "timer.h" /** diff --git a/include/inspstring.h b/include/inspstring.h index 714e06606..bb03bc2ed 100644 --- a/include/inspstring.h +++ b/include/inspstring.h @@ -14,9 +14,10 @@ #ifndef __IN_INSPSTRING_H #define __IN_INSPSTRING_H +// This (inspircd_config) is needed as inspstring doesn't pull in the central header #include "inspircd_config.h" #include -#include +//#include #ifndef HAS_STRLCPY /** strlcpy() implementation for systems that don't have it (linux) */ diff --git a/include/mode.h b/include/mode.h index eda18a528..716071176 100644 --- a/include/mode.h +++ b/include/mode.h @@ -14,13 +14,6 @@ #ifndef __MODE_H #define __MODE_H -#include -#include -#include -#include "ctables.h" - -class InspIRCd; - /** * Holds the values for different type of modes * that can exist, USER or CHANNEL type. diff --git a/include/snomasks.h b/include/snomasks.h index 334bbf0dc..e3318f23a 100644 --- a/include/snomasks.h +++ b/include/snomasks.h @@ -14,12 +14,6 @@ #ifndef __SNOMASKS_H__ #define __SNOMASKS_H__ -#include -#include -#include -#include "configreader.h" -#include "inspircd.h" - class Snomask { private: diff --git a/include/socket.h b/include/socket.h index 635b3ce55..53bad88f0 100644 --- a/include/socket.h +++ b/include/socket.h @@ -34,7 +34,6 @@ #endif #include -#include "inspircd_config.h" #include "socketengine.h" /* Contains irc-specific definitions */ diff --git a/include/timer.h b/include/timer.h index abe15a2b7..2c38ad88e 100644 --- a/include/timer.h +++ b/include/timer.h @@ -14,7 +14,7 @@ #ifndef INSPIRCD_TIMER_H #define INSPIRCD_TIMER_H -class InspIRCd; +//class InspIRCd; /** Timer class for one-second resolution timers * Timer provides a facility which allows module diff --git a/include/typedefs.h b/include/typedefs.h index 2a98da4ae..6395bfe39 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -17,17 +17,17 @@ #ifndef WIN32 /** User hash (POSIX systems with GCC) */ -typedef nspace::hash_map, irc::StrHashComp> user_hash; +typedef nspace::hash_map, irc::StrHashComp> user_hash; /** Channel hash (POSIX systems with GCC) */ -typedef nspace::hash_map, irc::StrHashComp> chan_hash; +typedef nspace::hash_map, irc::StrHashComp> chan_hash; #else /** User hash (windows systems with visual studio) */ -typedef nspace::hash_map > > user_hash; +typedef nspace::hash_map > > user_hash; /** Channel hash (windows systems with visual studio) */ -typedef nspace::hash_map > > chan_hash; +typedef nspace::hash_map > > chan_hash; #endif /** Server name cache diff --git a/include/u_listmode.h b/include/u_listmode.h index aa387ccf1..b9a11af82 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -14,12 +14,6 @@ #ifndef INSPIRCD_LISTMODE_PROVIDER #define INSPIRCD_LISTMODE_PROVIDER -#include -#include -#include -#include -#include "inspircd.h" -#include "modules.h" #include "wildcard.h" /** Get the time as a string diff --git a/include/users.h b/include/users.h index b9b23eaef..1fca831ef 100644 --- a/include/users.h +++ b/include/users.h @@ -14,13 +14,8 @@ #ifndef __USERS_H__ #define __USERS_H__ -#include -#include "inspircd_config.h" #include "socket.h" -#include "channels.h" -#include "inspstring.h" #include "connection.h" -#include "hashcomp.h" #include "dns.h" /** Channel status for a user @@ -76,47 +71,8 @@ enum RegistrationState { }; /* Required forward declaration */ -class InspIRCd; - -/** Derived from Resolver, and performs user forward/reverse lookups. - */ -class CoreExport UserResolver : public Resolver -{ - private: - /** User this class is 'attached' to. - */ - User* bound_user; - /** File descriptor teh lookup is bound to - */ - int bound_fd; - /** True if the lookup is forward, false if is a reverse lookup - */ - bool fwd; - public: - /** Create a resolver. - * @param Instance The creating instance - * @param user The user to begin lookup on - * @param to_resolve The IP or host to resolve - * @param qt The query type - * @param cache Modified by the constructor if the result was cached - */ - UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache); - - /** Called on successful lookup - * @param result Result string - * @param ttl Time to live for result - * @param cached True if the result was found in the cache - * @param resultnum Result number, we are only interested in result 0 - */ - void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0); - - /** Called on failed lookup - * @param e Error code - * @param errormessage Error message string - */ - void OnError(ResolverError e, const std::string &errormessage); -}; - +class Channel; +class UserResolver; /** Holds information relevent to <connect allow> and <connect deny> tags in the config file. */ @@ -1146,8 +1102,47 @@ class CoreExport User : public connection virtual ~User(); }; +/** Derived from Resolver, and performs user forward/reverse lookups. + */ +class CoreExport UserResolver : public Resolver +{ + private: + /** User this class is 'attached' to. + */ + User* bound_user; + /** File descriptor teh lookup is bound to + */ + int bound_fd; + /** True if the lookup is forward, false if is a reverse lookup + */ + bool fwd; + public: + /** Create a resolver. + * @param Instance The creating instance + * @param user The user to begin lookup on + * @param to_resolve The IP or host to resolve + * @param qt The query type + * @param cache Modified by the constructor if the result was cached + */ + UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache); + + /** Called on successful lookup + * @param result Result string + * @param ttl Time to live for result + * @param cached True if the result was found in the cache + * @param resultnum Result number, we are only interested in result 0 + */ + void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0); + + /** Called on failed lookup + * @param e Error code + * @param errormessage Error message string + */ + void OnError(ResolverError e, const std::string &errormessage); +}; + /* Configuration callbacks */ -class ServerConfig; +//class ServerConfig; #endif diff --git a/include/wildcard.h b/include/wildcard.h index dc2790b54..0d5e3e0aa 100644 --- a/include/wildcard.h +++ b/include/wildcard.h @@ -11,8 +11,6 @@ * --------------------------------------------------- */ -#include "inspircd_config.h" - /** Match a string against a mask. * @param str The string to check * @param mask the mask to check against diff --git a/include/xline.h b/include/xline.h index 348507f37..d5653f8e0 100644 --- a/include/xline.h +++ b/include/xline.h @@ -14,9 +14,9 @@ #ifndef __XLINE_H #define __XLINE_H -#include -#include -#include +//#include +//#include +//#include /** XLine is the base class for ban lines such as G lines and K lines. * Modules may derive from this, and their xlines will automatically be -- cgit v1.2.3