Mercurial > pidgin.yaz
annotate libpurple/eventloop.h @ 27109:fdc0035bea5a
Change the way we parse messages on MySpace a little bit. This
fixes #8846: people using web myspaceIM can't respond to pidgin myspaceIM
For some reason IMs send using the myspace web site are sent so that
they won't become offline messages if the other person is offline.
I'm not really sure why that decision was made.
So now we treat messages with bm 1 the same as messages with bm 121. This means
we have to combine the function that parses out typing notification with
the function that parses IMs. And we check for typing notifications by
looking for %typing%. Which means if someone sends the IM "%typing%" with
no markup then we'll interpret it as a typing notification. And there's
nothing we can do to differentiate between the two. I asked.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 04 Jun 2009 05:19:49 +0000 |
parents | 584063555949 |
children | 02a2e8183b1d |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
15823 | 2 * @file eventloop.h Purple Event Loop API |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * @ingroup core |
20074
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
4 */ |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
5 |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19680
diff
changeset
|
6 /* purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15823 | 8 * Purple is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18013
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 */ |
15823 | 26 #ifndef _PURPLE_EVENTLOOP_H_ |
27 #define _PURPLE_EVENTLOOP_H_ | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include <glib.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 extern "C" { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 * An input condition. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 typedef enum |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 { |
15823 | 40 PURPLE_INPUT_READ = 1 << 0, /**< A read condition. */ |
41 PURPLE_INPUT_WRITE = 1 << 1 /**< A write condition. */ | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 |
15823 | 43 } PurpleInputCondition; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
45 /** The type of callbacks to handle events on file descriptors, as passed to |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
46 * purple_input_add(). The callback will receive the @c user_data passed to |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
47 * purple_input_add(), the file descriptor on which the event occurred, and the |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
48 * condition that was satisfied to cause the callback to be invoked. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
49 */ |
15823 | 50 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
52 /** @copydoc _PurpleEventLoopUiOps */ |
15823 | 53 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
55 /** An abstraction of an application's mainloop; libpurple will use this to |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
56 * watch file descriptors and schedule timed callbacks. If your application |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
57 * uses the glib mainloop, there is an implementation of this struct in |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
58 * <tt>libpurple/example/nullclient.c</tt> which you can use verbatim. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
59 */ |
15823 | 60 struct _PurpleEventLoopUiOps |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
63 * Should create a callback timer with an interval measured in |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
64 * milliseconds. The supplied @a function should be called every @a |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
65 * interval seconds until it returns @c FALSE, after which it should not |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
66 * be called again. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
67 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
68 * Analogous to g_timeout_add in glib. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
69 * |
23781
dc3c31b78fdb
Add a note about the timeout_add uiop being used to synchronize threads on win32.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22870
diff
changeset
|
70 * Note: On Win32, this function may be called from a thread other than |
dc3c31b78fdb
Add a note about the timeout_add uiop being used to synchronize threads on win32.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22870
diff
changeset
|
71 * the libpurple thread. You should make sure to detect this situation |
dc3c31b78fdb
Add a note about the timeout_add uiop being used to synchronize threads on win32.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22870
diff
changeset
|
72 * and to only call "function" from the libpurple thread. |
dc3c31b78fdb
Add a note about the timeout_add uiop being used to synchronize threads on win32.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22870
diff
changeset
|
73 * |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
74 * @param interval the interval in <em>milliseconds</em> between calls |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
75 * to @a function. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
76 * @param data arbitrary data to be passed to @a function at each |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
77 * call. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
78 * @todo Who is responsible for freeing @a data? |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
79 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
80 * @return a handle for the timeout, which can be passed to |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
81 * #timeout_remove. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
82 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
83 * @see purple_timeout_add |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 **/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
88 * Should remove a callback timer. Analogous to g_source_remove in glib. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
89 * @param handle an identifier for a timeout, as returned by |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
90 * #timeout_add. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
91 * @return @c TRUE if the timeout identified by @a handle was |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
92 * found and removed. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
93 * @see purple_timeout_remove |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 */ |
15668
d44fca5248a1
Change out source_remove and input_remove eventloop functions to return
Mark Doliner <mark@kingant.net>
parents:
15374
diff
changeset
|
95 gboolean (*timeout_remove)(guint handle); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
98 * Should add an input handler. Analogous to g_io_add_watch_full in |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
99 * glib. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
100 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
101 * @param fd a file descriptor to watch for events |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
102 * @param cond a bitwise OR of events on @a fd for which @a func |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
103 * should be called. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
104 * @param func a callback to fire whenever a relevant event on @a |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
105 * fd occurs. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
106 * @param user_data arbitrary data to pass to @a fd. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
107 * @return an identifier for this input handler, which can be |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
108 * passed to #input_remove. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
109 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
110 * @see purple_input_add |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 */ |
15823 | 112 guint (*input_add)(int fd, PurpleInputCondition cond, |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
113 PurpleInputFunction func, gpointer user_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
116 * Should remove an input handler. Analogous to g_source_remove in glib. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
117 * @param handle an identifier, as returned by #input_add. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
118 * @return @c TRUE if the input handler was found and removed. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
119 * @see purple_input_remove |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 */ |
15668
d44fca5248a1
Change out source_remove and input_remove eventloop functions to return
Mark Doliner <mark@kingant.net>
parents:
15374
diff
changeset
|
121 gboolean (*input_remove)(guint handle); |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23781
diff
changeset
|
122 |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23781
diff
changeset
|
123 |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
124 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
125 * If implemented, should get the current error status for an input. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
126 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
127 * Implementation of this UI op is optional. Implement it if the UI's |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
128 * sockets or event loop needs to customize determination of socket |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
129 * error status. If unimplemented, <tt>getsockopt(2)</tt> will be used |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
130 * instead. |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
131 * |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
132 * @see purple_input_get_error |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
133 */ |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
134 int (*input_get_error)(int fd, int *error); |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
135 |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
136 /** |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
137 * If implemented, should create a callback timer with an interval |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
138 * measured in seconds. Analogous to g_timeout_add_seconds in glib. |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
139 * |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
140 * This allows UIs to group timers for better power efficiency. For |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
141 * this reason, @a interval may be rounded by up to a second. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
142 * |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
143 * Implementation of this UI op is optional. If it's not implemented, |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
144 * calls to purple_timeout_add_seconds() will be serviced by |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
145 * #timeout_add. |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
146 * |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
147 * @see purple_timeout_add_seconds() |
22870
3d7e9eff04d0
Assorted cleanups, mostly to the Doxygen comments. I added a few missing
Richard Laager <rlaager@wiktel.com>
parents:
22380
diff
changeset
|
148 * @since 2.1.0 |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
149 **/ |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
150 guint (*timeout_add_seconds)(guint interval, GSourceFunc function, |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
151 gpointer data); |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
152 |
16672
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15936
diff
changeset
|
153 void (*_purple_reserved2)(void); |
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15936
diff
changeset
|
154 void (*_purple_reserved3)(void); |
516f14bef90e
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15936
diff
changeset
|
155 void (*_purple_reserved4)(void); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 /** @name Event Loop API */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 * Creates a callback timer. |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23781
diff
changeset
|
164 * |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 * The timer will repeat until the function returns @c FALSE. The |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 * first call will be at the end of the first interval. |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
167 * |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
168 * If the timer is in a multiple of seconds, use purple_timeout_add_seconds() |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
169 * instead as it allows UIs to group timers for power efficiency. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
170 * |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 * @param interval The time between calls of the function, in |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
172 * milliseconds. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
173 * @param function The function to call. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
174 * @param data data to pass to @a function. |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
175 * @return A handle to the timer which can be passed to |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
176 * purple_timeout_remove() to remove the timer. |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
177 */ |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
178 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data); |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
179 |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
180 /** |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
181 * Creates a callback timer. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
182 * |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
183 * The timer will repeat until the function returns @c FALSE. The |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
184 * first call will be at the end of the first interval. |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
185 * |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
186 * This function allows UIs to group timers for better power efficiency. For |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
187 * this reason, @a interval may be rounded by up to a second. |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23781
diff
changeset
|
188 * |
18008
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
189 * @param interval The time between calls of the function, in |
f22986db6e70
Wire everything up and document it.
Richard Laager <rlaager@wiktel.com>
parents:
18006
diff
changeset
|
190 * seconds. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 * @param function The function to call. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 * @param data data to pass to @a function. |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23781
diff
changeset
|
193 * @return A handle to the timer which can be passed to |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
194 * purple_timeout_remove() to remove the timer. |
20875
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20074
diff
changeset
|
195 * |
4511d15a8f80
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20074
diff
changeset
|
196 * @since 2.1.0 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 */ |
18013
58e82c3b697e
It's GLIB_CHECK_VERSION, not GLIB_VERSION_CHECK.
Richard Laager <rlaager@wiktel.com>
parents:
18008
diff
changeset
|
198 guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 * Removes a timeout handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 * |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
203 * @param handle The handle, as returned by purple_timeout_add(). |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 * |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
205 * @return @c TRUE if the handler was successfully removed. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 */ |
15823 | 207 gboolean purple_timeout_remove(guint handle); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 * Adds an input handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 * @param fd The input file descriptor. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 * @param cond The condition type. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 * @param func The callback function for data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 * @param user_data User-specified data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 * @return The resulting handle (will be greater than 0). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 * @see g_io_add_watch_full |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 */ |
15823 | 220 guint purple_input_add(int fd, PurpleInputCondition cond, |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
221 PurpleInputFunction func, gpointer user_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 * Removes an input handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 * @param handle The handle of the input handler. Note that this is the return |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
227 * value from purple_input_add(), <i>not</i> the file descriptor. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 */ |
15823 | 229 gboolean purple_input_remove(guint handle); |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
230 |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
231 /** |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
232 * Get the current error status for an input. |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
233 * |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
234 * The return value and error follow getsockopt() with a level of SOL_SOCKET and an |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
235 * option name of SO_ERROR, and this is how the error is determined if the UI does not |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
236 * implement the input_get_error UI op. |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
237 * |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
238 * @param fd The input file descriptor. |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
239 * @param error A pointer to an @c int which on return will have the error, or |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
240 * @c 0 if no error. |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
241 * |
22380
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
242 * @return @c 0 if there is no error; @c -1 if there is an error, in which case |
e3bf822c19c8
Document PurpleEventLoopUiOps and associated misc.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20875
diff
changeset
|
243 * @a errno will be set. |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
244 */ |
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
245 int |
15823 | 246 purple_input_get_error(int fd, int *error); |
15682
14d85ee22d78
Added a new GaimEventLoopUiOps item, input_get_error(). This function allows the UI to return the current error status on a socket/input. If the UI does not implement it (as Pidgin and gntgaim do not, since glib's handling of sockets is sane), it is just a wrapper around getsockopt(). Implemented or not, its return values should match those of getsockopt() with a level of SOL_SOCKET and an option of SO_ERROR. For curious souls, Adium will be using this to provide a working version of getsockopt(); the CoreFoundation CFSocket class which is used for socket read/write calls getsockopt() with SO_ERROR itself, thereby clearing the error flag [as documented in getsockopt()'s behavior], so depending upon it for determining if an error occurred leads to significant misbehavior.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15668
diff
changeset
|
247 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 /** @name UI Registration Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 * Sets the UI operations structure to be used for accounts. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 * @param ops The UI operations structure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 */ |
15823 | 261 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 * Returns the UI operations structure used for accounts. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 * @return The UI operations structure in use. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 */ |
15823 | 268 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 |
15823 | 276 #endif /* _PURPLE_EVENTLOOP_H_ */ |