Index: trunk/psLib/src/sys/psLine.c
===================================================================
--- trunk/psLib/src/sys/psLine.c	(revision 7879)
+++ trunk/psLib/src/sys/psLine.c	(revision 7901)
@@ -39,5 +39,7 @@
 }
 
-bool psLineAdd(psLine *line, const char *format, ...)
+bool psLineAdd(psLine *line,
+               const char *format,
+               ...)
 {
     if (!line) {
@@ -58,2 +60,11 @@
     return true;
 }
+
+bool psMemCheckLine(psPtr ptr)
+{
+    if (!is_psType(ptr)) {
+        return false;
+    }
+    return ( psMemGetDeallocator(ptr) == (psFreeFunc)lineFree );
+}
+
Index: trunk/psLib/src/sys/psLine.h
===================================================================
--- trunk/psLib/src/sys/psLine.h	(revision 7879)
+++ trunk/psLib/src/sys/psLine.h	(revision 7901)
@@ -1,9 +1,26 @@
 /** @file  psLine.h
  *
- * the psLine functions allow manipulation of fixed-length lines
+ *
+ *  @brief Contains the declarations of line utility functions
+ *
+ *  @ingroup SysUtils
+ *
+ *  The psLine functions allow manipulation of fixed-length lines.
+ *
+ *  @author Paul Price, IFA
+ *  @author David Robbins, MHPCC
+ *
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-14 02:26:25 $
+ *
+ *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  */
 
 #ifndef PS_LINE_H
 #define PS_LINE_H
+
+/** @addtogroup SysUtils
+ *  @{
+ */
 
 /** Structure to carry a dynamic string */
@@ -16,10 +33,20 @@
 psLine;
 
-/** Allocates a line object of length Nline
+/** Allocates a line object of length Nline.
  *
  *  @return psLine*:        the newly allocated line object.
 */
 psLine *psLineAlloc(
-    long Nline                         ///<
+    long Nline                         ///< length of line object to allocate
+);
+
+/** Checks the type of a particular pointer.
+ *
+ *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
+ *
+ *  @return bool:       True if the pointer matches a psLine structure, false otherwise.
+ */
+bool psMemCheckLine(
+    psPtr ptr                          ///< the pointer whose type to check
 );
 
@@ -32,5 +59,5 @@
 */
 bool psLineInit(
-    psLine *line                       ///<
+    psLine *line                       ///< line to (re-)initialize
 );
 
Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 7879)
+++ trunk/psLib/src/sys/psMemory.c	(revision 7901)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-06-21 21:40:12 $
+*  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-07-14 02:26:25 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,25 +24,13 @@
 #include "psAbort.h"
 #include "psLogMsg.h"
-
 #include "psBitSet.h"
-//#include "psArray.h"
-//#include "psImage.h"
-//#include "psList.h"
-//#include "psLookupTable.h"
-//#include "psHash.h"
-
-//#include "psMetadata.h"
 #include "psFits.h"
 #include "psPixels.h"
-//#include "psScalar.h"
-//#include "psVector.h"
-//#include "psTime.h"
-//#include "psCoord.h"
 #include "psSphereOps.h"
-//#include "psStats.h"
 #include "psMinimizeLMM.h"
 #include "psImageConvolve.h"
 #include "psTime.h"
-
+#include "psLine.h"
+#include "psRegion.h"
 #include "psErrorText.h"
 
@@ -837,7 +825,24 @@
 }
 
+bool is_psType(psPtr ptr)
+{
+    if (ptr == NULL) {
+        return false;
+    }
+    psMemBlock* m = ((psMemBlock* ) ptr) - 1;
+    if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
+        return false; //Probably not a psAllocated-Type
+    } else {
+        return true;
+    }
+}
+
 bool psMemCheckType(psDataType type,
                     psPtr ptr)
 {
+    if (!is_psType(ptr)) {
+        return false;
+    }
+
     switch(type) {
     case PS_DATA_ARRAY:
@@ -905,4 +910,12 @@
             break;
         }
+    case PS_DATA_LINE:
+        if ( psMemCheckLine(ptr) )
+            return true;
+        else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                    "Incorrect pointer.  Datatypes do not match.\n");
+            break;
+        }
     case PS_DATA_LIST:
         if ( psMemCheckList(ptr) )
