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
