fixed path of mysql/errmsg.h (OSX compilation fix)
[NeonServV5.git] / src / DBHelper.h
1 /* DBHelper.h - NeonServ v5.6
2  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License 
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
16  */
17 #ifndef _DBHelper_h
18 #define _DBHelper_h
19
20 #include "main.h"
21 struct UserNode;
22 struct ChanNode;
23
24 #define DB_CHANUSER_SUSPENDED 0x01
25 #define DB_CHANUSER_AUTOINVITE 0x02
26 #define DB_CHANUSER_NOAUTOOP 0x04
27
28 #define loadUserSettings(USER) if((USER->flags & USERFLAG_ISAUTHED) && !(USER->flags & USERFLAG_LOADED_SETTINGS)) _loadUserSettings(USER)
29 #define loadChannelSettings(CHAN) if(!(CHAN->flags & CHANFLAG_REQUESTED_CHANINFO)) _loadChannelSettings(CHAN)
30
31 #ifndef DND_FUNCTIONS
32 /* MODULAR ACCESSIBLE */ void _loadUserSettings(struct UserNode* user);
33 /* MODULAR ACCESSIBLE */ int isGodMode(struct UserNode *user);
34 /* MODULAR ACCESSIBLE */ char *getChanDefault(char *channel_setting);
35 /* MODULAR ACCESSIBLE */ int getChannelAccess(struct UserNode *user, struct ChanNode *chan);
36 /* MODULAR ACCESSIBLE */ int checkChannelAccess(struct UserNode *user, struct ChanNode *chan, char *channel_setting, int allow_501);
37 /* MODULAR ACCESSIBLE */ void _loadChannelSettings(struct ChanNode *chan);
38
39 /* MODULAR ACCESSIBLE */ int isUserProtected(struct ChanNode *chan, struct UserNode *victim, struct UserNode *issuer);
40
41 /* MODULAR ACCESSIBLE */ char *getBanAffectingMask(struct ChanNode *chan, char *mask); //returns bans that match a given mask   eg. *!*@ab*  if you pass  *!*@abcdefg.*
42
43 /* MODULAR ACCESSIBLE */ int renameAccount(char *oldauth, char *newauth);
44
45 /* MODULAR ACCESSIBLE */ void deleteUser(int userid);
46
47 void init_DBHelper();
48 #endif
49 #endif