]> git.cworth.org Git - loudgame/blob - loudgame.h
a65f5dd6aa38fce3dc546bd3d3af0e6710edf355
[loudgame] / loudgame.h
1 /*
2  * Copyright (C) 2008 Carl Worth
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  * Author: Carl Worth <cworth@cworth.org>
18  */
19
20 #ifndef __LOUDGAME_H__
21 #define __LOUDGAME_H__
22
23 #include <loudmouth/loudmouth.h>
24
25 typedef struct _loudgame loudgame_t;
26
27 typedef void (*handle_message_cb) (loudgame_t   *lg,
28                                    const char   *peer,
29                                    const char   *message);
30
31 struct _loudgame {
32     gchar               *server;
33     gchar               *name;
34     gchar               *passwd;
35     LmConnection        *connection;
36     GMainLoop           *main_loop;
37     int                  return_value;
38
39     /* Callbacks */
40     handle_message_cb    handle_message;
41 };
42
43 int
44 loudgame_init (loudgame_t *lg, int argc, char **argv);
45
46 int
47 loudgame_run (loudgame_t *lg);
48
49 void
50 loudgame_send (loudgame_t       *lg,
51                const char       *peer,
52                const char       *message);
53
54 void
55 loudgame_quit (loudgame_t *lg, int return_value);
56
57 #endif /* __LOUDGAME_H__ */