Sun, 16 Aug 2020 18:58:39 -0500
Fix some leaks.
Also, expand `g_ascii_dtostr` buffers to `G_ASCII_DTOSTR_BUF_SIZE`.
This is the size it's guaranteed to be under, so might as well have it be that size. It not too much bigger than the existing choice anyway.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/71/
|
39959
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
1 | /* |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
2 | * This program is free software; you can redistribute it and/or |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
3 | * modify it under the terms of the GNU General Public License as |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
4 | * published by the Free Software Foundation; either version 2 of the |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
5 | * License, or (at your option) any later version. |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
6 | * |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
7 | * This program is distributed in the hope that it will be useful, but |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
8 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
10 | * General Public License for more details. |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
11 | * |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
12 | * You should have received a copy of the GNU General Public License |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
13 | * along with this program; if not, write to the Free Software |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
15 | * 02111-1301, USA. |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
16 | */ |
|
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
17 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
39959
diff
changeset
|
18 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
39959
diff
changeset
|
19 | |
|
39959
e47fcffd061b
migrate the libpurple plugins to using purple.h only
Gary Kramlich <grim@reaperworld.com>
parents:
36742
diff
changeset
|
20 | #include <purple.h> |
| 90 | 21 | |
|
13690
bcb427c64568
[gaim-migrate @ 16091]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
22 | /** Plugin id : type-author-name (to guarantee uniqueness) */ |
|
bcb427c64568
[gaim-migrate @ 16091]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
23 | #define SIMPLE_PLUGIN_ID "core-ewarmenhoven-simple" |
|
bcb427c64568
[gaim-migrate @ 16091]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
24 | |
| 36742 | 25 | static PurplePluginInfo * |
| 26 | plugin_query(GError **error) | |
| 27 | { | |
| 28 | const gchar * const authors[] = { | |
| 29 | "Eric Warmenhoven <eric@warmenhoven.org>", | |
| 30 | NULL | |
| 31 | }; | |
| 32 | ||
| 33 | return purple_plugin_info_new( | |
| 34 | "id", SIMPLE_PLUGIN_ID, | |
| 35 | "name", N_("Simple Plugin"), | |
| 36 | "version", DISPLAY_VERSION, | |
| 37 | "category", N_("Testing"), | |
| 38 | "summary", N_("Tests to see that most things are working."), | |
| 39 | "description", N_("Tests to see that most things are working."), | |
| 40 | "authors", authors, | |
| 41 | "website", PURPLE_WEBSITE, | |
| 42 | "abi-version", PURPLE_ABI_VERSION, | |
| 43 | NULL | |
| 44 | ); | |
| 45 | } | |
| 46 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
47 | static gboolean |
| 36742 | 48 | plugin_load(PurplePlugin *plugin, GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
49 | { |
| 15884 | 50 | purple_debug(PURPLE_DEBUG_INFO, "simple", "simple plugin loaded.\n"); |
|
94
0c6ba3d3fa90
[gaim-migrate @ 104]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
92
diff
changeset
|
51 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
52 | return TRUE; |
| 90 | 53 | } |
| 54 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
55 | static gboolean |
| 36742 | 56 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
57 | { |
| 15884 | 58 | purple_debug(PURPLE_DEBUG_INFO, "simple", "simple plugin unloaded.\n"); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
59 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
3565
diff
changeset
|
60 | return TRUE; |
| 90 | 61 | } |
|
92
b2cc29da946e
[gaim-migrate @ 102]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
90
diff
changeset
|
62 | |
| 36742 | 63 | PURPLE_PLUGIN_INIT(simple, plugin_query, plugin_load, plugin_unload); |