1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include <stdlib.h>
#include <libebook/e-book.h>
gint
main (gint argc,
gchar **argv)
{
EBook *book;
EContact *contact;
GError *error = NULL;
gchar *vcard;
g_type_init ();
printf ("getting the self contact\n");
if (!e_book_get_self (&contact, &book, &error)) {
printf ("error %d getting self: %s\n", error->code, error->message);
g_clear_error (&error);
return -1;
}
vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
printf ("self contact = \n%s\n", vcard);
g_free (vcard);
g_object_unref (contact);
g_object_unref (book);
return 0;
}
|