diff options
| author | Adam <Adam@anope.org> | 2012-02-14 15:13:27 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-02-14 15:13:27 -0500 |
| commit | a9772cde21407c89abd161d51aff45267f87b1fb (patch) | |
| tree | 9e57ba6c121d3843888917d968dd4f5d030b57cf | |
| parent | 086790d6331357022f4da17c76b26b9fc6e2ad90 (diff) | |
Clean up and reorganize our header files
117 files changed, 2415 insertions, 1819 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index c7d5456c7..5579fdf30 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -20,11 +20,24 @@ endif(NOT WIN32) set(PCH_SOURCES_GCH "") if(CMAKE_COMPILER_IS_GNUCXX) string(REPLACE " " ";" PCH_CXXFLAGS ${CXXFLAGS}) - file(GLOB INCLUDE_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") - remove_item_from_list(INCLUDE_SRCS "version.h") - set(PCH_SOURCES "module.h;modules.h;services.h") + file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") + sort_list(PCH_SOURCES) + foreach(PCH_SOURCE ${PCH_SOURCES}) + find_includes(${PCH_SOURCE} INCLUDES) + set(INCLUDES_LIST) + foreach(INCLUDE ${INCLUDES}) + # Extract the filename from the #include line + extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE) + if(QUOTE_TYPE STREQUAL "quotes") + find_in_list(PCH_SOURCES "${FILENAME}" FOUND) + if(NOT FOUND EQUAL -1) + append_to_list(INCLUDES_LIST ${FILENAME}) + endif(NOT FOUND EQUAL -1) + endif(QUOTE_TYPE STREQUAL "quotes") + endforeach(INCLUDE) + set(PCH_EXTRAFLAGS "") if(DEBUG_BUILD) set(PCH_EXTRAFLAGS "-g") @@ -33,13 +46,14 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC) endif(PCH_SOURCE STREQUAL "module.h") if(GETTEXT_INCLUDE) - set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}") + set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}") endif(GETTEXT_INCLUDE) set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch") add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch - COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS} ${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch - DEPENDS ${INCLUDE_SRCS} VERBATIM + COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS} + ${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch + DEPENDS ${INCLUDES_LIST} VERBATIM ) endforeach(PCH_SOURCE ${PCH_SOURCES}) endif(CMAKE_COMPILER_IS_GNUCXX) diff --git a/include/access.h b/include/access.h index 8b380895d..e19c15a76 100644 --- a/include/access.h +++ b/include/access.h @@ -1,6 +1,24 @@ +/* + * + * (C) 2003-2012 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + #ifndef ACCESS_H #define ACCESS_H +#include "services.h" +#include "anope.h" +#include "serialize.h" +#include "service.h" + enum { ACCESS_INVALID = -10000, @@ -28,7 +46,6 @@ class CoreExport PrivilegeManager static void ClearPrivileges(); }; -class ChanAccess; class CoreExport AccessProvider : public Service { diff --git a/include/account.h b/include/account.h index 516bcace5..ffdc7b18f 100644 --- a/include/account.h +++ b/include/account.h @@ -1,10 +1,24 @@ +/* + * + * (C) 2003-2012 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + #ifndef ACCOUNT_H #define ACCOUNT_H +#include "extensible.h" +#include "serialize.h" #include "anope.h" - -class NickAlias; -class NickCore; +#include "memo.h" +#include "base.h" typedef Anope::insensitive_map<NickAlias *> nickalias_map; typedef Anope::insensitive_map<NickCore *> nickcore_map; @@ -93,8 +107,11 @@ const Anope::string NickCoreFlagStrings[] = { "MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "FORBIDDEN", "UNCONFIRMED", "" }; -class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END>, public Serializable +class CoreExport NickAlias : public Base, public Extensible, public Flags<NickNameFlag, NS_END>, public Serializable { + Anope::string vhost_ident, vhost_host, vhost_creator; + time_t vhost_created; + public: /** Default constructor * @param nickname The nick @@ -114,7 +131,6 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_EN time_t time_registered; /* When the nick was registered */ time_t last_seen; /* When it was seen online for the last time */ NickCore *nc; /* I'm an alias of this */ - HostInfo hostinfo; Anope::string serialize_name() const; serialized_data serialize(); @@ -131,9 +147,46 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_EN * @param u The user */ void OnCancel(User *u); + + /** Set a vhost for the user + * @param ident The ident + * @param host The host + * @param creator Who created the vhost + * @param time When the vhost was craated + */ + void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime); + + /** Remove a users vhost + **/ + void RemoveVhost(); + + /** Check if the user has a vhost + * @return true or false + */ + bool HasVhost() const; + + /** Retrieve the vhost ident + * @return the ident + */ + const Anope::string &GetVhostIdent() const; + + /** Retrieve the vhost host + * @return the host + */ + const Anope::string &GetVhostHost() const; + + /** Retrieve the vhost creator + * @return the creator + */ + const Anope::string &GetVhostCreator() const; + + /** Retrieve when the vhost was created + * @return the time it was created + */ + time_t GetVhostCreated() const; }; -class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END>, public Serializable +class CoreExport NickCore : public Base, public Extensible, public Flags<NickCoreFlag, NI_END>, public Serializable { public: /** Default constructor @@ -254,65 +307,11 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END }; -/** Timer for colliding nicks to force people off of nicknames - */ -class CoreExport NickServCollide : public Timer -{ - dynamic_reference<User> u; - Anope::string nick; - - public: - /** Default constructor - * @param nick The nick we're colliding |
