]> Pileus Git - ~andy/lamechat/blob - chat.h
XMPP MUC
[~andy/lamechat] / chat.h
1 /*
2  * Copyright (C) 2017 Andy Spencer <andy753421@gmail.com>
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
18 /* Message Types */
19 typedef unsigned long long stamp_t;
20
21 typedef struct {
22         stamp_t  when;
23         char    *channel;
24         char    *from;
25         char    *msg;
26 } log_t;
27
28 typedef struct {
29         char    *name;
30 } channel_t;
31
32 /* Global Data */
33 extern log_t *chat_log;
34 extern int    chat_len;
35
36 /* Chat functions */
37 void chat_init(void);
38 void chat_config(const char *group, const char *name, const char *key, const char *value);
39 void chat_notice(const char *channel, const char *from, const char *fmt, ...);
40 void chat_recv(const char *channel, const char *from, const char *msg);
41 void chat_send(const char *channel, const char *msg);
42 void chat_exit(void);
43
44 /* Protocol functions */
45 extern void irc_init(void);
46 extern void irc_config(const char *group, const char *name, const char *key, const char *value);
47 extern void irc_send(const char *channel, const char *msg);
48 extern void irc_exit(void);
49
50 extern void xmpp_init(void);
51 extern void xmpp_config(const char *group, const char *name, const char *key, const char *value);
52 extern void xmpp_send(const char *channel, const char *msg);
53 extern void xmpp_exit(void);