Tue, 15 Oct 2024 00:47:42 -0500
Port prefs to AdwSwitchRow
Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).
This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.
Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.
Also used the mnemonics to toggle the switches from the keyboard.
Reviewed at https://reviews.imfreedom.org/r/3582/
|
40584
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40564
diff
changeset
|
1 | /* |
|
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40564
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40564
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| 4890 | 4 | * |
| 15884 | 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:
42557
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 8046 | 7 | * source distribution. |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
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:
42557
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:
42557
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:
42557
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:
42557
diff
changeset
|
12 | * any later version. |
| 4890 | 13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42557
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:
42557
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:
42557
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:
42557
diff
changeset
|
17 | * more details. |
| 4890 | 18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42557
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:
42557
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
| 4890 | 21 | */ |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
22 | |
|
40474
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
23 | #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:
40350
diff
changeset
|
24 | # 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:
40350
diff
changeset
|
25 | #endif |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
26 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39527
diff
changeset
|
27 | #ifndef PURPLE_UTIL_H |
|
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39527
diff
changeset
|
28 | #define PURPLE_UTIL_H |
| 4890 | 29 | |
|
6474
12d3fe5e5b1b
[gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
30 | #include <stdio.h> |
|
12d3fe5e5b1b
[gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
31 | |
|
42344
c51d37734155
Rename account.[ch] to purpleaccount.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
42307
diff
changeset
|
32 | #include "purpleaccount.h" |
|
41155
922c9e70900c
Rename protocol.[ch] to purpleprotocol.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
41083
diff
changeset
|
33 | #include "purpleprotocol.h" |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
34 | #include "purpleversion.h" |
|
42557
e868bfcc092a
Only include headers when they're necessary for header files
Gary Kramlich <grim@reaperworld.com>
parents:
42408
diff
changeset
|
35 | #include "xmlnode.h" |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
36 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32737
diff
changeset
|
37 | G_BEGIN_DECLS |
|
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32737
diff
changeset
|
38 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
39 | /**************************************************************************/ |
| 35472 | 40 | /* Utility Subsystem */ |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
41 | /**************************************************************************/ |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
42 | |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
43 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
44 | * purple_util_init: |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
45 | * |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
46 | * Initializes the utility subsystem. |
|
42398
00178e755de6
Export symbols and add Since tags for 2.3 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42394
diff
changeset
|
47 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
48 | * Since: 2.3 |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
49 | */ |
|
42398
00178e755de6
Export symbols and add Since tags for 2.3 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42394
diff
changeset
|
50 | PURPLE_AVAILABLE_IN_2_3 |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
51 | void purple_util_init(void); |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
52 | |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
53 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
54 | * purple_util_uninit: |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
55 | * |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
56 | * Uninitializes the util subsystem. |
|
42398
00178e755de6
Export symbols and add Since tags for 2.3 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42394
diff
changeset
|
57 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
58 | * Since: 2.3 |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
59 | */ |
|
42398
00178e755de6
Export symbols and add Since tags for 2.3 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42394
diff
changeset
|
60 | PURPLE_AVAILABLE_IN_2_3 |
|
21238
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
61 | void purple_util_uninit(void); |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
62 | |
|
cd326828c870
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents:
20226
diff
changeset
|
63 | /**************************************************************************/ |
| 35472 | 64 | /* Path/Filename Functions */ |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
65 | /**************************************************************************/ |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
66 | |
|
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
67 | /** |
|
38872
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
68 | * purple_util_write_data_to_config_file: |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
69 | * @filename: The basename of the file to write in the purple_config_dir. |
|
38891
f59bb8304c21
Fix some functions descriptions
qarkai <qarkai@gmail.com>
parents:
38890
diff
changeset
|
70 | * @data: A string of data to write. |
|
38872
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
71 | * @size: The size of the data to save. If data is |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
72 | * null-terminated you can pass in -1. |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
73 | * |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
74 | * Write a string of data to a file of the given name in the Purple |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
75 | * config directory ($HOME/.config/purple by default). |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
76 | * |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
77 | * See purple_util_write_data_to_file() |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
78 | * |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
79 | * Returns: TRUE if the file was written successfully. FALSE otherwise. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
80 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
81 | * Since: 3.0 |
|
38872
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
82 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
83 | PURPLE_AVAILABLE_IN_3_0 |
|
38874
0fc4ba7fa2be
Make XDG dir structure inside custom user dir
qarkai <qarkai@gmail.com>
parents:
38872
diff
changeset
|
84 | gboolean |
|
0fc4ba7fa2be
Make XDG dir structure inside custom user dir
qarkai <qarkai@gmail.com>
parents:
38872
diff
changeset
|
85 | purple_util_write_data_to_config_file(const char *filename, const char *data, gssize size); |
|
38872
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
86 | |
|
af422a3fb924
Add purple_util_write_data_to_*_file declarations
qarkai <qarkai@gmail.com>
parents:
38870
diff
changeset
|
87 | /** |
|
38877
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
88 | * purple_util_read_xml_from_config_file: |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
89 | * @filename: The basename of the file to open in the purple_config_dir. |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
90 | * @description: A very short description of the contents of this |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
91 | * file. This is used in error messages shown to the |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
92 | * user when the file can not be opened. For example, |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
93 | * "preferences," or "buddy pounces." |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
94 | * |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
95 | * Read the contents of a given file and parse the results into an |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
96 | * PurpleXmlNode tree structure. This is intended to be used to read |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
97 | * Purple's config xml files (prefs.xml, pounces.xml, etc.) |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
98 | * |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
99 | * Returns: An PurpleXmlNode tree of the contents of the given file. Or NULL, if |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
100 | * the file does not exist or there was an error reading the file. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
101 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
102 | * Since: 3.0 |
|
38877
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
103 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
104 | PURPLE_AVAILABLE_IN_3_0 |
|
38877
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
105 | PurpleXmlNode * |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
106 | purple_util_read_xml_from_config_file(const char *filename, const char *description); |
|
4e9c691a1d2d
Add functions for reading XML files from XDG dirs
qarkai <qarkai@gmail.com>
parents:
38874
diff
changeset
|
107 | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
108 | /**************************************************************************/ |
| 35472 | 109 | /* Environment Detection Functions */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
110 | /**************************************************************************/ |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22133
diff
changeset
|
111 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22133
diff
changeset
|
112 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
113 | * purple_running_gnome: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
114 | * |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
115 | * Check if running GNOME. |
| 11878 | 116 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
117 | * Returns: TRUE if running GNOME, FALSE otherwise. |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
118 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
119 | * Since: 2.0 |
| 11878 | 120 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
121 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 122 | gboolean purple_running_gnome(void); |
| 11878 | 123 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
124 | /**************************************************************************/ |
| 35472 | 125 | /* String Functions */ |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
126 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
127 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
128 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
129 | * purple_strequal: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
130 | * @left: A string |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
131 | * @right: A string to compare with left |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
132 | * |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
133 | * Tests two strings for equality. |
|
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
134 | * |
|
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
135 | * Unlike strcmp(), this function will not crash if one or both of the |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
136 | * strings are %NULL. |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
137 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
138 | * Returns: %TRUE if the strings are the same, else %FALSE. |
|
42394
b3bc5ad00646
Export symbols and add Since tags for 2.6 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42391
diff
changeset
|
139 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
140 | * Since: 2.6 |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
141 | */ |
|
42394
b3bc5ad00646
Export symbols and add Since tags for 2.6 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42391
diff
changeset
|
142 | PURPLE_AVAILABLE_STATIC_INLINE_IN_2_6 |
|
39323
a1bec7e58cba
libpurple: Change purple_strequal() to a static inline function
Mike Ruprecht <cmaiku@gmail.com>
parents:
39122
diff
changeset
|
143 | static inline gboolean |
|
a1bec7e58cba
libpurple: Change purple_strequal() to a static inline function
Mike Ruprecht <cmaiku@gmail.com>
parents:
39122
diff
changeset
|
144 | purple_strequal(const gchar *left, const gchar *right) |
|
a1bec7e58cba
libpurple: Change purple_strequal() to a static inline function
Mike Ruprecht <cmaiku@gmail.com>
parents:
39122
diff
changeset
|
145 | { |
|
a1bec7e58cba
libpurple: Change purple_strequal() to a static inline function
Mike Ruprecht <cmaiku@gmail.com>
parents:
39122
diff
changeset
|
146 | return (g_strcmp0(left, right) == 0); |
|
a1bec7e58cba
libpurple: Change purple_strequal() to a static inline function
Mike Ruprecht <cmaiku@gmail.com>
parents:
39122
diff
changeset
|
147 | } |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
148 | |
|
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24072
diff
changeset
|
149 | /** |
|
42007
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
150 | * purple_strempty: |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
151 | * @str: A string to check if it is empty. |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
152 | * |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
153 | * Determines if @str is empty. That is, if it is %NULL or an empty string. |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
154 | * |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
155 | * Returns: %TRUE if the @str is %NULL or an empty string. |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
156 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
157 | * Since: 3.0 |
|
42007
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
158 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
159 | PURPLE_AVAILABLE_STATIC_INLINE_IN_3_0 |
|
42007
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
160 | static inline gboolean |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
161 | purple_strempty(const char *str) { |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
162 | return (str == NULL || str[0] == '\0'); |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
163 | } |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
164 | |
|
b7f9345b02a4
Add a name-for-display property to PurpleContactInfo
Gary Kramlich <grim@reaperworld.com>
parents:
41882
diff
changeset
|
165 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
166 | * purple_str_strip_char: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
167 | * @str: The string to strip characters from. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
168 | * @thechar: The character to strip from the given string. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
169 | * |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
170 | * Strips all instances of the given character from the |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
171 | * given string. The string is modified in place. This |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
172 | * is useful for stripping new line characters, for example. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
173 | * |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
174 | * Example usage: |
| 15884 | 175 | * purple_str_strip_char(my_dumb_string, '\n'); |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
176 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
177 | * Since: 2.0 |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
178 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
179 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 180 | void purple_str_strip_char(char *str, char thechar); |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
181 | |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
182 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
183 | * purple_strreplace: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
184 | * @string: The string from which to replace stuff. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
185 | * @delimiter: The substring you want replaced. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
186 | * @replacement: The substring you want inserted in place |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
187 | * of the delimiting substring. |
|
8461
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
188 | * |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
189 | * Given a string, this replaces one substring with another |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
190 | * and returns a newly allocated string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
191 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
192 | * Returns: A new string, after performing the substitution. |
|
8461
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
193 | * free this with g_free(). |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
194 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
195 | * Since: 2.0 |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
196 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
197 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 198 | gchar *purple_strreplace(const char *string, const char *delimiter, |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
199 | const char *replacement); |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
200 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
201 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
202 | * purple_str_wipe: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
203 | * @str: A NUL-terminated string to free, or a NULL-pointer. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
204 | * |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33773
diff
changeset
|
205 | * Fills a NUL-terminated string with zeros and frees it. |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33773
diff
changeset
|
206 | * |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33773
diff
changeset
|
207 | * It should be used to free sensitive data, like passwords. |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
208 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
209 | * Since: 3.0 |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33773
diff
changeset
|
210 | */ |
|
42391
090b03385984
Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42387
diff
changeset
|
211 | PURPLE_AVAILABLE_IN_3_0 |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33773
diff
changeset
|
212 | void purple_str_wipe(gchar *str); |
|
34171
a23f3228c465
New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
213 | |
|
42060
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
214 | /** |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
215 | * purple_strmatches: |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
216 | * @pattern: The pattern to search for. |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
217 | * @str: The string to check. |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
218 | * |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
219 | * Checks if @pattern occurs in sequential order in @str in a caseless fashion, |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
220 | * ignoring characters in between. |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
221 | * |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
222 | * For example, if @pattern was `Pg` and @str was `Pidgin`, this will return |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
223 | * %TRUE. |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
224 | * |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
225 | * Returns: %TRUE if @pattern occurs in sequential order in @str, %FALSE |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
226 | * otherwise. |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
227 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
228 | * Since: 3.0 |
|
42060
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
229 | */ |
|
42387
d9350cda1556
Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42344
diff
changeset
|
230 | PURPLE_AVAILABLE_IN_3_0 |
|
42060
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
231 | gboolean purple_strmatches(const char *pattern, const char *str); |
|
d55b605fdafb
Add purple_strmatches and move purple_person_matches and purple_contact_info_matches to it
Gary Kramlich <grim@reaperworld.com>
parents:
42007
diff
changeset
|
232 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
233 | /**************************************************************************/ |
| 35472 | 234 | /* URI/URL Functions */ |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
235 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
236 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42618
diff
changeset
|
237 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
238 | * purple_email_is_valid: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
239 | * @address: The email address to validate. |
| 9045 | 240 | * |
| 241 | * Checks if the given email address is syntactically valid. | |
| 242 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
243 | * Returns: True if the email address is syntactically correct. |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
244 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
245 | * Since: 2.0 |
| 9045 | 246 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
247 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 248 | gboolean purple_email_is_valid(const char *address); |
| 9045 | 249 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
250 | /************************************************************************** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
251 | * UTF8 String Functions |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
252 | **************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
253 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
254 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
255 | * purple_utf8_try_convert: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
256 | * @str: The source string. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
257 | * |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
258 | * Attempts to convert a string to UTF-8 from an unknown encoding. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
259 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
260 | * This function checks the locale and tries sane defaults. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
261 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
262 | * Returns: The UTF-8 string, or %NULL if it could not be converted. |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
263 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
264 | * Since: 2.0 |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
265 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
266 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 267 | gchar *purple_utf8_try_convert(const char *str); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
268 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
269 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
270 | * purple_utf8_strcasecmp: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
271 | * @a: The first string. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
272 | * @b: The second string. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
273 | * |
|
25591
b19ece4232c1
I'm pretty sure this is what we meant here.
Etan Reisner <deryni@pidgin.im>
parents:
24072
diff
changeset
|
274 | * Compares two UTF-8 strings case-insensitively. This comparison is |
|
16213
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
275 | * more expensive than a simple g_utf8_collate() comparison because |
|
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
276 | * it calls g_utf8_casefold() on each string, which allocates new |
|
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
277 | * strings. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
278 | * |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
279 | * Returns: -1 if @a is less than @b. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
280 | * 0 if @a is equal to @b. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
281 | * 1 if @a is greater than @b. |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
282 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
283 | * Since: 2.0 |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
284 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
285 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 286 | int purple_utf8_strcasecmp(const char *a, const char *b); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
287 | |
| 7564 | 288 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
289 | * purple_escape_filename: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35394
diff
changeset
|
290 | * @str: The string to translate. |
| 9926 | 291 | * |
| 292 | * Escapes filesystem-unfriendly characters from a filename | |
| 293 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35265
diff
changeset
|
294 | * Returns: The resulting string. |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
295 | * |
|
42618
8546a023aa0a
Remove the micro version from since tags for libpurple part 7
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
296 | * Since: 2.0 |
| 9926 | 297 | */ |
|
42408
94151c4d26b5
Add Since tags/visibility exports to utility functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42398
diff
changeset
|
298 | PURPLE_AVAILABLE_IN_ALL |
| 15884 | 299 | const char *purple_escape_filename(const char *str); |
| 9926 | 300 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32737
diff
changeset
|
301 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
302 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39527
diff
changeset
|
303 | #endif /* PURPLE_UTIL_H */ |