comparison libpurple/eventloop.h @ 15822:32c366eeeb99

sed -ie 's/gaim/purple/g'
author Sean Egan <seanegan@gmail.com>
date Mon, 19 Mar 2007 07:01:17 +0000
parents c463709294f8
children b449dc6b8a20
comparison
equal deleted inserted replaced
15821:84b0f9b23ede 15822:32c366eeeb99
1 /** 1 /**
2 * @file eventloop.h Gaim Event Loop API 2 * @file eventloop.h 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
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
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 #ifndef _GAIM_EVENTLOOP_H_ 25 #ifndef _PURPLE_EVENTLOOP_H_
26 #define _GAIM_EVENTLOOP_H_ 26 #define _PURPLE_EVENTLOOP_H_
27 27
28 #include <glib.h> 28 #include <glib.h>
29 29
30 #ifdef __cplusplus 30 #ifdef __cplusplus
31 extern "C" { 31 extern "C" {
34 /** 34 /**
35 * An input condition. 35 * An input condition.
36 */ 36 */
37 typedef enum 37 typedef enum
38 { 38 {
39 GAIM_INPUT_READ = 1 << 0, /**< A read condition. */ 39 PURPLE_INPUT_READ = 1 << 0, /**< A read condition. */
40 GAIM_INPUT_WRITE = 1 << 1 /**< A write condition. */ 40 PURPLE_INPUT_WRITE = 1 << 1 /**< A write condition. */
41 41
42 } GaimInputCondition; 42 } PurpleInputCondition;
43 43
44 typedef void (*GaimInputFunction)(gpointer, gint, GaimInputCondition); 44 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
45 45
46 typedef struct _GaimEventLoopUiOps GaimEventLoopUiOps; 46 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
47 47
48 struct _GaimEventLoopUiOps 48 struct _PurpleEventLoopUiOps
49 { 49 {
50 /** 50 /**
51 * Creates a callback timer. 51 * Creates a callback timer.
52 * @see g_timeout_add, gaim_timeout_add 52 * @see g_timeout_add, purple_timeout_add
53 **/ 53 **/
54 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data); 54 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
55 55
56 /** 56 /**
57 * Removes a callback timer. 57 * Removes a callback timer.
58 * @see gaim_timeout_remove, g_source_remove 58 * @see purple_timeout_remove, g_source_remove
59 */ 59 */
60 gboolean (*timeout_remove)(guint handle); 60 gboolean (*timeout_remove)(guint handle);
61 61
62 /** 62 /**
63 * Adds an input handler. 63 * Adds an input handler.
64 * @see gaim_input_add, g_io_add_watch_full 64 * @see purple_input_add, g_io_add_watch_full
65 */ 65 */
66 guint (*input_add)(int fd, GaimInputCondition cond, 66 guint (*input_add)(int fd, PurpleInputCondition cond,
67 GaimInputFunction func, gpointer user_data); 67 PurpleInputFunction func, gpointer user_data);
68 68
69 /** 69 /**
70 * Removes an input handler. 70 * Removes an input handler.
71 * @see gaim_input_remove, g_source_remove 71 * @see purple_input_remove, g_source_remove
72 */ 72 */
73 gboolean (*input_remove)(guint handle); 73 gboolean (*input_remove)(guint handle);
74 74
75 75
76 /** 76 /**
77 * Get the current error status for an input. 77 * Get the current error status for an input.
78 * Implementation of this UI op is optional. Implement it if the UI's sockets 78 * Implementation of this UI op is optional. Implement it if the UI's sockets
79 * or event loop needs to customize determination of socket error status. 79 * or event loop needs to customize determination of socket error status.
80 * @see gaim_input_get_error, getsockopt 80 * @see purple_input_get_error, getsockopt
81 */ 81 */
82 int (*input_get_error)(int fd, int *error); 82 int (*input_get_error)(int fd, int *error);
83 83
84 }; 84 };
85 85
94 * @param interval The time between calls of the function, in 94 * @param interval The time between calls of the function, in
95 * milliseconds. 95 * milliseconds.
96 * @param function The function to call. 96 * @param function The function to call.
97 * @param data data to pass to @a function. 97 * @param data data to pass to @a function.
98 * @return A handle to the timer which can be passed to 98 * @return A handle to the timer which can be passed to
99 * gaim_timeout_remove to remove the timer. 99 * purple_timeout_remove to remove the timer.
100 */ 100 */
101 guint gaim_timeout_add(guint interval, GSourceFunc function, gpointer data); 101 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
102 102
103 /** 103 /**
104 * Removes a timeout handler. 104 * Removes a timeout handler.
105 * 105 *
106 * @param handle The handle, as returned by gaim_timeout_add. 106 * @param handle The handle, as returned by purple_timeout_add.
107 * 107 *
108 * @return Something. 108 * @return Something.
109 */ 109 */
110 gboolean gaim_timeout_remove(guint handle); 110 gboolean purple_timeout_remove(guint handle);
111 111
112 /** 112 /**
113 * Adds an input handler. 113 * Adds an input handler.
114 * 114 *
115 * @param fd The input file descriptor. 115 * @param fd The input file descriptor.
118 * @param user_data User-specified data. 118 * @param user_data User-specified data.
119 * 119 *
120 * @return The resulting handle (will be greater than 0). 120 * @return The resulting handle (will be greater than 0).
121 * @see g_io_add_watch_full 121 * @see g_io_add_watch_full
122 */ 122 */
123 guint gaim_input_add(int fd, GaimInputCondition cond, 123 guint purple_input_add(int fd, PurpleInputCondition cond,
124 GaimInputFunction func, gpointer user_data); 124 PurpleInputFunction func, gpointer user_data);
125 125
126 /** 126 /**
127 * Removes an input handler. 127 * Removes an input handler.
128 * 128 *
129 * @param handle The handle of the input handler. Note that this is the return 129 * @param handle The handle of the input handler. Note that this is the return
130 * value from gaim_input_add, <i>not</i> the file descriptor. 130 * value from purple_input_add, <i>not</i> the file descriptor.
131 */ 131 */
132 gboolean gaim_input_remove(guint handle); 132 gboolean purple_input_remove(guint handle);
133 133
134 /** 134 /**
135 * Get the current error status for an input. 135 * Get the current error status for an input.
136 * The return value and error follow getsockopt() with a level of SOL_SOCKET and an 136 * The return value and error follow getsockopt() with a level of SOL_SOCKET and an
137 * option name of SO_ERROR, and this is how the error is determined if the UI does not 137 * option name of SO_ERROR, and this is how the error is determined if the UI does not
141 * @param errno A pointer to an int which on return will have the error, or 0 if no error. 141 * @param errno A pointer to an int which on return will have the error, or 0 if no error.
142 * 142 *
143 * @return 0 if there is no error; -1 if there is an error, in which case errno will be set. 143 * @return 0 if there is no error; -1 if there is an error, in which case errno will be set.
144 */ 144 */
145 int 145 int
146 gaim_input_get_error(int fd, int *error); 146 purple_input_get_error(int fd, int *error);
147 147
148 148
149 /*@}*/ 149 /*@}*/
150 150
151 151
156 /** 156 /**
157 * Sets the UI operations structure to be used for accounts. 157 * Sets the UI operations structure to be used for accounts.
158 * 158 *
159 * @param ops The UI operations structure. 159 * @param ops The UI operations structure.
160 */ 160 */
161 void gaim_eventloop_set_ui_ops(GaimEventLoopUiOps *ops); 161 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
162 162
163 /** 163 /**
164 * Returns the UI operations structure used for accounts. 164 * Returns the UI operations structure used for accounts.
165 * 165 *
166 * @return The UI operations structure in use. 166 * @return The UI operations structure in use.
167 */ 167 */
168 GaimEventLoopUiOps *gaim_eventloop_get_ui_ops(void); 168 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
169 169
170 /*@}*/ 170 /*@}*/
171 171
172 #ifdef __cplusplus 172 #ifdef __cplusplus
173 } 173 }
174 #endif 174 #endif
175 175
176 #endif /* _GAIM_EVENTLOOP_H_ */ 176 #endif /* _PURPLE_EVENTLOOP_H_ */