Ejemplo n.º 1
0
gint
main (gint argc,
      gchar **argv)
{
#if 0  /* ACCOUNT_MGMT */
	EBook *book;

	g_type_init ();

	/*
	** the actual ebook foo
	*/

	printf ("loading addressbook\n");
	book = e_book_new_system_addressbook (NULL);
	if (!book) {
		printf ("failed to create local addressbook\n");
		exit (0);
	}

	ebook_test_utils_book_open (book, FALSE);

	printf ("printing one contact\n");
	print_one_email (book);

	printf ("printing all contacts\n");
	print_all_emails (book);

	g_object_unref (book);
#endif /* ACCOUNT_MGMT */

	return 0;
}
static void
print_email_cb (EBook *book,
                const GError *error,
                EContact *contact,
                gpointer closure)
{
	if (!error)
		print_email (contact);
	else
		g_warning ("%s: Got error %d (%s)", G_STRFUNC, error->code, error->message);

	printf ("printing all contacts\n");
	print_all_emails (book);
}