]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sql.h
Updated copyrights in headers etc using perl inplace edit
[user/henk/code/inspircd.git] / src / modules / extra / m_sql.h
index 768551bf394edca62a11318cbc27537f09202f4d..fd02c456b6fe8c15e7d30f90f2aea8141b6284fd 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __M_SQL_H__
 #define __M_SQL_H__
 
+using namespace std;
+
 #include <string>
 #include <vector>
 
 #define SQL_ROW    3
 #define SQL_ERROR  4
 #define SQL_END    5
+#define SQL_DONE   6
+#define SQL_OK     7
 
 // SQLRequest is inherited from a basic Request object
 // so that we can neatly pass information around the
 // system.
 
-class SQLRequest : public Request
+class SQLRequest
 {
  protected:
        long conn_id;
        int request_type;
        std::string thisquery;
  public:
+       SQLRequest(int qt, long cid, std::string query)
+       {
+               this->SetQueryType(qt);
+               this->SetConnID(cid);
+               this->SetQuery(query);
+       }
+
        void SetConnID(long id)
        {
                conn_id = id;
        }
 
-       long GetConnID(long id)
+       long GetConnID()
        {
                return conn_id;
        }
@@ -36,7 +47,7 @@ class SQLRequest : public Request
                request_type = t;
        }
 
-       int GetQueryType(int t)
+       int GetQueryType()
        {
                return request_type;
        }
@@ -54,7 +65,7 @@ class SQLRequest : public Request
 
 // Upon completion, an SQLRequest returns an SQLResponse.
 
-class SQLResponse
+class SQLResult
 {
  protected:
        int resptype;
@@ -86,7 +97,7 @@ class SQLResponse
 
        int GetType()
        {
-               return restype;
+               return resptype;
        }
 
        std::string GetError()