-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcolornick.h
41 lines (34 loc) · 1.19 KB
/
colornick.h
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
/***************************************************************************
colornick.h - alternative nick spelling support include
-------------------
begin : Sat Jun 07 2003
copyright : (C) 2001-2003 by Alexander Bilichenko
email : [email protected]
***************************************************************************/
#ifndef COLORNICK_H_INCLUDED
#define COLORNICK_H_INCLUDED
#include <unordered_map>
#include "basetypes.h"
#define MAX_REAL_NICK_SIZE 30
#define MAX_ALT_NICK_SIZE 300
class CAltNamesParser {
private:
std::unordered_map<DWORD, char*> nmap;
#pragma pack(push, 1)
typedef struct {
DWORD uid;
char rname[MAX_REAL_NICK_SIZE];
char aname[MAX_ALT_NICK_SIZE];
} AltNamesStruct;
#pragma pack(pop)
public:
CAltNamesParser();
~CAltNamesParser();
int AddAltName(DWORD uid, const char *name, const char *altname);
int DeleteAltName(DWORD uid);
int NameToAltName(DWORD uid, char *altname);
};
#if USER_ALT_NICK_SPELLING_SUPPORT
extern CAltNamesParser AltNames;
#endif
#endif