[evolution-data-server] Remove camel_folder_summary_encode_token().



commit 14ed64a9f2e6723c454425205f2b274c37ce8f5d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Nov 13 00:29:12 2011 -0500

    Remove camel_folder_summary_encode_token().
    
    No longer needed.

 camel/camel-folder-summary.c            |   71 -------------------------------
 camel/camel-folder-summary.h            |    3 -
 docs/reference/camel/camel-sections.txt |    1 -
 3 files changed, 0 insertions(+), 75 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 5b8c9e6..808a001 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -3259,77 +3259,6 @@ static const gchar * tokens[] = {
 	"us-ascii",		/* 25 words */
 };
 
-/* baiscally ...
- *  0 = null
- *  1-len (tokens) == tokens[id-1]
- *  >=32 string, length = n-32
- */
-
-#ifdef USE_BSEARCH
-static gint
-token_search_cmp (gchar *key,
-                  gchar **index)
-{
-	d(printf("comparing '%s' to '%s'\n", key, *index));
-	return strcmp (key, *index);
-}
-#endif
-
-/**
- * camel_folder_summary_encode_token:
- * @out: output FILE pointer
- * @str: string token to encode
- *
- * Encode a string value, but use tokenisation and compression
- * to reduce the size taken for common mailer words.  This
- * can still be used to encode normal strings as well.
- *
- * Returns: %0 on success or %-1 on fail
- **/
-gint
-camel_folder_summary_encode_token (FILE *out,
-                                   const gchar *str)
-{
-	io(printf("Encoding token: '%s'\n", str));
-
-	if (str == NULL) {
-		return camel_file_util_encode_uint32 (out, 0);
-	} else {
-		gint len = strlen (str);
-		gint i, token=-1;
-
-		if (len <= 16) {
-			gchar lower[32];
-			const gchar **match;
-
-			for (i = 0; i < len; i++)
-				lower[i] = tolower (str[i]);
-			lower[i] = 0;
-#ifdef USE_BSEARCH
-			match = bsearch (lower, tokens, G_N_ELEMENTS (tokens), sizeof (gchar *), (gint (*)(gconstpointer , gconstpointer )) token_search_cmp);
-			if (match)
-				token = match - tokens;
-#else
-			for (i = 0; i < G_N_ELEMENTS (tokens); i++) {
-				if (!strcmp (tokens[i], lower)) {
-					token = i;
-					break;
-				}
-			}
-#endif
-		}
-		if (token != -1) {
-			return camel_file_util_encode_uint32 (out, token + 1);
-		} else {
-			if (camel_file_util_encode_uint32 (out, len + 32) == -1)
-				return -1;
-			if (fwrite (str, len, 1, out) != 1)
-				return -1;
-		}
-	}
-	return 0;
-}
-
 /**
  * camel_folder_summary_decode_token:
  * @in: input FILE pointer
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index ae4e8da..2578952 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -438,9 +438,6 @@ void			camel_folder_summary_unlock	(CamelFolderSummary *summary,
 							 CamelFolderSummaryLock lock);
 
 /* basically like strings, but certain keywords can be compressed and de-cased */
-gint			camel_folder_summary_encode_token
-							(FILE *out,
-							 const gchar *str);
 gint			camel_folder_summary_decode_token
 							(FILE *in,
 							 gchar **str);
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index aa0c15d..6200cc3 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -625,7 +625,6 @@ camel_folder_summary_get_changed
 camel_folder_summary_prepare_fetch_all
 camel_folder_summary_lock
 camel_folder_summary_unlock
-camel_folder_summary_encode_token
 camel_folder_summary_decode_token
 camel_flag_get
 camel_flag_set



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]