1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 #include <libecal/e-cal.h>
7 main (gint argc, gchar **argv)
15 printf ("usage: test-search <uid> <query>\n");
19 ecal = e_cal_new_from_uri (argv[1], E_CAL_SOURCE_TYPE_EVENT);
21 if (!e_cal_open (ecal, TRUE, NULL)) {
22 printf ("failed to open calendar\n");
26 if (!e_cal_get_object_list_as_comp (ecal, argv[2], &objects, NULL)) {
27 printf ("failed to get objects\n");
31 printf ("Received %d objects\n", g_list_length (objects));
32 for (l = objects; l; l = l->next) {
33 ECalComponent *comp = E_CAL_COMPONENT (l->data);
36 str = e_cal_component_get_as_string (comp);
40 g_object_unref (comp);
43 g_list_free (objects);
45 g_object_unref (ecal);