summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_sqlutils.h
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-22 14:51:42 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-22 14:51:42 +0000
commit2330fc9ddd48c939e894e7e37e9bb2e62eafc38d (patch)
treee204c5c5c83f2d5fd0970e032df7a8d41a98f3bc /src/modules/extra/m_sqlutils.h
parentfcc4355c4b80e6598aa93dc7f8f40f80e979582c (diff)
Add m_sqlutils - Currently provides ID->chan/user lookups
Update m_sqlauth to use m_sqlutils git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4511 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_sqlutils.h')
-rw-r--r--src/modules/extra/m_sqlutils.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/modules/extra/m_sqlutils.h b/src/modules/extra/m_sqlutils.h
new file mode 100644
index 000000000..bf13e4635
--- /dev/null
+++ b/src/modules/extra/m_sqlutils.h
@@ -0,0 +1,102 @@
+#ifndef INSPIRCD_SQLUTILS
+#define INSPIRCD_SQLUTILS
+
+#include "modules.h"
+
+#define SQLUTILAU "SQLutil AssociateUser"
+#define SQLUTILAC "SQLutil AssociateChan"
+#define SQLUTILUA "SQLutil UnAssociate"
+#define SQLUTILGU "SQLutil GetAssocUser"
+#define SQLUTILGC "SQLutil GetAssocChan"
+#define SQLUTILSUCCESS "You shouldn't be reading this (success)"
+
+class AssociateUser : public Request
+{
+public:
+ unsigned long id;
+ userrec* user;
+
+ AssociateUser(Module* s, Module* d, userrec* u, unsigned long i)
+ : Request(SQLUTILAU, s, d), id(i), user(u)
+ {
+ }
+
+ AssociateUser& S()
+ {
+ Send();
+ return *this;
+ }
+};
+
+class AssociateChan : public Request
+{
+public:
+ unsigned long id;
+ chanrec* chan;
+
+ AssociateChan(Module* s, Module* d, chanrec* u, unsigned long i)
+ : Request(SQLUTILAC, s, d), id(i), chan(u)
+ {
+ }
+
+ AssociateChan& S()
+ {
+ Send();
+ return *this;
+ }
+};
+
+class UnAssociate : public Request
+{
+public:
+ unsigned long id;
+
+ UnAssociate(Module* s, Module* d, unsigned long i)
+ : Request(SQLUTILUA, s, d), id(i)
+ {
+ }
+
+ UnAssociate& S()
+ {
+ Send();
+ return *this;
+ }
+};
+
+class GetAssocUser : public Request
+{
+public:
+ unsigned long id;
+ userrec* user;
+
+ GetAssocUser(Module* s, Module* d, unsigned long i)
+ : Request(SQLUTILGU, s, d), id(i), user(NULL)
+ {
+ }
+
+ GetAssocUser& S()
+ {
+ Send();
+ return *this;
+ }
+};
+
+class GetAssocChan : public Request
+{
+public:
+ unsigned long id;
+ chanrec* chan;
+
+ GetAssocChan(Module* s, Module* d, unsigned long i)
+ : Request(SQLUTILGC, s, d), id(i), chan(NULL)
+ {
+ }
+
+ GetAssocChan& S()
+ {
+ Send();
+ return *this;
+ }
+};
+
+#endif