Index: trunk/psLib/src/psErrorCodes_en.dat
===================================================================
--- trunk/psLib/src/psErrorCodes_en.dat	(revision 12588)
+++ trunk/psLib/src/psErrorCodes_en.dat	(revision 12596)
@@ -20,4 +20,5 @@
 BAD_FITS		       file doesn't obey FITS standard
 IEEE			       a NaN or Inf was detected
-DB_CLIENT                       Database error originated in the client library
-DB_SERVER                       Database error generated by the server
+DB_CLIENT                      Database error originated in the client library
+DB_SERVER                      Database error generated by the server
+PROGRAMMING                    Known programming error
Index: trunk/psLib/src/sys/psAssert.h
===================================================================
--- trunk/psLib/src/sys/psAssert.h	(revision 12588)
+++ trunk/psLib/src/sys/psAssert.h	(revision 12596)
@@ -12,4 +12,11 @@
 #include "psError.h"
 #include "psLogMsg.h"
+
+// these two asserts can be used in the middle of a function to test for programming errors
+#define PS_ASSERT(VAR, RVAL) \
+if (!(VAR)) { \
+    psError(PS_ERR_PROGRAMMING, false, "Error: %s is not true.", #VAR); \
+    return(RVAL); \
+}
 
 // Ensure this is a psLib pointer, by checking for the memblock bounds.
@@ -35,4 +42,12 @@
 }
 
+#define PS_ASSERT_INT_UNEQUAL(NAME1, NAME2, RVAL) \
+if ((NAME1) == (NAME2)) { \
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
+            "Error: %s and %s are equal.", \
+            #NAME1, #NAME2); \
+    return(RVAL); \
+}
+
 #define PS_ASSERT_INT_EQUAL(NAME1, NAME2, RVAL) \
 if ((NAME1) != (NAME2)) { \
