]> git.xonotic.org Git - xonotic/darkplaces.git/blob - irc.h
Merge remote branch 'origin/master' into akari/irc
[xonotic/darkplaces.git] / irc.h
1 //      irc.h
2 //      
3 //      Copyright 2011 Akari <Akari` @ irc.quakenet.org>
4 //      
5 //      This program is free software; you can redistribute it and/or modify
6 //      it under the terms of the GNU General Public License as published by
7 //      the Free Software Foundation; either version 2 of the License, or
8 //      (at your option) any later version.
9 //      
10 //      This program is distributed in the hope that it will be useful,
11 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //      GNU General Public License for more details.
14
15 #include <libircclient/libircclient.h>
16
17 #ifndef IRCINCLUDED
18 #define IRCINCLUDED
19
20 static void CL_Irc_Connect_f(void);
21 static void CL_Irc_Disconnect_f(void);
22 static void CL_Irc_Say_Universal_f(void);
23 static void CL_Irc_Notice_f(void);
24 static void CL_Irc_Me_f(void);
25 static void CL_Irc_Say_f(void);
26 static void CL_Irc_Join_f(void);
27 static void CL_Irc_Part_f(void);
28 static void CL_Irc_Names_f(void);
29 static void CL_Irc_MessageMode_f(void);
30 static void CL_Irc_ChNick_f(void);
31 static void CL_Irc_Raw_f(void);
32 void CL_Irc_Init (void);
33 static void IRC_Thread(void *p);
34 void Irc_SetLastChannel(const char *value);
35 const char* Irc_GetLastChannel(void);
36 void Irc_SendMessage(const char *msg);
37 int irc_cmd_nick(irc_session_t * session, const char *nick);
38 qboolean Irc_CheckHilight(const char* msg);
39 qboolean Irc_IsWatchedChannel(const char* chan);
40
41 #define IRCEVENT(funcname) void funcname(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count)
42 #define IRCNUMEVENT(funcname) void funcname (irc_session_t *session, unsigned int event, const char *origin, const char **params, unsigned int count)
43 IRCEVENT(event_connect);
44 IRCNUMEVENT(event_numeric);
45 IRCEVENT(event_privmsg);
46 IRCEVENT(event_channel);
47 IRCEVENT(event_nick);
48 IRCEVENT(event_quit);
49 IRCEVENT(event_join);
50 IRCEVENT(event_part);
51 IRCEVENT(event_mode);
52 IRCEVENT(event_umode);
53 IRCEVENT(event_topic);
54 IRCEVENT(event_kick);
55 IRCEVENT(event_notice);
56 IRCEVENT(event_invite);
57 IRCEVENT(event_ctcp_action);
58 IRCEVENT(event_ctcp_action_priv);
59
60 #define MSGMODE_PRIVMSG 0
61 #define MSGMODE_NOTICE  1
62 #define MSGMODE_ACTION  2
63
64 #define ISCHANNEL(c) (c[0] == '#' || c[0] == '&')
65 #define CHATWINDOW (irc_chatwindow.integer == 1? "\001" : "")
66 #define CHATWINDOW_URGENT (irc_chatwindow.integer? "\001" : "")
67 #define MUSTCONNECT if(irc_connected.integer != 2) { Con_Printf("Not connected to an IRC server\n"); return; }
68 #define UPDATETARGET(c) if(irc_autochangetarget.integer) Irc_SetLastChannel(c);
69 #define NOTSET(cvar) (!strlen((cvar).string))
70
71 extern char *strcasestr (__const char*, __const char*);
72
73 #endif