summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2006-06-13 08:39:36 +0000
committerRoss Burton <rburton@src.gnome.org>2006-06-13 08:39:36 +0000
commit48c1509369a462b695b4a13c5d34e4114f88757d (patch)
treee994e13ccd004e187b8dab9aee9f8a35db5208b8
parentf5d8f528d571e1097539f28bd3befd3902efbe72 (diff)
downloadevolution-data-server-48c1509369a462b695b4a13c5d34e4114f88757d.tar.gz
Add e_vcard_get_attribute() (#334411)
2006-06-13 Ross Burton <ross@openedhand.com> * libebook/e-vcard.[ch]: Add e_vcard_get_attribute() (#334411)
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/libebook/e-vcard.c21
-rw-r--r--addressbook/libebook/e-vcard.h1
3 files changed, 28 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 25c53857b..6bfc9f082 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-13 Ross Burton <ross@openedhand.com>
+
+ * libebook/e-vcard.[ch]:
+ Add e_vcard_get_attribute() (#334411)
+
2006-06-12 simon.zheng <simon.zheng@sun.com>
Fix for #336453
@@ -17,6 +22,7 @@
to a db based cache.
* addressbook/libedata-book/e-book-backend-db-cache.[ch]:
Addeed APIs for handling db based cache.
+
2006-06-07 Ross Burton <ross@openedhand.com>
* libebook/e-book-query.c:
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index 2ba04875e..80d370341 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -1525,6 +1525,27 @@ e_vcard_get_attributes (EVCard *evcard)
return evcard->priv->attributes;
}
+EVCardAttribute *
+e_vcard_get_attribute (EVCard *vcard,
+ const char *name)
+{
+ GList *attrs, *l;
+
+ g_return_val_if_fail (E_IS_VCARD (vcard), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ attrs = e_vcard_get_attributes (vcard);
+ for (l = attrs; l; l = l->next) {
+ EVCardAttribute *attr;
+ const char *n;
+
+ attr = (EVCardAttribute *) l->data;
+ if (strcmp (attr->name, name) == 0)
+ return attr;
+ }
+
+ return NULL;
+}
/**
* e_vcard_attribute_get_group:
* @attr: an #EVCardAttribute
diff --git a/addressbook/libebook/e-vcard.h b/addressbook/libebook/e-vcard.h
index 3791a1007..e0a947143 100644
--- a/addressbook/libebook/e-vcard.h
+++ b/addressbook/libebook/e-vcard.h
@@ -168,6 +168,7 @@ void e_vcard_attribute_param_remove_values (EVCardAttributePa
/* EVCard* accessors. nothing returned from these functions should be
freed by the caller. */
+EVCardAttribute *e_vcard_get_attribute (EVCard *vcard, const char *name);
GList* e_vcard_get_attributes (EVCard *evcard);
const char* e_vcard_attribute_get_group (EVCardAttribute *attr);
const char* e_vcard_attribute_get_name (EVCardAttribute *attr);