[tracker] libtracker-common: Remove unused string utility functions
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-common: Remove unused string utility functions
- Date: Thu, 18 Mar 2010 12:21:15 +0000 (UTC)
commit e4c8bbb5fe40001f85f313a6b28ea4bb1ba14645
Author: Jürg Billeter <j bitron ch>
Date: Thu Mar 18 13:11:40 2010 +0100
libtracker-common: Remove unused string utility functions
src/libtracker-common/tracker-utils.c | 69 ---------------------------------
src/libtracker-common/tracker-utils.h | 5 --
2 files changed, 0 insertions(+), 74 deletions(-)
---
diff --git a/src/libtracker-common/tracker-utils.c b/src/libtracker-common/tracker-utils.c
index 15f5e15..4aa5c5c 100644
--- a/src/libtracker-common/tracker-utils.c
+++ b/src/libtracker-common/tracker-utils.c
@@ -56,75 +56,6 @@ tracker_is_blank_string (const char *str)
return TRUE;
}
-/* Removes a substring modifing haystack in place */
-gchar *
-tracker_string_remove (gchar *haystack,
- const gchar *needle)
-{
- gchar *current, *pos, *next, *end;
- gint len;
-
- len = strlen (needle);
- end = haystack + strlen (haystack);
- current = pos = strstr (haystack, needle);
-
- if (!current) {
- return haystack;
- }
-
- while (*current != '\0') {
- pos = strstr (pos, needle) + len;
- next = strstr (pos, needle);
-
- if (!next) {
- next = end;
- }
-
- while (pos < next) {
- *current = *pos;
- current++;
- pos++;
- }
-
- if (*pos == '\0') {
- *current = *pos;
- }
- }
-
- return haystack;
-}
-
-gchar *
-tracker_string_replace (const gchar *haystack,
- const gchar *needle,
- const gchar *replacement)
-{
- GString *str;
- gint pos, needle_len;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- needle_len = strlen (needle);
-
- str = g_string_new ("");
-
- /* FIXME: should use strstr */
- for (pos = 0; haystack[pos]; pos++) {
- if (strncmp (&haystack[pos], needle, needle_len) == 0) {
- if (replacement) {
- str = g_string_append (str, replacement);
- }
-
- pos += needle_len - 1;
- } else {
- str = g_string_append_c (str, haystack[pos]);
- }
- }
-
- return g_string_free (str, FALSE);
-}
-
gchar *
tracker_seconds_estimate_to_string (gdouble seconds_elapsed,
gboolean short_string,
diff --git a/src/libtracker-common/tracker-utils.h b/src/libtracker-common/tracker-utils.h
index bc052c2..94840ef 100644
--- a/src/libtracker-common/tracker-utils.h
+++ b/src/libtracker-common/tracker-utils.h
@@ -31,11 +31,6 @@ G_BEGIN_DECLS
gboolean tracker_is_empty_string (const char *str);
gboolean tracker_is_blank_string (const char *str);
-gchar * tracker_string_replace (const gchar *haystack,
- const gchar *needle,
- const gchar *replacement);
-gchar * tracker_string_remove (gchar *haystack,
- const gchar *needle);
gchar * tracker_seconds_estimate_to_string (gdouble seconds_elapsed,
gboolean short_string,
guint items_done,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]