--- /dev/null
+
+AC_INIT([eds-address], 0.1)
+AC_CONFIG_SRCDIR(src/dump-addressbook.c)
+AM_INIT_AUTOMAKE([1.9])
+AM_CONFIG_HEADER(config.h)
+# AM_MAINTAINER_MODE
+
+PKG_CHECK_MODULES(EDS_ADDRESS, [libedataserver-1.2 libebook-1.2 gconf-2.0 glib-2.0])
+
+AC_CHECK_TYPES([sig_atomic_t], [], [], [#include <signal.h>])
+AC_CHECK_HEADER([sys/types.h], [], [exit 1], [])
+AC_CHECK_HEADER([tdb.h],[],[exit 1],[[
+#include <sys/types.h>
+#include <signal.h>
+]])
+
+AC_DISABLE_STATIC
+AM_PROG_LIBTOOL
+
+AC_PROG_CC
+
+#GETTEXT_PACKAGE=evolution-backend-tdb
+#AC_SUBST(GETTEXT_PACKAGE)
+#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The prefix for our gettext translation domains.])
+
+#AM_GLIB_GNU_GETTEXT
+
+AC_OUTPUT([Makefile src/Makefile])
--- /dev/null
+#include <libebook/e-book.h>
+#include <libedataserver/e-source-group.h>
+#include <gconf/gconf.h>
+#include <glib.h>
+
+int main(int argc, char **argv) {
+ EBook *book;
+ ESourceList *source_list;
+ ESourceGroup *group;
+ ESource *source;
+ GSList *groups;
+ EBookQuery *query;
+ GList *contacts;
+ EContact *contact;
+ GSList *sources;
+ GSList *g, *s;
+ GList *c;
+
+ int i;
+ GError *error = NULL;
+
+ fprintf(stderr,"%d\n", e_book_get_addressbooks(&source_list, &error));
+ if (error != NULL) {
+ fprintf(stderr, "%s\n", error->message);
+ }
+ groups = e_source_list_peek_groups(source_list);
+ for (g = groups; g; g = g->next) {
+
+ group = E_SOURCE_GROUP (g->data);
+ fprintf(stderr, "SOURCE GROUP: %s\n", e_source_group_peek_base_uri(group));
+ sources = e_source_group_peek_sources(group);
+
+ for (s = sources ; s; s = s->next) {
+ source = E_SOURCE(s->data);
+ book = e_book_new(source, &error);
+ e_book_open(book, TRUE, &error);
+ fprintf(stderr, "\tSOURCE: %s\n", e_source_peek_name(source));
+ // query = e_book_query_any_field_contains("");
+ query = e_book_query_field_exists(E_CONTACT_FULL_NAME);
+ e_book_get_contacts(book, query, &contacts, &error);
+
+ for (c = contacts; c; c = c->next) {
+ contact = E_CONTACT(c->data);
+ fprintf(stderr, "\t\tCONTACT: %s\n", e_contact_get(contact, E_CONTACT_FULL_NAME));
+ }
+
+ }
+ }
+}