]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts2/trusts.c
Merge.
[irc/quakenet/newserv.git] / trusts2 / trusts.c
index bb9b1dd9d6ad1ec7aed7c595eba1fe53e4c46fc3..186fc254d5b6d7215aece9de528eb3b230269a36 100644 (file)
@@ -3,10 +3,13 @@
 #include <string.h>
 #include <stdarg.h>
 #include "../core/nsmalloc.h"
+#include "../lib/version.h"
 
-int tgh_ext;
-int tgb_ext;
-int tgn_ext;
+MODULE_VERSION("");
+
+int tgh_ext = -1;
+int tgb_ext = -1;
+int tgn_ext = -1;
 
 unsigned long trusts_lasttrustgroupid;
 unsigned long trusts_lasttrusthostid;
@@ -21,19 +24,19 @@ void _init(void) {
   trusts_hash_init();
 
   tgh_ext = registernodeext("trusthost");
-  if ( !tgh_ext ) {
+  if ( tgh_ext == -1 ) {
     Error("trusts", ERR_FATAL, "Could not register a required node extension (trusthost)");
     return;
   }
 
   tgb_ext = registernodeext("trustblock");
-  if ( !tgb_ext ) {
+  if ( tgb_ext == -1 ) {
     Error("trusts", ERR_FATAL, "Could not register a required node extension (trustblock)");
     return;
   }
 
   tgn_ext = registernickext("trustnick");
-  if ( !tgn_ext ) {
+  if ( tgn_ext == -1 ) {
     Error("trusts", ERR_FATAL, "Could not register a required nick extension (trustnick)");
     return;
   }
@@ -86,12 +89,12 @@ void _fini(void) {
     }
   } PATRICIA_WALK_CLEAR_END;
 
-  if (tgh_ext)
+  if (tgh_ext != -1)
     releasenodeext(tgh_ext);
-  if (tgb_ext)
+  if (tgb_ext != -1)
     releasenodeext(tgb_ext);
-  if (tgn_ext)
-    releasenodeext(tgn_ext);
+  if (tgn_ext != -1)
+    releasenickext(tgn_ext);
 
   /* @@@ CLOSE DB */