Index: /trunk/glueforge/templates/psdb/popfits_c.tt
===================================================================
--- /trunk/glueforge/templates/psdb/popfits_c.tt	(revision 4175)
+++ /trunk/glueforge/templates/psdb/popfits_c.tt	(revision 4175)
@@ -0,0 +1,30 @@
+#include <pslib.h>
+#include <[% pkg_name %].h>
+#include <stdlib.h>
+
+int main ()
+{
+    psDB            *dbh;
+    psFits          *fits;
+    bool            status;
+
+    dbh = psDBInit("localhost", "test", NULL, "test");
+    if (!dbh) {
+        exit(EXIT_FAILURE);
+    }
+
+    // allocate a temp
+    fits = psFitsAlloc("./blargh");
+    if (!fits) {
+        exit(EXIT_FAILURE);
+    }
+
+    status = [% namespace %]PopFits(dbh, fits, 1);
+    if (!status) {
+        exit(EXIT_FAILURE);
+    }
+
+    psDBCleanup(dbh);
+
+    exit(EXIT_SUCCESS);
+}
