aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-07 06:38:49 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-07 06:38:49 +0000
commitaeaa6a865751f617c0b5f201016857f61e115252 (patch)
tree7c1619e001eb5f4eb81f152a854aa7dba7e3d478 /libsylph
parent57d3cf597bc3161b682906beac134d80f6f9b8d7 (diff)
fixed saved search.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1532 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procheader.c31
-rw-r--r--libsylph/procheader.h5
2 files changed, 34 insertions, 2 deletions
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index 84c5f36d..4d45dbe7 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -292,6 +292,19 @@ GSList *procheader_add_header_list(GSList *hlist, const gchar *header_name,
return g_slist_append(hlist, header);
}
+GSList *procheader_copy_header_list(GSList *hlist)
+{
+ GSList *newlist = NULL, *cur;
+
+ for (cur = hlist; cur != NULL; cur = cur->next) {
+ Header *header = (Header *)cur->data;
+ newlist = procheader_add_header_list(newlist, header->name,
+ header->body);
+ }
+
+ return newlist;
+}
+
GSList *procheader_merge_header_list(GSList *hlist1, GSList *hlist2)
{
GSList *cur;
@@ -305,6 +318,22 @@ GSList *procheader_merge_header_list(GSList *hlist1, GSList *hlist2)
return hlist1;
}
+GSList *procheader_merge_header_list_dup(GSList *hlist1, GSList *hlist2)
+{
+ GSList *list, *cur;
+
+ list = procheader_copy_header_list(hlist1);
+
+ for (cur = hlist2; cur != NULL; cur = cur->next) {
+ Header *header = (Header *)cur->data;
+ if (procheader_find_header_list(list, header->name) < 0)
+ list = procheader_add_header_list(list, header->name,
+ header->body);
+ }
+
+ return list;
+}
+
gint procheader_find_header_list(GSList *hlist, const gchar *header_name)
{
GSList *cur;
diff --git a/libsylph/procheader.h b/libsylph/procheader.h
index 60a0abc0..6054f5d3 100644
--- a/libsylph/procheader.h
+++ b/libsylph/procheader.h
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -56,8 +56,11 @@ GSList *procheader_get_header_list_from_msginfo (MsgInfo *msginfo);
GSList *procheader_add_header_list (GSList *hlist,
const gchar *header_name,
const gchar *body);
+GSList *procheader_copy_header_list (GSList *hlist);
GSList *procheader_merge_header_list (GSList *hlist1,
GSList *hlist2);
+GSList *procheader_merge_header_list_dup (GSList *hlist1,
+ GSList *hlist2);
gint procheader_find_header_list (GSList *hlist,
const gchar *header_name);
void procheader_header_list_destroy (GSList *hlist);