From 598aedf098347155dfd589c0040b9ddf190a6d29 Mon Sep 17 00:00:00 2001 From: om Date: Fri, 7 Jul 2006 13:36:11 +0000 Subject: 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 --- src/modules/extra/m_sqlv2.h | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/modules/extra/m_sqlv2.h (limited to 'src/modules/extra/m_sqlv2.h') 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 +#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 -- cgit v1.2.3