Index: /trunk/ppImage/src/ppImageErrorCodes.c.in
===================================================================
--- /trunk/ppImage/src/ppImageErrorCodes.c.in	(revision 11259)
+++ /trunk/ppImage/src/ppImageErrorCodes.c.in	(revision 11259)
@@ -0,0 +1,26 @@
+/*
+ * The line
+    { PPIMAGE_ERR_$X{ErrorCode}, "$X{ErrorDescription}"},
+ * (without the Xs)
+ * will be replaced by values from errorCodes.dat
+ */
+#include "pslib.h"
+#include "ppImageErrorCodes.h"
+
+void ppImageErrorRegister(void)
+{
+    static psErrorDescription errors[] = {
+       { PPIMAGE_ERR_BASE, "First value we use; lower values belong to psLib" },
+       { PPIMAGE_ERR_${ErrorCode}, "${ErrorDescription}"},
+    };
+    static int nerror = PPIMAGE_ERR_NERROR - PPIMAGE_ERR_BASE; // number of values in enum
+
+    for (int i = 0; i < nerror; i++) {
+       psErrorDescription *tmp = psAlloc(sizeof(psErrorDescription));
+       p_psMemSetPersistent(tmp, true);
+       *tmp = errors[i];
+       psErrorRegister(tmp, 1);
+       psFree(tmp);			/* it's on the internal list */
+    }
+    nerror = 0;			                // don't register more than once
+}
Index: /trunk/ppImage/src/ppImageErrorCodes.dat
===================================================================
--- /trunk/ppImage/src/ppImageErrorCodes.dat	(revision 11259)
+++ /trunk/ppImage/src/ppImageErrorCodes.dat	(revision 11259)
@@ -0,0 +1,10 @@
+#
+# This file is used to generate ppImageErrorClasses.h
+#
+BASE = 500		First value we use; lower values belong to psLib
+# these errors correspond to standard exit conditions
+ARGUMENTS               Incorrect arguments
+SYS                     System error
+CONFIG                  Problem in configure files
+PROG                    Programming error
+DATA                    invalid data
Index: /trunk/ppImage/src/ppImageErrorCodes.h.in
===================================================================
--- /trunk/ppImage/src/ppImageErrorCodes.h.in	(revision 11259)
+++ /trunk/ppImage/src/ppImageErrorCodes.h.in	(revision 11259)
@@ -0,0 +1,18 @@
+#if !defined(PPIMAGE_ERROR_CODES_H)
+#define PPIMAGE_ERROR_CODES_H
+/*
+ * The line
+ *  PPIMAGE_ERR_$X{ErrorCode},
+ * (without the X)
+ *
+ * will be replaced by values from errorCodes.dat
+ */
+typedef enum {
+    PPIMAGE_ERR_BASE = 512,
+    PPIMAGE_ERR_${ErrorCode},
+    PPIMAGE_ERR_NERROR
+} ppImageErrorCode;
+
+void ppImageErrorRegister(void);
+
+#endif
Index: /trunk/ppMerge/src/ppMergeErrorCodes.c.in
===================================================================
--- /trunk/ppMerge/src/ppMergeErrorCodes.c.in	(revision 11259)
+++ /trunk/ppMerge/src/ppMergeErrorCodes.c.in	(revision 11259)
@@ -0,0 +1,26 @@
+/*
+ * The line
+    { PPMERGE_ERR_$X{ErrorCode}, "$X{ErrorDescription}"},
+ * (without the Xs)
+ * will be replaced by values from errorCodes.dat
+ */
+#include "pslib.h"
+#include "ppMergeErrorCodes.h"
+
+void ppMergeErrorRegister(void)
+{
+    static psErrorDescription errors[] = {
+       { PPMERGE_ERR_BASE, "First value we use; lower values belong to psLib" },
+       { PPMERGE_ERR_${ErrorCode}, "${ErrorDescription}"},
+    };
+    static int nerror = PPMERGE_ERR_NERROR - PPMERGE_ERR_BASE; // number of values in enum
+
+    for (int i = 0; i < nerror; i++) {
+       psErrorDescription *tmp = psAlloc(sizeof(psErrorDescription));
+       p_psMemSetPersistent(tmp, true);
+       *tmp = errors[i];
+       psErrorRegister(tmp, 1);
+       psFree(tmp);			/* it's on the internal list */
+    }
+    nerror = 0;			                // don't register more than once
+}
Index: /trunk/ppMerge/src/ppMergeErrorCodes.dat
===================================================================
--- /trunk/ppMerge/src/ppMergeErrorCodes.dat	(revision 11259)
+++ /trunk/ppMerge/src/ppMergeErrorCodes.dat	(revision 11259)
@@ -0,0 +1,10 @@
+#
+# This file is used to generate ppMergeErrorClasses.h
+#
+BASE = 700		First value we use; lower values belong to psLib
+# these errors correspond to standard exit conditions
+ARGUMENTS               Incorrect arguments
+SYS                     System error
+CONFIG                  Problem in configure files
+PROG                    Programming error
+DATA                    invalid data
Index: /trunk/ppNorm/src/ppNormErrorCodes.c.in
===================================================================
--- /trunk/ppNorm/src/ppNormErrorCodes.c.in	(revision 11259)
+++ /trunk/ppNorm/src/ppNormErrorCodes.c.in	(revision 11259)
@@ -0,0 +1,26 @@
+/*
+ * The line
+    { PPNORM_ERR_$X{ErrorCode}, "$X{ErrorDescription}"},
+ * (without the Xs)
+ * will be replaced by values from errorCodes.dat
+ */
+#include "pslib.h"
+#include "ppNormErrorCodes.h"
+
+void ppNormErrorRegister(void)
+{
+    static psErrorDescription errors[] = {
+       { PPNORM_ERR_BASE, "First value we use; lower values belong to psLib" },
+       { PPNORM_ERR_${ErrorCode}, "${ErrorDescription}"},
+    };
+    static int nerror = PPNORM_ERR_NERROR - PPNORM_ERR_BASE; // number of values in enum
+
+    for (int i = 0; i < nerror; i++) {
+       psErrorDescription *tmp = psAlloc(sizeof(psErrorDescription));
+       p_psMemSetPersistent(tmp, true);
+       *tmp = errors[i];
+       psErrorRegister(tmp, 1);
+       psFree(tmp);			/* it's on the internal list */
+    }
+    nerror = 0;			                // don't register more than once
+}
Index: /trunk/ppNorm/src/ppNormErrorCodes.dat
===================================================================
--- /trunk/ppNorm/src/ppNormErrorCodes.dat	(revision 11259)
+++ /trunk/ppNorm/src/ppNormErrorCodes.dat	(revision 11259)
@@ -0,0 +1,10 @@
+#
+# This file is used to generate ppNormErrorClasses.h
+#
+BASE = 600		First value we use; lower values belong to psLib
+# these errors correspond to standard exit conditions
+ARGUMENTS               Incorrect arguments
+SYS                     System error
+CONFIG                  Problem in configure files
+PROG                    Programming error
+DATA                    invalid data
Index: /trunk/ppNorm/src/ppNormErrorCodes.h.in
===================================================================
--- /trunk/ppNorm/src/ppNormErrorCodes.h.in	(revision 11259)
+++ /trunk/ppNorm/src/ppNormErrorCodes.h.in	(revision 11259)
@@ -0,0 +1,18 @@
+#if !defined(PPNORM_ERROR_CODES_H)
+#define PPNORM_ERROR_CODES_H
+/*
+ * The line
+ *  PPNORM_ERR_$X{ErrorCode},
+ * (without the X)
+ *
+ * will be replaced by values from errorCodes.dat
+ */
+typedef enum {
+    PPNORM_ERR_BASE = 512,
+    PPNORM_ERR_${ErrorCode},
+    PPNORM_ERR_NERROR
+} ppNormErrorCode;
+
+void ppNormErrorRegister(void);
+
+#endif
Index: /trunk/ppStac/src/ppStacErrorCodes.c.in
===================================================================
--- /trunk/ppStac/src/ppStacErrorCodes.c.in	(revision 11259)
+++ /trunk/ppStac/src/ppStacErrorCodes.c.in	(revision 11259)
@@ -0,0 +1,26 @@
+/*
+ * The line
+    { PPSTAC_ERR_$X{ErrorCode}, "$X{ErrorDescription}"},
+ * (without the Xs)
+ * will be replaced by values from errorCodes.dat
+ */
+#include "pslib.h"
+#include "ppStacErrorCodes.h"
+
+void ppStacErrorRegister(void)
+{
+    static psErrorDescription errors[] = {
+       { PPSTAC_ERR_BASE, "First value we use; lower values belong to psLib" },
+       { PPSTAC_ERR_${ErrorCode}, "${ErrorDescription}"},
+    };
+    static int nerror = PPSTAC_ERR_NERROR - PPSTAC_ERR_BASE; // number of values in enum
+
+    for (int i = 0; i < nerror; i++) {
+       psErrorDescription *tmp = psAlloc(sizeof(psErrorDescription));
+       p_psMemSetPersistent(tmp, true);
+       *tmp = errors[i];
+       psErrorRegister(tmp, 1);
+       psFree(tmp);			/* it's on the internal list */
+    }
+    nerror = 0;			                // don't register more than once
+}
Index: /trunk/ppStac/src/ppStacErrorCodes.dat
===================================================================
--- /trunk/ppStac/src/ppStacErrorCodes.dat	(revision 11259)
+++ /trunk/ppStac/src/ppStacErrorCodes.dat	(revision 11259)
@@ -0,0 +1,10 @@
+#
+# This file is used to generate ppStacErrorClasses.h
+#
+BASE = 800		First value we use; lower values belong to psLib
+UNKNOWN			Unknown PM error code
+NOT_IMPLEMENTED		Desired feature is not yet implemented
+ARGUMENTS		Incorrect arguments
+CONFIG			Problem in configure files
+IO			Problem in FITS I/O
+DATA                    Problem in data values
Index: /trunk/ppStac/src/ppStacErrorCodes.h.in
===================================================================
--- /trunk/ppStac/src/ppStacErrorCodes.h.in	(revision 11259)
+++ /trunk/ppStac/src/ppStacErrorCodes.h.in	(revision 11259)
@@ -0,0 +1,18 @@
+#if !defined(PPSTAC_ERROR_CODES_H)
+#define PPSTAC_ERROR_CODES_H
+/*
+ * The line
+ *  PPSTAC_ERR_$X{ErrorCode},
+ * (without the X)
+ *
+ * will be replaced by values from errorCodes.dat
+ */
+typedef enum {
+    PPSTAC_ERR_BASE = 512,
+    PPSTAC_ERR_${ErrorCode},
+    PPSTAC_ERR_NERROR
+} ppStacErrorCode;
+
+void ppStacErrorRegister(void);
+
+#endif
Index: /trunk/ppStats/src/ppStatsErrorCodes.c.in
===================================================================
--- /trunk/ppStats/src/ppStatsErrorCodes.c.in	(revision 11259)
+++ /trunk/ppStats/src/ppStatsErrorCodes.c.in	(revision 11259)
@@ -0,0 +1,26 @@
+/*
+ * The line
+    { PPSTATS_ERR_$X{ErrorCode}, "$X{ErrorDescription}"},
+ * (without the Xs)
+ * will be replaced by values from errorCodes.dat
+ */
+#include "pslib.h"
+#include "ppStatsErrorCodes.h"
+
+void ppStatsErrorRegister(void)
+{
+    static psErrorDescription errors[] = {
+       { PPSTATS_ERR_BASE, "First value we use; lower values belong to psLib" },
+       { PPSTATS_ERR_${ErrorCode}, "${ErrorDescription}"},
+    };
+    static int nerror = PPSTATS_ERR_NERROR - PPSTATS_ERR_BASE; // number of values in enum
+
+    for (int i = 0; i < nerror; i++) {
+       psErrorDescription *tmp = psAlloc(sizeof(psErrorDescription));
+       p_psMemSetPersistent(tmp, true);
+       *tmp = errors[i];
+       psErrorRegister(tmp, 1);
+       psFree(tmp);			/* it's on the internal list */
+    }
+    nerror = 0;			                // don't register more than once
+}
Index: /trunk/ppStats/src/ppStatsErrorCodes.dat
===================================================================
--- /trunk/ppStats/src/ppStatsErrorCodes.dat	(revision 11259)
+++ /trunk/ppStats/src/ppStatsErrorCodes.dat	(revision 11259)
@@ -0,0 +1,10 @@
+#
+# This file is used to generate ppStatsErrorClasses.h
+#
+BASE = 400		First value we use; lower values belong to psLib
+# these errors correspond to standard exit conditions
+ARGUMENTS               Incorrect arguments
+SYS                     System error
+CONFIG                  Problem in configure files
+PROG                    Programming error
+DATA                    invalid data
Index: /trunk/ppStats/src/ppStatsErrorCodes.h.in
===================================================================
--- /trunk/ppStats/src/ppStatsErrorCodes.h.in	(revision 11259)
+++ /trunk/ppStats/src/ppStatsErrorCodes.h.in	(revision 11259)
@@ -0,0 +1,18 @@
+#if !defined(PPSTATS_ERROR_CODES_H)
+#define PPSTATS_ERROR_CODES_H
+/*
+ * The line
+ *  PPSTATS_ERR_$X{ErrorCode},
+ * (without the X)
+ *
+ * will be replaced by values from errorCodes.dat
+ */
+typedef enum {
+    PPSTATS_ERR_BASE = 512,
+    PPSTATS_ERR_${ErrorCode},
+    PPSTATS_ERR_NERROR
+} ppStatsErrorCode;
+
+void ppStatsErrorRegister(void);
+
+#endif
