Add the beginnings of a xapian-dump program.
authorCarl Worth <cworth@cworth.org>
Tue, 13 Oct 2009 14:50:04 +0000 (07:50 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 13 Oct 2009 15:53:14 +0000 (08:53 -0700)
This will (when it is finished) make a much more reliable way to
ensure that notmuch's sync program behaves identically to sup-sync.
It doesn't actually do anything yet.

Makefile
xapian-dump.cc [new file with mode: 0644]

index 0f50a434d22379f8c49a6a69a3cd5946e715bb95..614c57600917cc6e25559ee7147962f8e6460a37 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,15 @@
-PROGS=g_mime_test
+PROGS=g_mime_test xapian-dump
+
+MYCFLAGS=-Wall
+MYCXXFLAGS=-Wall
 
 all: $(PROGS)
 
 g_mime_test: g_mime_test.c
 
 all: $(PROGS)
 
 g_mime_test: g_mime_test.c
-       $(CC) g_mime_test.c `pkg-config --cflags --libs gmime-2.4` -o g_mime_test
+       $(CC) $(CFLAGS) $(MYCFLAGS) g_mime_test.c `pkg-config --cflags --libs gmime-2.4` -o g_mime_test
+
+xapian-dump: xapian-dump.cc
+       $(CXX) $(CXXFLAGS) $(MYCXXFLAGS) xapian-dump.cc `xapian-config --libs --cxxflags` -o xapian-dump
 
 clean:
        rm -f $(PROGS)
 
 clean:
        rm -f $(PROGS)
diff --git a/xapian-dump.cc b/xapian-dump.cc
new file mode 100644 (file)
index 0000000..6d1fc1b
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2009 Carl Worth
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see http://www.gnu.org/licenses/ .
+ *
+ * Author: Carl Worth <cworth@cworth.org>
+ */
+
+#include <cstdlib>
+
+#include <xapian.h>
+
+int
+main (int argc, char *argv[])
+{
+    if (argc < 2) {
+       fprintf (stderr, "Usage: %s <path-to-xapian-database>\n",
+                argv[0]);
+       exit (1);
+    }
+
+    return 0;
+}