2 * Copyright (C) 2017 Andy Spencer <andy753421@gmail.com>
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.
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, see <http://www.gnu.org/licenses/>.
19 typedef unsigned long long stamp_t;
21 typedef struct server_t server_t;
22 typedef struct channel_t channel_t;
29 typedef struct server_t {
35 typedef struct channel_t {
51 extern server_t *servers;
52 extern channel_t *channels;
53 extern message_t *messages;
58 void chat_config(const char *group, const char *name,
59 const char *key, const char *value);
60 void chat_recv(channel_t *channel, const char *from, const char *text);
61 void chat_send(channel_t *channel, const char *text);
64 server_t *add_server(const char *name, protocol_t protocol);
65 channel_t *add_channel(const char *name, server_t *server);
66 server_t *find_server(const char *name);
67 channel_t *find_channel(const char *name);
69 /* Protocol functions */
70 extern void irc_init(void);
71 extern server_t *irc_server(void);
72 extern channel_t *irc_channel(void);
73 extern void irc_config(server_t *server, channel_t *channel,
74 const char *group, const char *name,
75 const char *key, const char *value);
76 extern void irc_send(channel_t *channel, const char *text);
77 extern void irc_exit(void);
79 extern void xmpp_init(void);
80 extern server_t *xmpp_server(void);
81 extern channel_t *xmpp_channel(void);
82 extern void xmpp_config(server_t *server, channel_t *channel,
83 const char *group, const char *name,
84 const char *key, const char *value);
85 extern void xmpp_send(channel_t *channel, const char *text);
86 extern void xmpp_exit(void);