libpurple/purpledebugui.h

Tue, 09 Apr 2024 21:50:31 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 09 Apr 2024 21:50:31 -0500
changeset 42656
df9aafbae930
parent 42614
b75a5bbf6c35
child 42680
905bc2694da8
permissions
-rw-r--r--

Add a doc-check unit test to libpurple and fix the issues it has found

Testing Done:
Ran ninja turtles

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

40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
12 * any later version.
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
17 * more details.
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42387
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PURPLE_DEBUG_UI_H
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PURPLE_DEBUG_UI_H
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
33 #include "purpleversion.h"
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
34
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 G_BEGIN_DECLS
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 #define PURPLE_TYPE_DEBUG_UI (purple_debug_ui_get_type())
41207
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
38
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
39 /**
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
40 * PurpleDebugUi:
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
41 *
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
42 * #PurpleDebugUiInterface defines the behavior that libpurple uses to
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
43 * interface the debug API with the user interface.
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
44 *
42614
b75a5bbf6c35 Remove the micro version from since tags for libpurple part 3
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
45 * Since: 3.0
41207
d91e963b0a1c Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[a-n]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 40950
diff changeset
46 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
47 PURPLE_AVAILABLE_IN_3_0
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 G_DECLARE_INTERFACE(PurpleDebugUi, purple_debug_ui, PURPLE, DEBUG_UI, GObject)
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 #include "debug.h"
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 /**
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42614
diff changeset
53 * PurpleDebugUi:
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * Debug UI operations.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 */
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 struct _PurpleDebugUiInterface {
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 /*< private >*/
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 GTypeInterface parent_iface;
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 /*< public >*/
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 void (*print)(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category, const gchar *arg_s);
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 gboolean (*is_enabled)(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category);
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 /*< private >*/
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 gpointer reserved[4];
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 };
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 /**
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * purple_debug_ui_is_enabled:
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * @ui: The #PurpleDebugUi instance.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * @level: The #PurpleDebugLevel.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * @category: An optional category.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * Checks if the ui should output messages at the given level and optional
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 * category.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * Typically this function will not need to be called outside of libpurple.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * Returns: %TRUE if the given level and category will be output by @ui, %FALSE
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * otherwise.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 *
42614
b75a5bbf6c35 Remove the micro version from since tags for libpurple part 3
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
83 * Since: 3.0
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
85 PURPLE_AVAILABLE_IN_3_0
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 gboolean purple_debug_ui_is_enabled(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category);
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 /**
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * purple_debug_ui_print:
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * @ui: The #PurpleDebugUi instance.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 * @level: The #PurpleDebugLevel.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * @category: An optional category.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * @arg_s: The debug string to output.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 *
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * Outputs @arg_s via @ui with the given @level and optional @category.
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 *
42614
b75a5bbf6c35 Remove the micro version from since tags for libpurple part 3
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
97 * Since: 3.0
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
99 PURPLE_AVAILABLE_IN_3_0
40950
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 void purple_debug_ui_print(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category, const gchar *arg_s);
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 G_END_DECLS
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 #endif /* PURPLE_DEBUG_UI_H */
c3fc77a3c015 Separate PurpleDebugUi out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105

mercurial