@@ -1017,4 +1030,12 @@
             break;
         }
+    case PS_DATA_REGION:
+        if ( psMemCheckRegion(ptr) )
+            return true;
+        else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                    "Incorrect pointer.  Datatypes do not match.\n");
+            break;
+        }
     case PS_DATA_SCALAR:
         if ( psMemCheckScalar(ptr) )
@@ -1051,4 +1072,12 @@
     case PS_DATA_STATS:
         if ( psMemCheckStats(ptr) )
+            return true;
+        else {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                    "Incorrect pointer.  Datatypes do not match.\n");
+            break;
+        }
+    case PS_DATA_STRING:
+        if ( psMemCheckString(ptr) )
             return true;
         else {
Index: trunk/psLib/src/sys/psMemory.h
===================================================================
--- trunk/psLib/src/sys/psMemory.h	(revision 7879)
+++ trunk/psLib/src/sys/psMemory.h	(revision 7901)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-21 21:40:12 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-14 02:26:25 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -172,4 +172,8 @@
 );
 
+bool is_psType(
+    psPtr ptr
+);
+
 /** Checks the deallocator to see if the pointer matches the desired datatype.
  *
Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 7879)
+++ trunk/psLib/src/sys/psString.c	(revision 7901)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-07-12 21:17:51 $
+ *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-14 02:26:25 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -30,4 +30,27 @@
 #include "psErrorText.h"
 
+static void stringFree(psString string)
+{
+    // There is non dynamic allocated item
+}
+
+psString psStringAlloc(long nChar)
+{
+    if (nChar < 1) {
+        return NULL;
+    }
+    psString string = psAlloc(nChar + 1);
+    psMemSetDeallocator(string, (psFreeFunc)stringFree);
+    return string;
+}
+
+bool psMemCheckString(psPtr ptr)
+{
+    if (!is_psType(ptr)) {
+        return false;
+    }
+    return ( psMemGetDeallocator(ptr) == (psFreeFunc)stringFree );
+}
+
 psString psStringCopy(const char *string)
 {
@@ -231,4 +254,8 @@
         return input;
     }
+    if (!psMemCheckString(input)) {
+        return input;
+    }
+
 
     // replace == NULL is valid: it just means that we strip out the key
Index: trunk/psLib/src/sys/psString.h
===================================================================
--- trunk/psLib/src/sys/psString.h	(revision 7879)
+++ trunk/psLib/src/sys/psString.h	(revision 7901)
@@ -14,6 +14,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-07-10 20:15:43 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-14 02:26:25 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -39,4 +39,22 @@
  *  @{
  */
+
+/** Allocates a new psString.
+ *
+ *  @return psString:       Newly allocated string of length n.
+ */
+psString psStringAlloc(
+    long nChar                         ///< Size of psString to allocate.
+);
+
+/** Checks the type of a particular pointer.
+ *
+ *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
+ *
+ *  @return bool:       True if the pointer matches a psString structure, false otherwise.
+ */
+bool psMemCheckString(
+    psPtr ptr                          ///< the pointer whose type to check
+);
 
 /** Copies the input string
@@ -145,5 +163,4 @@
 );
 
-
 /** @} */// Doxygen - End of SystemGroup Functions
 
Index: trunk/psLib/src/sys/psType.h
===================================================================
--- trunk/psLib/src/sys/psType.h	(revision 7879)
+++ trunk/psLib/src/sys/psType.h	(revision 7901)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-06-10 02:28:17 $
+*  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-07-14 02:26:25 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -118,4 +118,5 @@
     PS_DATA_IMAGE,                     ///< psImage
     PS_DATA_KERNEL,                    ///< psKernel
+    PS_DATA_LINE,                      ///< psLine
     PS_DATA_LIST,                      ///< psList
     PS_DATA_LOOKUPTABLE,               ///< psLookupTable
