Mercurial > pidgin
comparison libpurple/eventloop.c @ 15822:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 562eaef05fe5 |
children | f2d8658b3a86 |
comparison
equal
deleted
inserted
replaced
15821:84b0f9b23ede | 15822:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file eventloop.c Gaim Event Loop API | 2 * @file eventloop.c Purple Event Loop API |
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * purple |
6 * | 6 * |
7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Purple is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
9 * source distribution. | 9 * source distribution. |
10 * | 10 * |
11 * This program is free software; you can redistribute it and/or modify | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | 12 * it under the terms of the GNU General Public License as published by |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 */ | 24 */ |
25 #include "eventloop.h" | 25 #include "eventloop.h" |
26 #include "internal.h" | 26 #include "internal.h" |
27 | 27 |
28 static GaimEventLoopUiOps *eventloop_ui_ops = NULL; | 28 static PurpleEventLoopUiOps *eventloop_ui_ops = NULL; |
29 | 29 |
30 guint | 30 guint |
31 gaim_timeout_add(guint interval, GSourceFunc function, gpointer data) | 31 purple_timeout_add(guint interval, GSourceFunc function, gpointer data) |
32 { | 32 { |
33 GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); | 33 PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops(); |
34 | 34 |
35 return ops->timeout_add(interval, function, data); | 35 return ops->timeout_add(interval, function, data); |
36 } | 36 } |
37 | 37 |
38 gboolean | 38 gboolean |
39 gaim_timeout_remove(guint tag) | 39 purple_timeout_remove(guint tag) |
40 { | 40 { |
41 GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); | 41 PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops(); |
42 | 42 |
43 return ops->timeout_remove(tag); | 43 return ops->timeout_remove(tag); |
44 } | 44 } |
45 | 45 |
46 guint | 46 guint |
47 gaim_input_add(int source, GaimInputCondition condition, GaimInputFunction func, gpointer user_data) | 47 purple_input_add(int source, PurpleInputCondition condition, PurpleInputFunction func, gpointer user_data) |
48 { | 48 { |
49 GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); | 49 PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops(); |
50 | 50 |
51 return ops->input_add(source, condition, func, user_data); | 51 return ops->input_add(source, condition, func, user_data); |
52 } | 52 } |
53 | 53 |
54 gboolean | 54 gboolean |
55 gaim_input_remove(guint tag) | 55 purple_input_remove(guint tag) |
56 { | 56 { |
57 GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); | 57 PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops(); |
58 | 58 |
59 return ops->input_remove(tag); | 59 return ops->input_remove(tag); |
60 } | 60 } |
61 | 61 |
62 int | 62 int |
63 gaim_input_get_error(int fd, int *error) | 63 purple_input_get_error(int fd, int *error) |
64 { | 64 { |
65 GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); | 65 PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops(); |
66 | 66 |
67 if (ops->input_get_error) | 67 if (ops->input_get_error) |
68 { | 68 { |
69 int ret = ops->input_get_error(fd, error); | 69 int ret = ops->input_get_error(fd, error); |
70 errno = *error; | 70 errno = *error; |
78 return getsockopt(fd, SOL_SOCKET, SO_ERROR, error, &len); | 78 return getsockopt(fd, SOL_SOCKET, SO_ERROR, error, &len); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 void | 82 void |
83 gaim_eventloop_set_ui_ops(GaimEventLoopUiOps *ops) | 83 purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops) |
84 { | 84 { |
85 eventloop_ui_ops = ops; | 85 eventloop_ui_ops = ops; |
86 } | 86 } |
87 | 87 |
88 GaimEventLoopUiOps * | 88 PurpleEventLoopUiOps * |
89 gaim_eventloop_get_ui_ops(void) | 89 purple_eventloop_get_ui_ops(void) |
90 { | 90 { |
91 g_return_val_if_fail(eventloop_ui_ops != NULL, NULL); | 91 g_return_val_if_fail(eventloop_ui_ops != NULL, NULL); |
92 | 92 |
93 return eventloop_ui_ops; | 93 return eventloop_ui_ops; |
94 } | 94 } |