]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Move more stuff into userrec
[user/henk/code/inspircd.git] / include / modules.h
index 6f9ebf9e921c837310452c4db445927cae4c7f88..b0d249c7c73d8d52060a11cec5f500c338acba0c 100644 (file)
@@ -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