Index: /trunk/glueforge/glueforge.in
===================================================================
--- /trunk/glueforge/glueforge.in	(revision 4328)
+++ /trunk/glueforge/glueforge.in	(revision 4329)
@@ -3,5 +3,5 @@
 # Copyright (C) 2005  Joshua Hoblitt
 #
-# $Id: glueforge.in,v 1.20 2005-06-20 21:33:13 jhoblitt Exp $
+# $Id: glueforge.in,v 1.21 2005-06-21 02:14:47 jhoblitt Exp $
 
 use strict;
@@ -104,4 +104,5 @@
     'insertfits_c.tt'       => "$output/tests/insertfits.c",
     'popfits_c.tt'          => "$output/tests/popfits.c",
+    'selectrowsfits_c.tt'   => "$output/tests/selectrowsfits.c",
 );
 
Index: /trunk/glueforge/templates/psdb/selectrowsfits_at.tt
===================================================================
--- /trunk/glueforge/templates/psdb/selectrowsfits_at.tt	(revision 4329)
+++ /trunk/glueforge/templates/psdb/selectrowsfits_at.tt	(revision 4329)
@@ -0,0 +1,13 @@
+AT_SETUP([[% namespace %]SelectRowsFits() - Selects up to limit from the database and returns them in a binary FITS table])
+AT_KEYWORDS([[% namespace %]SelectRowsFits])
+
+AT_CHECK([dbsetup])
+# run insert so there is a row in the table
+AT_CHECK([insert])
+AT_CHECK([selectrowsfits])
+AT_CHECK([dbcleanup])
+if [ test -f "blargh" ] ; then
+    rm -f "blargh"
+fi
+
+AT_CLEANUP
Index: /trunk/glueforge/templates/psdb/selectrowsfits_c.tt
===================================================================
--- /trunk/glueforge/templates/psdb/selectrowsfits_c.tt	(revision 4329)
+++ /trunk/glueforge/templates/psdb/selectrowsfits_c.tt	(revision 4329)
@@ -0,0 +1,29 @@
+#include <pslib.h>
+#include <[% pkg_name %].h>
+#include <stdlib.h>
+
+int main ()
+{
+    psDB            *dbh;
+    psFits          *fits;
+
+    dbh = psDBInit("localhost", "test", NULL, "test");
+    if (!dbh) {
+        exit(EXIT_FAILURE);
+    }
+
+    // FIXME: open a temp file and pass it as a FD
+    fits = psFitsAlloc("./blargh");
+    if (!fits) {
+        exit(EXIT_FAILURE);
+    }
+
+    if (![% namespace %]SelectRowsFits(dbh, fits, NULL, 1)) {
+        exit(EXIT_FAILURE);
+    }
+
+    psFree(fits);
+    psDBCleanup(dbh);
+
+    exit(EXIT_SUCCESS);
+}
Index: /trunk/glueforge/templates/psdb/tests_makefile_am.tt
===================================================================
--- /trunk/glueforge/templates/psdb/tests_makefile_am.tt	(revision 4328)
+++ /trunk/glueforge/templates/psdb/tests_makefile_am.tt	(revision 4329)
@@ -55,5 +55,6 @@
     popobject \
     insertfits \
-    popfits
+    popfits \
+    selectrowsfits
 
 AM_CPPFLAGS = -I$(top_srcdir)/src$
Index: /trunk/glueforge/templates/psdb/testsuite_at.tt
===================================================================
--- /trunk/glueforge/templates/psdb/testsuite_at.tt	(revision 4328)
+++ /trunk/glueforge/templates/psdb/testsuite_at.tt	(revision 4329)
@@ -26,2 +26,4 @@
 [% INCLUDE popfits_at.tt %]
 ###
+[% INCLUDE selectrowsfits_at.tt %]
+###
