Index: /trunk/glueforge/templates/psdb/header.tt
===================================================================
--- /trunk/glueforge/templates/psdb/header.tt	(revision 3911)
+++ /trunk/glueforge/templates/psdb/header.tt	(revision 3912)
@@ -19,4 +19,5 @@
 [% INCLUDE popobject_h.tt %]
 [% INCLUDE insertfits_h.tt %]
+[% INCLUDE popfits_h.tt %]
 
 /// @}
Index: /trunk/glueforge/templates/psdb/popfits_h.tt
===================================================================
--- /trunk/glueforge/templates/psdb/popfits_h.tt	(revision 3912)
+++ /trunk/glueforge/templates/psdb/popfits_h.tt	(revision 3912)
@@ -0,0 +1,13 @@
+/** Removes the last N row from the database and returns them in a binary FITS table.
+ *
+ * This function assumes an empty psFits object and will create a FITS table as
+ * the first extension. 
+ *
+ * @return true on success
+ */
+
+bool [% namespace %]PopFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    psS64           n                   ///< number of rows to return
+);
