libpurple/eventloop.h

Fri, 26 Mar 2021 01:33:03 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 26 Mar 2021 01:33:03 -0500
changeset 40827
ea25e596b1d4
parent 40474
1341be8e3402
child 41208
48baac6c8989
permissions
-rw-r--r--

Clean up some random gtk-doc warnings in libpurple's documentation

Testing Done:
Ran `ninja libpurple-doc` locally, verified the warnings went away.

Reviewed at https://reviews.imfreedom.org/r/585/

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
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
22 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
23 # error "only <purple.h> may be included directly"
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
24 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
25
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
26 #ifndef PURPLE_EVENTLOOP_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
27 #define PURPLE_EVENTLOOP_H
35440
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
28 /**
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
29 * SECTION:eventloop
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
30 * @section_id: libpurple-eventloop
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
31 * @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
32 * @title: Event Loop API
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
33 */
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35420
diff changeset
34
10023
6b0014040323 [gaim-migrate @ 10955]
Mark Doliner <markdoliner@pidgin.im>
parents: 10008
diff changeset
35 #include <glib.h>
35572
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
36 #include <glib-object.h>
5c4846317f2f Box the *UiOps structures
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
37
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
38 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
39 * PurpleInputCondition:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
40 * @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
41 * @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
42 *
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
43 * An input condition.
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
44 */
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
45 typedef enum
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 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
48 PURPLE_INPUT_WRITE = 1 << 1
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
49
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
50 } PurpleInputCondition;
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
51
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
52 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
53 * PurpleInputFunction:
40827
ea25e596b1d4 Clean up some random gtk-doc warnings in libpurple's documentation
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
54 * @data: User specified data.
ea25e596b1d4 Clean up some random gtk-doc warnings in libpurple's documentation
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
55 * @fd: The input file descriptor.
ea25e596b1d4 Clean up some random gtk-doc warnings in libpurple's documentation
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
56 * @cond: The condition type.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
57 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
58 * 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
59 * 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
60 * 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
61 * 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
62 */
38745
f4376b1f4682 A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 38434
diff changeset
63 typedef void (*PurpleInputFunction)(gpointer data, gint fd, PurpleInputCondition cond);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
64
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
65 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
66
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
67 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
68 /* Event Loop API */
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
69 /**************************************************************************/
35486
fe9a7f6143c1 Remove /*@{*/ and /*@}*/
Ankit Vani <a@nevitus.org>
parents: 35472
diff changeset
70
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
71 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 * purple_input_add:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
73 * @fd: The input file descriptor.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
74 * @cond: The condition type.
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35572
diff changeset
75 * @func: (scope call): The callback function for data.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
76 * @user_data: User-specified data.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
77 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
78 * Adds an input handler.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
79 *
35471
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
80 * See g_io_add_watch_full().
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
81 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
82 * Returns: The resulting handle (will be greater than 0).
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
83 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
84 guint purple_input_add(int fd, PurpleInputCondition cond,
22526
4223bc1ce147 Document PurpleEventLoopUiOps and associated misc.
Will Thompson <resiak@pidgin.im>
parents: 20940
diff changeset
85 PurpleInputFunction func, gpointer user_data);
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
86
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
87 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
88 * purple_input_remove:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
89 * @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
90 * 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
91 * file descriptor.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
92 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
93 * Removes an input handler.
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
94 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15756
diff changeset
95 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
96
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
97 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
98 * purple_input_pipe:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
99 * @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
100 *
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
101 * 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
102 * 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
103 *
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
104 * 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
105 * 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
106 * 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
107 *
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
108 * 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
109 * 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
110 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
111 * 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
112 */
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
113 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
114 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
115
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
116 G_END_DECLS
8273
7882af5843e9 [gaim-migrate @ 8997]
Scott Lamb
parents:
diff changeset
117
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
118 #endif /* PURPLE_EVENTLOOP_H */

mercurial