]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_md5.cpp
Implement feature in bug #395 reported by stealth, and tidy up a bit
[user/henk/code/inspircd.git] / src / modules / m_md5.cpp
index 43afbc15c9120c7400f5417ca4f955444b144181..3b7df836994ce1d24219d95184745cd9206919d7 100644 (file)
@@ -64,7 +64,7 @@ class ModuleMD5 : public Module
                } while (--words);
        }
 
-       void MD5Init(struct MD5Context *ctx, unsigned int* key = NULL)
+       void MD5Init(MD5Context *ctx, unsigned int* key = NULL)
        {
                /* These are the defaults for md5 */
                if (!key)
@@ -86,7 +86,7 @@ class ModuleMD5 : public Module
                ctx->bytes[1] = 0;
        }
 
-       void MD5Update(struct MD5Context *ctx, byte const *buf, int len)
+       void MD5Update(MD5Context *ctx, byte const *buf, int len)
        {
                word32 t;
        
@@ -123,7 +123,7 @@ class ModuleMD5 : public Module
                memcpy(ctx->in, buf, len);
        }
        
-       void MD5Final(byte digest[16], struct MD5Context *ctx)
+       void MD5Final(byte digest[16], MD5Context *ctx)
        {
                int count = (int)(ctx->bytes[0] & 0x3f); /* Bytes in ctx->in */
                byte *p = (byte *)ctx->in + count;      /* First unused byte */
@@ -319,27 +319,4 @@ class ModuleMD5 : public Module
        }
 };
 
-
-class ModuleMD5Factory : public ModuleFactory
-{
- public:
-       ModuleMD5Factory()
-       {
-       }
-       
-       ~ModuleMD5Factory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleMD5(Me);
-       }
-       
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
-       return new ModuleMD5Factory;
-}
+MODULE_INIT(ModuleMD5)