summaryrefslogtreecommitdiff
path: root/libpurple/util.c
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2022-09-30 04:02:12 -0500
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2022-09-30 04:02:12 -0500
commit078e59cea218dc56b0f67c153b399cb765b92770 (patch)
treed8d2243aa21eb68a626f351ebb089aca4b264d6e /libpurple/util.c
parent9e5ecc9999ce79c866b582bb2ac76ee27dddfa42 (diff)
downloadpidgin-078e59cea218dc56b0f67c153b399cb765b92770.tar.gz
Remove unused utilities
Testing Done: Compiled. Reviewed at https://reviews.imfreedom.org/r/1871/
Diffstat (limited to 'libpurple/util.c')
-rw-r--r--libpurple/util.c122
1 files changed, 0 insertions, 122 deletions
diff --git a/libpurple/util.c b/libpurple/util.c
index 2b4511197b..f7dac2a7b8 100644
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -341,41 +341,6 @@ purple_strreplace(const char *string, const char *delimiter,
return ret;
}
-/* TODO: Expose this when we can add API */
-static const char *
-purple_strcasestr_len(const char *haystack, gssize hlen, const char *needle, gssize nlen)
-{
- const char *tmp, *ret;
-
- g_return_val_if_fail(haystack != NULL, NULL);
- g_return_val_if_fail(needle != NULL, NULL);
-
- if (hlen == -1)
- hlen = strlen(haystack);
- if (nlen == -1)
- nlen = strlen(needle);
- tmp = haystack,
- ret = NULL;
-
- g_return_val_if_fail(hlen > 0, NULL);
- g_return_val_if_fail(nlen > 0, NULL);
-
- while (*tmp && !ret && (hlen - (tmp - haystack)) >= nlen) {
- if (!g_ascii_strncasecmp(needle, tmp, nlen))
- ret = tmp;
- else
- tmp++;
- }
-
- return ret;
-}
-
-const char *
-purple_strcasestr(const char *haystack, const char *needle)
-{
- return purple_strcasestr_len(haystack, -1, needle, -1);
-}
-
char *
purple_str_seconds_to_string(guint secs)
{
@@ -616,93 +581,6 @@ purple_email_is_valid(const char *address)
return ((c - domain) > 3 ? TRUE : FALSE);
}
-/* Stolen from gnome_uri_list_extract_uris */
-GList *
-purple_uri_list_extract_uris(const gchar *uri_list)
-{
- const gchar *p, *q;
- gchar *retval;
- GList *result = NULL;
-
- g_return_val_if_fail (uri_list != NULL, NULL);
-
- p = uri_list;
-
- /* We don't actually try to validate the URI according to RFC
- * 2396, or even check for allowed characters - we just ignore
- * comments and trim whitespace off the ends. We also
- * allow LF delimination as well as the specified CRLF.
- */
- while (p) {
- if (*p != '#') {
- while (isspace(*p))
- p++;
-
- q = p;
- while (*q && (*q != '\n') && (*q != '\r'))
- q++;
-
- if (q > p) {
- q--;
- while (q > p && isspace(*q))
- q--;
-
- retval = (gchar*)g_malloc (q - p + 2);
- strncpy (retval, p, q - p + 1);
- retval[q - p + 1] = '\0';
-
- result = g_list_prepend (result, retval);
- }
- }
- p = strchr (p, '\n');
- if (p)
- p++;
- }
-
- return g_list_reverse (result);
-}
-
-
-/* Stolen from gnome_uri_list_extract_filenames */
-GList *
-purple_uri_list_extract_filenames(const gchar *uri_list)
-{
- GList *tmp_list, *node, *result;
-
- g_return_val_if_fail (uri_list != NULL, NULL);
-
- result = purple_uri_list_extract_uris(uri_list);
-
- tmp_list = result;
- while (tmp_list) {
- gchar *s = (gchar*)tmp_list->data;
-
- node = tmp_list;
- tmp_list = tmp_list->next;
-
- if (!strncmp (s, "file:", 5)) {
- node->data = g_filename_from_uri (s, NULL, NULL);
- /* not sure if this fallback is useful at all */
- if (!node->data) node->data = g_strdup (s+5);
- } else {
- result = g_list_delete_link(result, node);
- }
- g_free (s);
- }
- return result;
-}
-
-char *
-purple_uri_escape_for_open(const char *unescaped)
-{
- /* Replace some special characters like $ with their percent-encoded value.
- * This shouldn't be necessary because we shell-escape the entire arg before
- * exec'ing the browser, however, we had a report that a URL containing
- * $(xterm) was causing xterm to start on his system. This is obviously a
- * bug on his system, but it's pretty easy for us to protect against it. */
- return g_uri_escape_string(unescaped, "[]:;/%#,+?=&@", FALSE);
-}
-
/**************************************************************************
* UTF8 String Functions
**************************************************************************/