Index: trunk/ppSub/src/ppSub.h
===================================================================
--- trunk/ppSub/src/ppSub.h	(revision 20611)
+++ trunk/ppSub/src/ppSub.h	(revision 21257)
@@ -1,4 +1,15 @@
 #ifndef PP_SUB_H
 #define PP_SUB_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <pslib.h>
+#include <psmodules.h>
+#include <psphot.h>
+#include <ppStats.h>
 
 #define PPSUB_RECIPE "PPSUB"            /// Name of the recipe to use
@@ -6,5 +17,5 @@
 /// Setup the arguments parsing
 bool ppSubArgumentsSetup(int argc, char *argv[], ///< Command-line arguments
-                    pmConfig *config    ///< Configuration
+			 pmConfig *config    ///< Configuration
     );
 
@@ -27,7 +38,51 @@
     );
 
+/// generate (if needed) and set or update the masks for input and reference images
+bool ppSubSetMasks (pmConfig *config,	  ///< Configuration
+		    const pmFPAview *view ///< View of active readout
+    );
+
+/// Generate the PSF-matching kernel and convolve the images as needed.  Most of this function
+/// involves looking up the parameters in the recipe and supplying them to the function
+/// pmSubtractionMatch()
+bool ppSubMatchPSFs (pmConfig *config,	  ///< Configuration
+		     const pmFPAview *view ///< View of active readout
+    );
+
+/// generate the output readout and pass the kernel info to the header 
+bool ppSubDefineOutput(pmConfig *config,	  ///< Configuration
+		       const pmFPAview *view ///< View of active readout
+    );
+
+/// Calculate the variance factor for the output image based on the input images
+bool ppSubVarianceFactors(pmConfig *config,	  ///< Configuration
+			  psMetadata *stats,    ///< Statistics, for output
+			  const pmFPAview *view ///< View of active readout
+    );
+
+/// Photometry stage 1: measure the PSF from the minuend image 
+bool ppSubMakePSF(pmConfig *config,	  ///< Configuration
+		  const pmFPAview *view ///< View of active readout
+    );
+
+/// Perform the actual image subtraction, update output concepts
+bool ppSubReadoutSubtract(pmConfig *config,	  ///< Configuration
+			  const pmFPAview *view ///< View of active readout
+    );
+
+
+/// Photometry stage 2: find and measure sources on the subtracted image
+bool ppSubReadoutPhotometry(pmConfig *config,	  ///< Configuration
+			    psMetadata *stats,    ///< Statistics, for output
+			    const pmFPAview *view ///< View of active readout
+    );
+
+/// Renormalize, update headers and generate JPEGs
+bool ppSubReadoutUpdate(pmConfig *config,	  ///< Configuration
+			const pmFPAview *view ///< View of active readout
+    );
+
 /// Higher-order background subtraction
-bool ppSubBackground(pmReadout *ro,     ///< Readout of interest
-                     pmConfig *config,  ///< Configuration
+bool ppSubBackground(pmConfig *config,  ///< Configuration
                      const pmFPAview *view ///< View to readout
     );
@@ -37,4 +92,26 @@
     );
 
+/// Generate and Set the masks if needed
+bool ppSubSetMasks (
+    pmConfig *config,			///< Configuration
+    const pmFPAview *view 		///< view to readout
+    );
+
+/// Renormalize readout for peak pixels
+bool ppSubReadoutRenormPixels (
+    pmConfig *config, 			///< Configuration
+    psMetadata *recipe, 			///< Recipe
+    pmReadout *readout			///< Readout
+    );
+
+/// Renormalize readout for photometry analysis
+bool ppSubReadoutRenormPhot (
+    pmConfig *config, 			///< Configuration
+    psMetadata *recipe, 			///< Recipe
+    pmReadout *readout			///< Readout
+    );
+
+// Copy every instance of a single keyword from one metadata to another
+bool psMetadataCopySingle(psMetadata *target, psMetadata *source, const char *name);
 
 #endif
