source: lib/events.h @ 04026d4

Last change on this file since 04026d4 was df1694b, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-06-25T12:15:42Z

Moving all generic files to lib/ instead of having some in / and some in
protocols/, and adding RC4 code.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 * nogaim
3 *
4 * Copyright (C) 2006 Wilmer van der Gaast and others
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 *
20 */
21
22/*
23 * Split off the event handling things from proxy.[ch] (and adding timer
24 * stuff. This to allow BitlBee to use other libs than GLib for event
25 * handling.
26 */
27
28
29#ifndef _EVENTS_H_
30#define _EVENTS_H_
31
32#include <sys/types.h>
33#ifndef _WIN32
34#include <sys/socket.h>
35#include <netdb.h>
36#include <netinet/in.h>
37#endif
38#include <glib.h>
39#include <gmodule.h>
40
41typedef enum {
42        GAIM_INPUT_READ = 1 << 1,
43        GAIM_INPUT_WRITE = 1 << 2
44} b_input_condition;
45typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond);
46
47#define GAIM_READ_COND  (G_IO_IN | G_IO_HUP | G_IO_ERR)
48#define GAIM_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
49#define GAIM_ERR_COND   (G_IO_HUP | G_IO_ERR | G_IO_NVAL)
50
51// #define event_debug( x... ) printf( x )
52#define event_debug( x... )
53
54G_MODULE_EXPORT void b_main_init();
55G_MODULE_EXPORT void b_main_run();
56G_MODULE_EXPORT void b_main_quit();
57
58G_MODULE_EXPORT gint b_input_add(int fd, b_input_condition cond, b_event_handler func, gpointer data);
59G_MODULE_EXPORT gint b_timeout_add(gint timeout, b_event_handler func, gpointer data);
60G_MODULE_EXPORT void b_event_remove(gint id);
61
62#ifdef EVENTS_LIBEVENT
63G_MODULE_EXPORT void closesocket(int fd);
64#endif
65
66#endif /* _EVENTS_H_ */
Note: See TracBrowser for help on using the repository browser.