libpurple/purpleoptions.c

Tue, 12 Dec 2023 03:51:53 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 12 Dec 2023 03:51:53 -0600
changeset 42548
04a97e6730d2
parent 42478
0f3a16f3ce7f
child 42594
eddde70cedd8
permissions
-rw-r--r--

Fix typos on Since tags

These tags are not sentences.

Testing Done:
Built docs.

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

40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
1 /*
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
2 * Purple - Internet Messaging Library
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
23 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
24
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
25 #include "purpleoptions.h"
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
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: 39024
diff changeset
27 #include "debug.h"
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
28 #include "network.h"
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: 39024
diff changeset
29 #include "util.h"
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
30
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 /******************************************************************************
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 * Callbacks
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 *****************************************************************************/
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 static gboolean
41960
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41127
diff changeset
35 purple_options_force_online_cb(G_GNUC_UNUSED const char *option_name,
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41127
diff changeset
36 G_GNUC_UNUSED const char *value,
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41127
diff changeset
37 G_GNUC_UNUSED gpointer data,
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41127
diff changeset
38 G_GNUC_UNUSED GError **error)
38803
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
39 {
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
40 purple_network_force_online();
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
41
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
42 return TRUE;
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
43 }
60c745a9e06d Move the force online option into the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents: 38802
diff changeset
44
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 /******************************************************************************
40727
9389ba16cf40 Rename options.[ch] to purpleoptions.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
46 * Public API
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 *****************************************************************************/
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 GOptionGroup *
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 purple_get_option_group(void) {
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 GOptionGroup *group = NULL;
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 GOptionEntry entries[] = {
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 {
42478
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
53 .long_name = "force-online",
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
54 .short_name = 'f',
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
55 .flags = G_OPTION_FLAG_NO_ARG,
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
56 .arg = G_OPTION_ARG_CALLBACK,
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
57 .arg_data = &purple_options_force_online_cb,
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
58 .description = _("force online, regardless of network status"),
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 },
42478
0f3a16f3ce7f Fix warnings from clang
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41960
diff changeset
60 G_OPTION_ENTRY_NULL,
38802
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 };
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 group = g_option_group_new(
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 "libpurple",
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 _("LibPurple options"),
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 _("Show LibPurple Options"),
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 NULL,
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 NULL
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 );
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 g_option_group_add_entries(group, entries);
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 return group;
afb1c8302e49 The start of the libpurple option group
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 }

mercurial