]>
jfr.im git - irc/thales.git/blob - src/db.h
1 /* GNU Thales - IRC to Relational Database Gateway
2 * Copyright (C) 2002 Lucas Nussbaum <lucas@lucas-nussbaum.net>
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 2 of the License, or
7 * (at your option) any later version.
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.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 /* GNU Thales' database interface */
27 int db_query(const char *fmt
, ...);
28 char *db_escape(char *);
29 int db_checkserver(char *serv
);
30 int db_getserver(char *serv
);
31 int db_getservfromnick(char *nick
);
32 int db_checknick(char *nick
);
33 int db_getnick(char *nick
);
35 void db_chgnick(char *newnick
, char *oldnick
);
36 void db_addserver(char *server
, int servid
);
37 void db_delserver(char *server
);
38 void db_addnick(char *nick
, int nickid
);
39 void db_delnick(char *nick
);
40 int db_getchannel(char *chan
);
41 int db_getchancreate(char *chan
);
42 void db_removefromchans(int nickid
);
43 void db_removenick(char *nick
);
44 void db_checkemptychan(int chanid
, char *chan
);
46 void db_cleanserver();
48 int db_getlusers(int type
);
49 #define LUSERS_USERS 1
50 #define LUSERS_USERSINV 2
51 #define LUSERS_OPERS 3
54 #define LUSERS_USERSGLOB 6
55 #define LUSERS_USERSMAX 7
62 #define TBL_USER TBL_PREFIX"user"
63 #define TBL_CHAN TBL_PREFIX"chan"
64 #define TBL_ISON TBL_PREFIX"ison"
65 #define TBL_SERV TBL_PREFIX"server"
66 #define TBL_MAXV TBL_PREFIX"maxvalues"