summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 18:55:52 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 18:55:52 +0000
commit9bc04a302572eb311a147a32ff1d36f1d91f2d7a (patch)
tree847f867baeefde36c133387b578aa937c37b4360 /include/modules.h
parent2591562ada4cb1f866e5d1c98340fb19332b3844 (diff)
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
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h36
1 files changed, 35 insertions, 1 deletions
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<std::string,Module*> 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<std::string,Module*> 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<std::string,Module*> 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