summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_sqlv2.h
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 13:36:11 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-07 13:36:11 +0000
commit598aedf098347155dfd589c0040b9ddf190a6d29 (patch)
tree18d154d3ebafa83026a36c8414818f5be8d6444a /src/modules/extra/m_sqlv2.h
parent56ded38a45a89b428ff45e31b138483a76ba4587 (diff)
More stuff for m_pgsql in, provider-side API stuff semi-done
Add m_sqlv2 header for the new API git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4122 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_sqlv2.h')
-rw-r--r--src/modules/extra/m_sqlv2.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/modules/extra/m_sqlv2.h b/src/modules/extra/m_sqlv2.h
new file mode 100644
index 000000000..521a95640
--- /dev/null
+++ b/src/modules/extra/m_sqlv2.h
@@ -0,0 +1,73 @@
+#ifndef INSPIRCD_SQLAPI_2
+#define INSPIRCD_SQLAPI_2
+
+#define SQLREQID "SQLv2 Request"
+#define SQLRESID "SQLv2 Result"
+#define SQLSUCCESS "You shouldn't be reading this (success)"
+
+#include <string>
+#include "modules.h"
+
+enum SQLerrorNum { BAD_DBID };
+
+class SQLerror
+{
+ SQLerrorNum id;
+public:
+
+ SQLerror()
+ {
+ }
+
+ SQLerror(SQLerrorNum i)
+ : id(i)
+ {
+ }
+
+ void Id(SQLerrorNum i)
+ {
+ id = i;
+ }
+
+ const char* Str()
+ {
+ switch(id)
+ {
+ case BAD_DBID:
+ return "Invalid database ID";
+ default:
+ return "Unknown error";
+ }
+ }
+};
+
+class SQLrequest : public Request
+{
+public:
+ std::string query;
+ std::string dbid;
+ bool pri;
+ SQLerror error;
+
+ SQLrequest(Module* s, Module* d, const std::string &q, const std::string &id, bool p = false)
+ : Request(SQLREQID, s, d), query(q), dbid(id), pri(p)
+ {
+ }
+};
+
+class SQLresult : public Request
+{
+public:
+ SQLresult(Module* s, Module* d)
+ : Request(SQLRESID, s, d)
+ {
+
+ }
+
+ virtual int Rows()
+ {
+ return 0;
+ }
+};
+
+#endif