--- a/ChangeLog.API Sun May 15 02:27:07 2022 -0500
+++ b/ChangeLog.API Sun May 15 02:27:58 2022 -0500
@@ -437,6 +437,7 @@
yourself. See GLib Main Event Loop docs.
* purple_fd_get_ip. Use GSocket instead.
* PurpleGetPublicAliasSuccessCallback
* PurpleGetPublicAliasFailureCallback
* purple_get_attention_type_from_code
@@ -463,6 +464,7 @@
purple_mime_part_get_data_decoded,
purple_mime_part_get_length, purple_mime_part_set_data, and
purple_mime_decode_field. Use the GMime library, instead.
* purple_network_convert_idn_to_ascii. Use g_hostname_to_ascii,
* purple_network_get_all_local_system_ips. Use libnice instead.
@@ -492,6 +494,7 @@
+ * PurplePluginProtocolInfo * purple_plugin_is_unloadable
@@ -563,7 +566,7 @@
* purple_presence_new_for_account
* purple_presence_new_for_buddy
* purple_print_utf8_to_console
- * PurplePluginProtocolInfo
+ * purple_program_is_valid * pidgin_protocol_option_menu_new
* purple_proxy_connect_socks5
* purple_proxy_connect_socks5_account
@@ -586,6 +589,7 @@
* purple_roomlist_get_fields
* purple_roomlist_get_protocol_data
* purple_roomlist_set_protocol_data
* PurpleSetPublicAliasFailureCallback
* PurpleSetPublicAliasSuccessCallback
@@ -643,6 +647,8 @@
* purple_srv_resolve_account
* purple_srv_txt_query_destroy
+ * purple_strcasereplace * PurpleStunNatDiscovery.type
* PURPLE_SSL_DEFAULT_PORT
@@ -684,6 +690,8 @@
* purple_txt_resolve_account
* PurpleType, use GType instead.
+ * purple_unescape_filename * purple_utf8_salvage. Use g_utf8_make_valid instead.
* purple_util_write_data_to_file_absolute. Use g_file_set_contents
--- a/libpurple/tests/test_util.c Sun May 15 02:27:07 2022 -0500
+++ b/libpurple/tests/test_util.c Sun May 15 02:27:58 2022 -0500
@@ -39,15 +39,6 @@
g_assert_cmpstr("%21oo", ==, purple_escape_filename("!oo"));
-test_util_filename_unescape(void) {
- g_assert_cmpstr("bar", ==, purple_unescape_filename("bar"));
- g_assert_cmpstr("@ar", ==, purple_unescape_filename("@ar"));
- g_assert_cmpstr("!ar", ==, purple_unescape_filename("!ar"));
- g_assert_cmpstr("!ar", ==, purple_unescape_filename("%21ar"));
- g_assert_cmpstr("%ar", ==, purple_unescape_filename("%25ar"));
/******************************************************************************
*****************************************************************************/
@@ -239,8 +230,6 @@
g_test_add_func("/util/filename/escape",
test_util_filename_escape);
- g_test_add_func("/util/filename/unescape",
- test_util_filename_unescape);
g_test_add_func("/util/mnemonic/strip",
test_util_text_strip_mnemonic);
--- a/libpurple/util.c Sun May 15 02:27:07 2022 -0500
+++ b/libpurple/util.c Sun May 15 02:27:58 2022 -0500
@@ -201,88 +201,6 @@
return purple_xmlnode_from_file(purple_data_dir(), filename, description, "util");
- * Like mkstemp() but returns a file pointer, uses a pre-set template,
- * uses the semantics of tempnam() for the directory to use and allocates
- * the space for the filepath.
- * Caller is responsible for closing the file and removing it when done,
- * as well as freeing the space pointed-to by "path" with g_free().
- * Returns NULL on failure and cleans up after itself if so.
-static const char *purple_mkstemp_templ = {"purpleXXXXXX"};
-purple_mkstemp(char **fpath, gboolean binary)
- g_return_val_if_fail(fpath != NULL, NULL);
- if((tmpdir = (gchar*)g_get_tmp_dir()) != NULL) {
- if((*fpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", tmpdir, purple_mkstemp_templ)) != NULL) {
- fd = g_mkstemp(*fpath);
- purple_debug_error("purple_mkstemp", "Couldn't make \"%s\", error: %d",
- if((fp = fdopen(fd, "r+")) == NULL) {
- purple_debug_error("purple_mkstemp", "Couldn't fdopen(), error: %d", errno);
- purple_debug_error("purple_mkstemp", "g_get_tmp_dir() failed!");
-purple_program_is_valid(const char *program)
- gboolean is_valid = FALSE;
- g_return_val_if_fail(program != NULL, FALSE);
- g_return_val_if_fail(*program != '\0', FALSE);
- if (!g_shell_parse_argv(program, NULL, &argv, &error)) {
- purple_debug_error("program_is_valid", "Could not parse program '%s': %s",
- program, error->message);
- progname = g_find_program_in_path(argv[0]);
- is_valid = (progname != NULL);
- if(purple_debug_is_verbose())
- purple_debug_info("program_is_valid", "Tested program %s. %s.\n", program,
- is_valid ? "Valid" : "Invalid");
purple_running_gnome(void)
@@ -332,16 +250,6 @@
-purple_running_osx(void)
/**************************************************************************
**************************************************************************/
@@ -462,39 +370,6 @@
return (g_ascii_strncasecmp(s, p, strlen(p)) == 0);
-purple_str_add_cr(const char *text)
- g_return_val_if_fail(text != NULL, NULL);
- for (i = 1; i < strlen(text); i++)
- if (text[i] == '\n' && text[i - 1] != '\r')
- ret = g_malloc0(strlen(text) + count + 1);
- for (; i < strlen(text); i++) {
- if (text[i] == '\n' && text[i - 1] != '\r')
purple_str_strip_char(char *text, char thechar)
@@ -543,54 +418,6 @@
-purple_strcasereplace(const char *string, const char *delimiter,
- const char *replacement)
- int length_del, length_rep, i, j;
- g_return_val_if_fail(string != NULL, NULL);
- g_return_val_if_fail(delimiter != NULL, NULL);
- g_return_val_if_fail(replacement != NULL, NULL);
- length_del = strlen(delimiter);
- length_rep = strlen(replacement);
- /* Count how many times the delimiter appears */
- i = 0; /* position in the source string */
- j = 0; /* number of occurrences of "delimiter" */
- while (string[i] != '\0') {
- if (!g_ascii_strncasecmp(&string[i], delimiter, length_del)) {
- i = 0; /* position in the source string */
- j = 0; /* position in the destination string */
- while (string[i] != '\0') {
- if (!g_ascii_strncasecmp(&string[i], delimiter, length_del)) {
- strncpy(&ret[j], replacement, length_rep);
/** TODO: Expose this when we can add API */
purple_strcasestr_len(const char *haystack, gssize hlen, const char *needle, gssize nlen)
@@ -769,50 +596,6 @@
-purple_url_decode(const char *str)
- static char buf[BUF_LEN];
- g_return_val_if_fail(str != NULL, NULL);
- * XXX - This check could be removed and buf could be made
- * dynamically allocated, but this is easier.
- if (strlen(str) >= BUF_LEN)
- for (i = 0; i < strlen(str); i++) {
- strncpy(hex, str + ++i, 2);
- /* i is pointing to the start of the number */
- * Now it's at the end and at the start of the for loop
- * will be at the next character.
- buf[j++] = strtol(hex, NULL, 16);
- if (!g_utf8_validate(buf, -1, (const char **)&bum))
purple_url_encode(const char *str)
@@ -1067,55 +850,6 @@
- * This function is copied from g_strerror() but changed to use
-purple_gai_strerror(gint errnum)
- static GPrivate msg_private = G_PRIVATE_INIT(g_free);
- int saved_errno = errno;
- const char *msg_locale;
- msg_locale = gai_strerror(errnum);
- if (g_get_charset(NULL))
- /* This string is already UTF-8--great! */
- gchar *msg_utf8 = g_locale_to_utf8(msg_locale, -1, NULL, NULL, NULL);
- /* Stick in the quark table so that we can return a static result */
- GQuark msg_quark = g_quark_from_string(msg_utf8);
- msg_utf8 = (gchar *)g_quark_to_string(msg_quark);
- msg = g_private_get(&msg_private);
- msg = g_new(gchar, 64);
- g_private_set(&msg_private, msg);
- sprintf(msg, "unknown error (%d)", errnum);
purple_utf8_ncr_encode(const char *str)
@@ -1348,11 +1082,6 @@
-const char* purple_unescape_filename(const char *escaped) {
- return purple_url_decode(escaped);
/* this is almost identical to purple_url_encode (hence purple_url_decode
* being used above), but we want to keep certain characters unescaped
--- a/libpurple/util.h Sun May 15 02:27:07 2022 -0500
+++ b/libpurple/util.h Sun May 15 02:27:58 2022 -0500
@@ -37,8 +37,6 @@
#include "purpleprotocol.h"
-typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len);
@@ -286,41 +284,11 @@
purple_util_read_xml_from_data_file(const char *filename, const char *description);
- * @path: The returned path to the temp file.
- * @binary: Text or binary, for platforms where it matters.
- * Creates a temporary file and returns a file pointer to it.
- * This is like mkstemp(), but returns a file pointer and uses a
- * pre-set template. It uses the semantics of tempnam() for the
- * directory to use and allocates the space for the file path.
- * The caller is responsible for closing the file and removing it when
- * done, as well as freeing the space pointed to by @path with
- * Returns: A file pointer to the temporary file, or %NULL on failure.
-FILE *purple_mkstemp(char **path, gboolean binary);
/**************************************************************************/
/* Environment Detection Functions */
/**************************************************************************/
- * purple_program_is_valid:
- * @program: The file name of the application.
- * Checks if the given program name is valid and executable.
- * Returns: TRUE if the program is runable.
-gboolean purple_program_is_valid(const char *program);
* Check if running GNOME.
@@ -338,16 +306,6 @@
gboolean purple_running_kde(void);
- * Check if running OS X.
- * Returns: TRUE if running OS X, FALSE otherwise.
-gboolean purple_running_osx(void);
/**************************************************************************/
/**************************************************************************/
@@ -440,16 +398,6 @@
gchar *purple_strdup_withhtml(const gchar *src);
- * @str: The source string.
- * Ensures that all linefeeds have a matching carriage return.
- * Returns: The string with carriage returns.
-char *purple_str_add_cr(const char *str);
* @str: The string to strip characters from.
* @thechar: The character to strip from the given string.
@@ -521,23 +469,6 @@
char *purple_utf8_ncr_decode(const char *in);
- * purple_strcasereplace:
- * @string: The string from which to replace stuff.
- * @delimiter: The substring you want replaced.
- * @replacement: The substring you want inserted in place
- * of the delimiting substring.
- * Given a string, this replaces one substring with another
- * ignoring case and returns a newly allocated string.
- * Returns: A new string, after performing the substitution.
- * free this with g_free().
-gchar *purple_strcasereplace(const char *string, const char *delimiter,
- const char *replacement);
* @haystack: The string to search in.
@@ -578,18 +509,6 @@
void purple_got_protocol_handler_uri(const char *uri);
- * @str: The string to translate.
- * Decodes a URL into a plain string.
- * This will change hex codes and such to their ascii equivalents.
- * Returns: The resulting string.
-const char *purple_url_decode(const char *str);
* @str: The string to translate.
@@ -683,18 +602,6 @@
gchar *purple_utf8_strip_unprintables(const gchar *str);
- * @errnum: The error code.
- * Return the UTF-8 version of #gai_strerror. It calls #gai_strerror
- * then converts the result to UTF-8. This function is analogous to
- * Returns: The UTF-8 error message.
-const gchar *purple_gai_strerror(gint errnum);
* purple_utf8_strcasecmp:
@@ -747,18 +654,6 @@
char *purple_text_strip_mnemonic(const char *in);
- * purple_unescape_filename:
- * @str: The string to translate.
- * Does the reverse of purple_escape_filename
- * This will change hex codes and such to their ascii equivalents.
- * Returns: The resulting string.
-const char *purple_unescape_filename(const char *str);
* purple_escape_filename:
* @str: The string to translate.