#include <gconf/gconf.h>
#include <glib.h>
-void dump_as_rfc822(EContact *c)
+void dump_as_rfc822(EContact *contact)
{
GList *attrs;
int i;
-
- contact = E_CONTACT(c->data);
attrs = e_contact_get_attributes(contact, E_CONTACT_PHONE_MOBILE);
printf("\t\tCONTACT: %s\n", e_contact_get(contact, E_CONTACT_FULL_NAME));
if (! attrs) {
fprintf(stderr, "Could not get phone attributes for contact\n");
- continue;
+ return;
}
for (i = 0; i < g_list_length(attrs); i++) {
EVCardAttribute *attr = (EVCardAttribute *) g_list_nth_data(attrs, i);
}
}
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
EBook *book;
ESourceList *source_list;
ESourceGroup *group;
GSList *groups;
EBookQuery *query;
GList *contacts;
- EContact *contact;
GSList *sources;
GSList *g, *s;
GList *c;
e_book_get_contacts(book, query, &contacts, &error);
for (c = contacts; c; c = c->next) {
+ dump_as_rfc822(E_CONTACT(c->data));
}
}
}