From 9bc04a302572eb311a147a32ff1d36f1d91f2d7a Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 9 Aug 2006 18:55:52 +0000 Subject: userrec and chanrec now have their own independent pointer back to their 'creator' InspIRCd* object, extern now longer required in channels.cpp or users.cpp git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4820 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'include/modules.h') diff --git a/include/modules.h b/include/modules.h index 6f9ebf9e9..b0d249c7c 100644 --- a/include/modules.h +++ b/include/modules.h @@ -103,6 +103,19 @@ typedef std::map featurelist; } \ } +#define FOREACH_MOD_I(z,y,x) if (z->Config->global_implementation[y] > 0) { \ + for (int _i = 0; _i <= MODCOUNT; _i++) { \ + if (z->Config->implement_lists[_i][y]) \ + try \ + { \ + modules[_i]->x ; \ + } \ + catch (ModuleException& modexcept) \ + { \ + log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); \ + } \ + } \ +} /** * This define is similar to the one above but returns a result in MOD_RESULT. * The first module to return a nonzero result is the value to be accepted, @@ -111,7 +124,7 @@ typedef std::map featurelist; #define FOREACH_RESULT(y,x) { if (ServerInstance->Config->global_implementation[y] > 0) { \ MOD_RESULT = 0; \ for (int _i = 0; _i <= MODCOUNT; _i++) { \ - if (ServerInstance->Config->implement_lists[_i][y]) {\ + if (ServerInstance->Config->implement_lists[_i][y]) { \ try \ { \ int res = modules[_i]->x ; \ @@ -129,6 +142,27 @@ typedef std::map featurelist; } \ } +#define FOREACH_RESULT_I(z,y,x) { if (z->Config->global_implementation[y] > 0) { \ + MOD_RESULT = 0; \ + for (int _i = 0; _i <= MODCOUNT; _i++) { \ + if (z->Config->implement_lists[_i][y]) { \ + try \ + { \ + int res = modules[_i]->x ; \ + if (res != 0) { \ + MOD_RESULT = res; \ + break; \ + } \ + } \ + catch (ModuleException& modexcept) \ + { \ + log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + } \ + } \ + } \ + } \ +} + #define FD_MAGIC_NUMBER -42 // useful macros -- cgit v1.2.3