diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-03-24 07:37:48 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-03-24 07:37:48 +0800 |
commit | 92f0631a74a1e128e0936b30336ca314fd6fec4c (patch) | |
tree | 5ec198dff25bf392e875d81b997a8da2f8d68db9 /addressbook/backend/ebook/test-card.c | |
parent | 6e64a7badadb8b24759737385d0331ceca56a69f (diff) | |
download | gsoc2013-evolution-92f0631a74a1e128e0936b30336ca314fd6fec4c.tar.gz gsoc2013-evolution-92f0631a74a1e128e0936b30336ca314fd6fec4c.tar.zst gsoc2013-evolution-92f0631a74a1e128e0936b30336ca314fd6fec4c.zip |
Added parsing and testing for name, full name, birthday, telephone, email,
2000-03-23 Christopher James Lahey <clahey@helixcode.com>
* addressbook/backend/ebook/e-card.c,
addressbook/backend/ebook/e-card.h,
addressbook/backend/ebook/e-card-types.h,
addressbook/backend/ebook/e-card-pairs.h,
addressbook/backend/ebook/test-card.c: Added parsing and testing
for name, full name, birthday, telephone, email, and street
address properties.
svn path=/trunk/; revision=2157
Diffstat (limited to 'addressbook/backend/ebook/test-card.c')
-rw-r--r-- | addressbook/backend/ebook/test-card.c | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/addressbook/backend/ebook/test-card.c b/addressbook/backend/ebook/test-card.c index 2576c87e6b..cf068a5498 100644 --- a/addressbook/backend/ebook/test-card.c +++ b/addressbook/backend/ebook/test-card.c @@ -18,6 +18,8 @@ " \ "EMAIL;INTERNET:nat@helixcode.com " \ +"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234; +" \ "END:VCARD " \ " @@ -62,9 +64,71 @@ main (int argc, char **argv) if (cardstr == NULL) cardstr = TEST_VCARD; - +#if 0 + { + int i; + for ( i = 0; i < 100000; i++ ) { + card = e_card_new (cardstr); + + gtk_object_unref (GTK_OBJECT (card)); + } + } +#endif card = e_card_new (cardstr); - + if ( card->fname ) + printf("Name : %s\n", card->fname); + if ( card->name ) { + printf("Full Name:\n"); + if ( card->name->prefix ) + printf(" prefix : %s\n", card->name->prefix); + if ( card->name->given ) + printf(" given : %s\n", card->name->given); + if ( card->name->additional ) + printf(" additional : %s\n", card->name->additional); + if ( card->name->family ) + printf(" family : %s\n", card->name->family); + if ( card->name->suffix ) + printf(" suffix : %s\n", card->name->suffix); + } + if ( card->bday ) { + printf("BDay : %4d-%02d-%02d\n", card->bday->year, card->bday->month, card->bday->day); + } + if ( card->email ) { + GList *email = card->email; + for ( ; email; email = email->next ) { + printf("Email : %s\n", (char *) email->data); + } + } + if ( card->phone ) { + GList *phone = card->phone; + for ( ; phone; phone = phone->next ) { + ECardPhone *e_card_phone = (ECardPhone *) phone->data; + printf("Phone ; %d : %s\n", e_card_phone->flags, e_card_phone->number); + } + } + if ( card->address ) { + GList *address = card->address; + for ( ; address; address = address->next ) { + ECardDeliveryAddress *del_address = (ECardDeliveryAddress *) address->data; + printf("Address ; %d:\n", del_address->flags); + if ( del_address->po ) + printf(" Po : %s\n", del_address->po); + if ( del_address->ext ) + printf(" Ext : %s\n", del_address->ext); + if ( del_address->street ) + printf(" Street : %s\n", del_address->street); + if ( del_address->city ) + printf(" City : %s\n", del_address->city); + if ( del_address->region ) + printf(" Region : %s\n", del_address->region); + if ( del_address->code ) + printf(" Code : %s\n", del_address->code); + if ( del_address->country ) + printf(" Country : %s\n", del_address->country); + if ( del_address->description ) + printf(" Description : %s\n", del_address->description); + } + } gtk_object_unref (GTK_OBJECT (card)); return 0; |