Index: branches/pap/ppSub/src/ppSub.h
===================================================================
--- branches/pap/ppSub/src/ppSub.h	(revision 23599)
+++ branches/pap/ppSub/src/ppSub.h	(revision 23672)
@@ -22,4 +22,20 @@
 #define PPSUB_RECIPE "PPSUB"            /// Name of the recipe to use
 
+// Output files, for activation/deactivation
+typedef enum {
+    PPSUB_FILES_IMAGE = 0x01,           // Image files
+    PPSUB_FILES_PHOT  = 0x02,           // Photometry files
+    PPSUB_FILES_ALL   = 0xFF,           // All files
+} ppSubFiles;
+
+/// Data for processing
+typedef struct {
+    psErrorCode quality;                /// Quality code; 0 for no problem
+    psMetadata *stats;                  /// Statistics
+} ppSubData;
+
+/// Constructor
+ppSubData *ppSubDataAlloc(void);
+
 /// Setup the arguments parsing
 bool ppSubArgumentsSetup(int argc, char *argv[], ///< Command-line arguments
@@ -41,5 +57,5 @@
 /// Perform PSF-matched image subtraction on the readout
 bool ppSubReadout(pmConfig *config,     ///< Configuration
-                  psMetadata *stats,    ///< Statistics, for output
+                  ppSubData *data,      ///< Processing data
                   const pmFPAview *view ///< View of readout to subtract
     );
@@ -53,4 +69,5 @@
 /// looking up the parameters in the recipe and supplying them to the function pmSubtractionMatch()
 bool ppSubMatchPSFs(pmConfig *config,    ///< Configuration
+                    ppSubData *data,    ///< Processing data
                     const pmFPAview *view ///< View of active readout
     );
@@ -63,5 +80,5 @@
 /// Photometry stage 1: measure the PSF from the minuend image
 bool ppSubMakePSF(pmConfig *config,       ///< Configuration
-                  psMetadata *stats,    ///< Statistics, for output
+                  ppSubData *data,    ///< Processing data
                   const pmFPAview *view ///< View of active readout
     );
@@ -75,5 +92,5 @@
 /// Photometry stage 2: find and measure sources on the subtracted image
 bool ppSubReadoutPhotometry(pmConfig *config,     ///< Configuration
-                            psMetadata *stats,    ///< Statistics, for output
+                            ppSubData *data,    ///< Processing data
                             const pmFPAview *view ///< View of active readout
     );
@@ -81,5 +98,5 @@
 /// Renormalize, update headers and generate JPEGs
 bool ppSubReadoutUpdate(pmConfig *config, ///< Configuration
-                        psMetadata *stats, ///< Statistics for output, or NULL
+                        ppSubData *data,    ///< Processing data
                         const pmFPAview *view ///< View of active readout
     );
@@ -97,4 +114,10 @@
 void ppSubVersionPrint(void);
 
+/// Mark the data quality as bad and prepare to suspend processing
+void ppSubDataQuality(pmConfig *config, ///< Configuration
+                      ppSubData *data,  ///< Processing data
+                      psErrorCode error,///< Error code
+                      ppSubFiles files  ///< Files to deactivate
+    );
 
 // Copy every instance of a single keyword from one metadata to another
