diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-01-03 18:08:55 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-01-03 18:08:55 +0800 |
commit | 01c8e48720676af9576b5eee0c3081432d61b133 (patch) | |
tree | 1e52a92515340aca8c3b8231bc2d95240329ade8 /camel | |
parent | 01f62452292ef0806edd03eced94e2637c146651 (diff) | |
download | gsoc2013-evolution-01c8e48720676af9576b5eee0c3081432d61b133.tar.gz gsoc2013-evolution-01c8e48720676af9576b5eee0c3081432d61b133.tar.zst gsoc2013-evolution-01c8e48720676af9576b5eee0c3081432d61b133.zip |
sync. Does not compile
svn path=/trunk/; revision=1530
Diffstat (limited to 'camel')
-rw-r--r-- | camel/gstring-util.c | 16 | ||||
-rw-r--r-- | camel/providers/mbox/.cvsignore | 1 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-folder.c | 15 | ||||
-rw-r--r-- | camel/string-utils.c | 19 |
4 files changed, 39 insertions, 12 deletions
diff --git a/camel/gstring-util.c b/camel/gstring-util.c index 36d5eaba3d..ad97bc2851 100644 --- a/camel/gstring-util.c +++ b/camel/gstring-util.c @@ -42,9 +42,9 @@ gboolean g_string_equals (GString *string1, GString *string2) { - g_assert(string1); - g_assert(string2); - return !strcmp(string1->str, string2->str); + g_assert (string1); + g_assert (string2); + return !strcmp (string1->str, string2->str); } @@ -58,9 +58,9 @@ g_string_equals (GString *string1, GString *string2) * @Return Value : the clone ... **/ GString * -g_string_clone(GString *string) +g_string_clone (GString *string) { - return g_string_new( g_strdup(string->str) ); + return g_string_new (g_strdup (string->str) ); } @@ -98,8 +98,8 @@ g_string_dichotomy (GString *string, gchar sep, GString **prefix, GString **suff CAMEL_LOG_FULL_DEBUG (\ "Entering string_dichotomy: \n\tseparator=%c \n\tprefix=%p \n\tsuffix=%p \n\toptions=%ld\n",\ sep, prefix, suffix, options); - g_assert( tmp=string->str ); - len = strlen(tmp); + g_assert (tmp=string->str); + len = strlen (tmp); if (!len) { if (prefix) *prefix=NULL; @@ -110,7 +110,7 @@ g_string_dichotomy (GString *string, gchar sep, GString **prefix, GString **suff } first = 0; - if ( (options & GSTRING_DICHOTOMY_STRIP_LEADING ) && (tmp[first] == sep) ) + if ((options & GSTRING_DICHOTOMY_STRIP_LEADING ) && (tmp[first] == sep) ) do {first++;} while ( (first<len) && (tmp[first] == sep) ); if (options & GSTRING_DICHOTOMY_STRIP_TRAILING ) diff --git a/camel/providers/mbox/.cvsignore b/camel/providers/mbox/.cvsignore new file mode 100644 index 0000000000..70845e08eb --- /dev/null +++ b/camel/providers/mbox/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index cb36430538..90d9399833 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -669,12 +669,12 @@ _list_subfolders (CamelFolder *folder, CamelException *ex) } - /* get the mbox subfolders directory */ + /* get the mbox subfolders directories */ folder_dir_path = mbox_folder->folder_file_path; if (!folder_dir_path) { camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID, - "invalid folder path. Use set_name ?"); + "Invalid folder path. Use set_name ?"); return FALSE; } @@ -695,8 +695,10 @@ _list_subfolders (CamelFolder *folder, CamelException *ex) if ((stat_error != -1) && S_ISDIR (stat_buf.st_mode)) { /* yes, add it to the list */ if (entry_name[0] != '.') { - CAMEL_LOG_FULL_DEBUG ("CamelMboxFolder::list_subfolders adding %s\n", entry_name); - subfolder_name_list = g_list_append (subfolder_name_list, g_strdup (entry_name)); + CAMEL_LOG_FULL_DEBUG ("CamelMboxFolder::list_subfolders adding " + "%s\n", entry_name); + subfolder_name_list = g_list_append (subfolder_name_list, + g_strdup (entry_name)); } } /* read next entry */ @@ -742,3 +744,8 @@ _list_subfolders (CamelFolder *folder, CamelException *ex) return NULL; } + + + + + diff --git a/camel/string-utils.c b/camel/string-utils.c index a8b9ed585f..beddfa8172 100644 --- a/camel/string-utils.c +++ b/camel/string-utils.c @@ -253,4 +253,23 @@ string_trim (gchar *string, const gchar *trim_chars, StringTrimOption options) +gchar * +string_prefix (const gchar *s, const gchar *suffix) +{ + guint s_len, suf_len; + guint suffix_pos; + + g_assert (s); + g_assert (suffix); + + s_len = strlen (s); + suf_len = strlen (suffix); + + if (s_len < suf_len) + return null; + suffix_pos = s_len - suf_len; + + if (!strncmp (s+suffix_pos, suffix, suf_len)) + +} |