diff options
author | Ross Burton <ross@openedhand.com> | 2006-06-13 08:39:36 +0000 |
---|---|---|
committer | Ross Burton <rburton@src.gnome.org> | 2006-06-13 08:39:36 +0000 |
commit | 48c1509369a462b695b4a13c5d34e4114f88757d (patch) | |
tree | e994e13ccd004e187b8dab9aee9f8a35db5208b8 | |
parent | f5d8f528d571e1097539f28bd3befd3902efbe72 (diff) | |
download | evolution-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/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/libebook/e-vcard.c | 21 | ||||
-rw-r--r-- | addressbook/libebook/e-vcard.h | 1 |
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); |