예제 #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
book_loaded_cb (EBook *book,
                const GError *error,
                gpointer data)
{
	if (error) {
		g_warning ("%s: Got error %d (%s)", G_STRFUNC, error->code, error->message);
		return;
	}

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