summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_sqlutils.h
blob: 26a5f1265671006b71ab54953effeec955e276c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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, unsigned long i, userrec* u)
	: 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, unsigned long i, chanrec* u)
	: 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