X-Git-Url: https://git.cworth.org/git?p=loudgame;a=blobdiff_plain;f=loudgame.h;fp=loudgame.h;h=726394bf26b0ddb1f599b2710e74999c4388a9c0;hp=0000000000000000000000000000000000000000;hb=a812ce8bebf9c5a2408537626e1a8bb593fe9879;hpb=3a41fcf4e3673c9da15da1529336a11b636b9c79 diff --git a/loudgame.h b/loudgame.h new file mode 100644 index 0000000..726394b --- /dev/null +++ b/loudgame.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 Carl Worth + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ . + * + * Author: Carl Worth + */ + +#ifndef __LOUDGAME_H__ +#define __LOUDGAME_H__ + +#include + +typedef struct _loudgame loudgame_t; + +typedef void (*handle_message_cb) (loudgame_t *lg, + const char *peer, + const char *message); + +struct _loudgame { + gchar *server; + gchar *name; + gchar *passwd; + LmConnection *connection; + GMainLoop *main_loop; + int return_value; + + /* Callbacks */ + handle_message_cb handle_message; +}; + +int +loudgame_init (loudgame_t *lg, int argc, char **argv); + +int +loudgame_run (loudgame_t *lg); + +void +loudgame_quit (loudgame_t *lg, int return_value); + +#endif /* __LOUDGAME_H__ */