libpurple/eventloop.h

Fri, 07 Feb 2014 21:45:54 +0530

author
Ankit Vani <a@nevitus.org>
date
Fri, 07 Feb 2014 21:45:54 +0530
branch
gtkdoc-conversion
changeset 35487
494f09f7f331
parent 35486
fe9a7f6143c1
child 35572
5c4846317f2f
child 37094
84873ce721dc
permissions
-rw-r--r--

Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* purple
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
2 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
5 * source distribution.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
6 *
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
10 * (at your option) any later version.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
11 *
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
15 * GNU General Public License for more details.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
16 *
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18075
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
20 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
21
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
22 #ifndef _PURPLE_EVENTLOOP_H_
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
23 #define _PURPLE_EVENTLOOP_H_
35440
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
24 /**
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
25 * SECTION:eventloop
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
26 * @section_id: libpurple-eventloop
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
27 * @short_description: <filename>eventloop.h</filename>
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
28 * @title: Event Loop API
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
29 */
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
30
10023
6b0014040323 [gaim-migrate @ 10955]
Mark Doliner <markdoliner@pidgin.im>
parents: 10008
diff changeset
31 #include <glib.h>
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
32
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
33 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
34 * PurpleInputCondition:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
35 * @PURPLE_INPUT_READ: A read condition.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
36 * @PURPLE_INPUT_WRITE: A write condition.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
37 *
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
38 * An input condition.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
39 */
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
40 typedef enum
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
41 {
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
42 PURPLE_INPUT_READ = 1 << 0,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
43 PURPLE_INPUT_WRITE = 1 << 1
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
44
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
45 } PurpleInputCondition;
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
46
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
47 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
48 * PurpleInputFunction:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
49 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
50 * The type of callbacks to handle events on file descriptors, as passed to
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
51 * purple_input_add(). The callback will receive the @user_data passed to
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
52 * purple_input_add(), the file descriptor on which the event occurred, and the
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
53 * condition that was satisfied to cause the callback to be invoked.
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
54 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
55 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
56
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
57 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
58
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
59 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
60 * PurpleEventLoopUiOps:
35462
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
61 * @timeout_add: Should create a callback timer with an interval measured in
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
62 * milliseconds. The supplied @function should be called every
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
63 * @interval seconds until it returns %FALSE, after which it
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
64 * should not be called again.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
65 * <sbr/>Analogous to g_timeout_add in glib.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
66 * <sbr/>Note: On Win32, this function may be called from a thread
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
67 * other than the libpurple thread. You should make sure to detect
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
68 * this situation and to only call "function" from the libpurple
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
69 * thread.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
70 * <sbr/>See purple_timeout_add().
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
71 * <sbr/>@interval: the interval in
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
72 * <emphasis>milliseconds</emphasis> between
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
73 * calls to @function.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
74 * <sbr/>@data: arbitrary data to be passed to @function at each
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
75 * call.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
76 * <sbr/>Returns: a handle for the timeout, which can be passed to
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
77 * @timeout_remove.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
78 * @timeout_remove: Should remove a callback timer. Analogous to
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
79 * g_source_remove() in glib.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
80 * <sbr/>See purple_timeout_remove().
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
81 * <sbr/>@handle: an identifier for a timeout, as returned by
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
82 * @timeout_add.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
83 * <sbr/>Returns: %TRUE if the timeout identified by @handle
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
84 * was found and removed.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
85 * @input_add: Should add an input handler. Analogous to g_io_add_watch_full()
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
86 * in glib.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
87 * <sbr/>See purple_input_add().
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
88 * <sbr/>@fd: a file descriptor to watch for events
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
89 * <sbr/>@cond: a bitwise OR of events on @fd for which @func
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
90 * should be called.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
91 * <sbr/>@func: a callback to fire whenever a relevant event on
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
92 * @fd occurs.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
93 * <sbr/>@user_data: arbitrary data to pass to @fd.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
94 * <sbr/>Returns: an identifier for this input handler, which can
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
95 * be passed to @input_remove.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
96 * @input_remove: Should remove an input handler. Analogous to g_source_remove()
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
97 * in glib.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
98 * <sbr/>See purple_input_remove().
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
99 * <sbr/>@handle: an identifier, as returned by #input_add.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
100 * <sbr/>Returns: %TRUE if the input handler was found and
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
101 * removed.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
102 * @input_get_error: If implemented, should get the current error status for an
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
103 * input.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
104 * <sbr/>Implementation of this UI op is optional. Implement
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
105 * it if the UI's sockets or event loop needs to customize
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
106 * determination of socket error status. If unimplemented,
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
107 * <literal>getsockopt(2)</literal> will be used instead.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
108 * <sbr/>See purple_input_get_error().
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
109 * @timeout_add_seconds: If implemented, should create a callback timer with an
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
110 * interval measured in seconds. Analogous to
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
111 * g_timeout_add_seconds() in glib.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
112 * <sbr/>This allows UIs to group timers for better power
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
113 * efficiency. For this reason, @interval may be rounded
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
114 * by up to a second.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
115 * <sbr/>Implementation of this UI op is optional. If it's
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
116 * not implemented, calls to purple_timeout_add_seconds()
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
117 * will be serviced by @timeout_add.
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
118 * <sbr/>See purple_timeout_add_seconds().
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
119 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
120 * An abstraction of an application's mainloop; libpurple will use this to
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
121 * watch file descriptors and schedule timed callbacks. If your application
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
122 * uses the glib mainloop, there is an implementation of this struct in
35462
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
123 * <filename>libpurple/example/nullclient.c</filename> which you can use
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
124 * verbatim.
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
125 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
126 struct _PurpleEventLoopUiOps
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
127 {
35462
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
128 /* TODO Who is responsible for freeing @data? */
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
129 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
130
15729
6932ac4e5b3d Change out source_remove and input_remove eventloop functions to return
Mark Doliner <markdoliner@pidgin.im>
parents: 15435
diff changeset
131 gboolean (*timeout_remove)(guint handle);
8287
266eacc707ac [gaim-migrate @ 9011]
Scott Lamb
parents: 8280
diff changeset
132
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
133 guint (*input_add)(int fd, PurpleInputCondition cond,
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
134 PurpleInputFunction func, gpointer user_data);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
135
15729
6932ac4e5b3d Change out source_remove and input_remove eventloop functions to return
Mark Doliner <markdoliner@pidgin.im>
parents: 15435
diff changeset
136 gboolean (*input_remove)(guint handle);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 24050
diff changeset
137
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
138 int (*input_get_error)(int fd, int *error);
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
139
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
140 guint (*timeout_add_seconds)(guint interval, GSourceFunc function,
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
141 gpointer data);
18070
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
142
35024
eb3afb7643ce Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents: 33291
diff changeset
143 /*< private >*/
eb3afb7643ce Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents: 33291
diff changeset
144 void (*_purple_reserved1)(void);
16743
1ce5ffe12e2a Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents: 15997
diff changeset
145 void (*_purple_reserved2)(void);
1ce5ffe12e2a Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents: 15997
diff changeset
146 void (*_purple_reserved3)(void);
1ce5ffe12e2a Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents: 15997
diff changeset
147 void (*_purple_reserved4)(void);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
148 };
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
149
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
150 G_BEGIN_DECLS
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
151
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
152 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
153 /* Event Loop API */
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
154 /**************************************************************************/
35486
fe9a7f6143c1 Remove /*@{*/ and /*@}*/
Ankit Vani <a@nevitus.org>
parents: 35472
diff changeset
155
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
156 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
157 * purple_timeout_add:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
158 * @interval: The time between calls of the function, in
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
159 * milliseconds.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
160 * @function: The function to call.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
161 * @data: data to pass to @function.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
162 *
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
163 * Creates a callback timer.
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 24050
diff changeset
164 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
165 * The timer will repeat until the function returns %FALSE. The
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
166 * first call will be at the end of the first interval.
18070
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
167 *
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
168 * If the timer is in a multiple of seconds, use purple_timeout_add_seconds()
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
169 * instead as it allows UIs to group timers for power efficiency.
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
170 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
171 * Returns: A handle to the timer which can be passed to
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
172 * purple_timeout_remove() to remove the timer.
18070
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
173 */
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
174 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
175
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
176 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
177 * purple_timeout_add_seconds:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
178 * @interval: The time between calls of the function, in
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
179 * seconds.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
180 * @function: The function to call.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
181 * @data: data to pass to @function.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
182 *
18070
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
183 * Creates a callback timer.
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
184 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
185 * The timer will repeat until the function returns %FALSE. The
18070
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
186 * first call will be at the end of the first interval.
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
187 *
79c7fe0d8e4b Wire everything up and document it.
Richard Laager <rlaager@pidgin.im>
parents: 18068
diff changeset
188 * This function allows UIs to group timers for better power efficiency. For
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
189 * this reason, @interval may be rounded by up to a second.
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 24050
diff changeset
190 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
191 * Returns: A handle to the timer which can be passed to
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
192 * purple_timeout_remove() to remove the timer.
10071
d2ba11541693 [gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents: 10023
diff changeset
193 */
18075
1e4bb0043a98 It's GLIB_CHECK_VERSION, not GLIB_VERSION_CHECK.
Richard Laager <rlaager@pidgin.im>
parents: 18070
diff changeset
194 guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
195
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
196 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
197 * purple_timeout_remove:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
198 * @handle: The handle, as returned by purple_timeout_add().
8287
266eacc707ac [gaim-migrate @ 9011]
Scott Lamb
parents: 8280
diff changeset
199 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
200 * Removes a timeout handler.
8387
381fc8b4f8f7 [gaim-migrate @ 9115]
Christian Hammond <chipx86@chipx86.com>
parents: 8287
diff changeset
201 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
202 * Returns: %TRUE if the handler was successfully removed.
8287
266eacc707ac [gaim-migrate @ 9011]
Scott Lamb
parents: 8280
diff changeset
203 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
204 gboolean purple_timeout_remove(guint handle);
8287
266eacc707ac [gaim-migrate @ 9011]
Scott Lamb
parents: 8280
diff changeset
205
266eacc707ac [gaim-migrate @ 9011]
Scott Lamb
parents: 8280
diff changeset
206 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
207 * purple_input_add:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
208 * @fd: The input file descriptor.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
209 * @cond: The condition type.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
210 * @func: The callback function for data.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
211 * @user_data: User-specified data.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
212 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
213 * Adds an input handler.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
214 *
35471
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
215 * See g_io_add_watch_full().
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
216 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
217 * Returns: The resulting handle (will be greater than 0).
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
218 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
219 guint purple_input_add(int fd, PurpleInputCondition cond,
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
220 PurpleInputFunction func, gpointer user_data);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
221
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
222 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
223 * purple_input_remove:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
224 * @handle: The handle of the input handler. Note that this is the return
35468
65e7b4566de4 Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents: 35467
diff changeset
225 * value from purple_input_add(), <emphasis>not</emphasis> the
65e7b4566de4 Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents: 35467
diff changeset
226 * file descriptor.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
227 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
228 * Removes an input handler.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
229 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
230 gboolean purple_input_remove(guint handle);
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
231
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
232 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
233 * purple_input_get_error:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
234 * @fd: The input file descriptor.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
235 * @error: A pointer to an #int which on return will have the error, or
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
236 * 0 if no error.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
237 *
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
238 * Get the current error status for an input.
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
239 *
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
240 * The return value and error follow getsockopt() with a level of SOL_SOCKET and an
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
241 * option name of SO_ERROR, and this is how the error is determined if the UI does not
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
242 * implement the input_get_error UI op.
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
243 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
244 * Returns: 0 if there is no error; -1 if there is an error, in which case
35467
975ae62dd895 Fix cross-references and some other warnings
Ankit Vani <a@nevitus.org>
parents: 35462
diff changeset
245 * #errno will be set.
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
246 */
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
247 int
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
248 purple_input_get_error(int fd, int *error);
15746
017e33725857 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 <evands@pidgin.im>
parents: 15729
diff changeset
249
33291
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
250 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
251 * purple_input_pipe:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
252 * @pipefd: Array used to return file descriptors for both ends of pipe.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
253 *
33291
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
254 * Creates a pipe - an unidirectional data channel that can be used for
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
255 * interprocess communication.
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
256 *
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
257 * File descriptors for both ends of pipe will be written into provided array.
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
258 * The first one (pipefd[0]) can be used for reading, the second one (pipefd[1])
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
259 * for writing.
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
260 *
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
261 * On Windows it's simulated by creating a pair of connected sockets, on other
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
262 * systems pipe() is used.
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
263 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
264 * Returns: 0 on success, -1 on error.
33291
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
265 */
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
266 int
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
267 purple_input_pipe(int pipefd[2]);
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32787
diff changeset
268
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
269
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
270
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
271 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
272 /* UI Registration Functions */
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
273 /**************************************************************************/
35486
fe9a7f6143c1 Remove /*@{*/ and /*@}*/
Ankit Vani <a@nevitus.org>
parents: 35472
diff changeset
274
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
275 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
276 * purple_eventloop_set_ui_ops:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
277 * @ops: The UI operations structure.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
278 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
279 * Sets the UI operations structure to be used for accounts.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
280 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
281 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
282
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
283 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
284 * purple_eventloop_get_ui_ops:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
285 *
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
286 * Returns the UI operations structure used for accounts.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
287 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
288 * Returns: The UI operations structure in use.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
289 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
290 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
291
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
292 G_END_DECLS
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
293
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
294 #endif /* _PURPLE_EVENTLOOP_H_ */

mercurial