Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 11710)
+++ trunk/psLib/src/sys/psString.c	(revision 11711)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-07 23:52:54 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-08 22:27:30 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -33,27 +33,38 @@
 #include "psMemory.h"
 
-
 static void stringFree(psString string)
 {
-    // There is non dynamic allocated item
-}
-
-psString psStringAlloc(long nChar)
+    // this function is only nessicary so psMemCheckString has a function
+    // pointer address to test against
+}
+
+
+psString p_psStringAlloc(const char *file,
+                         unsigned int lineno,
+                         const char *func,
+                         long nChar)
 {
     if (nChar < 1) {
         return NULL;
     }
-    psString string = psAlloc(nChar + 1);
+
+    psString string = p_psAlloc(file, lineno, func, nChar + 1);
     psMemSetDeallocator(string, (psFreeFunc)stringFree);
+
     return string;
 }
 
+
 bool psMemCheckString(psPtr ptr)
 {
     PS_ASSERT_PTR(ptr, false);
-    return ( psMemGetDeallocator(ptr) == (psFreeFunc)stringFree );
-}
-
-psString psStringCopy(const char *string)
+    return (psMemGetDeallocator(ptr) == (psFreeFunc)stringFree);
+}
+
+
+psString p_psStringCopy(const char *file,
+                        unsigned int lineno,
+                        const char *func,
+                        const char *string)
 {
     // Pass through NULL values!
@@ -61,11 +72,18 @@
         return NULL;
     }
-    psString output = psStringAlloc(strlen(string) + 1); // Output string
+
+    // Output string
+    psString output = p_psStringAlloc(file, lineno, func, strlen(string) + 1);
+
     // Copy input string to memory just allocated
     return strcpy(output, string);
 }
 
-psString psStringNCopy(const char *string,
-                       unsigned int nChar)
+
+psString p_psStringNCopy(const char *file,
+                         unsigned int lineno,
+                         const char *func,
+                         const char *string,
+                         unsigned int nChar)
 {
     PS_ASSERT_PTR_NON_NULL(string, NULL);
@@ -86,5 +104,5 @@
 
     // Copy input string to memory allocated up to nChar characters
-    psString output = psStringAlloc((size_t) nChar + 1);
+    psString output = p_psStringAlloc(file, lineno, func, (size_t) nChar + 1);
     output = strncpy(output, string, (size_t) nChar);
 
@@ -96,7 +114,11 @@
 }
 
-ssize_t psStringAppend(char **dest,
-                       const char *format,
-                       ...)
+
+ssize_t p_psStringAppend(const char *file,
+                         unsigned int lineno,
+                         const char *func,
+                         char **dest,
+                         const char *format,
+                         ...)
 {
     PS_ASSERT_PTR_NON_NULL(dest, 0);
@@ -105,5 +127,5 @@
     va_list ap;
     va_start(ap, format);
-    ssize_t length = psStringAppendV(dest, format, ap);
+    ssize_t length = p_psStringAppendV(file, lineno, func, dest, format, ap);
     va_end(ap);
 
@@ -111,7 +133,10 @@
 }
 
-ssize_t psStringAppendV(char **dest,
-                        const char *format,
-                        va_list ap)
+ssize_t p_psStringAppendV(const char *file,
+                          unsigned int lineno,
+                          const char *func,
+                          char **dest,
+                          const char *format,
+                          va_list ap)
 {
     PS_ASSERT_PTR_NON_NULL(dest, 0);
@@ -144,7 +169,7 @@
     // realloc string to string + tail + \0
     if (*dest) {
-        *dest = psRealloc(*dest, oldLength + tailLength + 1);
+        *dest = p_psRealloc(file, lineno, func, *dest, oldLength + tailLength + 1);
     } else {
-        *dest = psStringAlloc(oldLength + tailLength + 1);
+        *dest = p_psStringAlloc(file, lineno, func, oldLength + tailLength + 1);
     }
 
@@ -160,7 +185,11 @@
 }
 
-ssize_t psStringPrepend(char **dest,
-                        const char *format,
-                        ...)
+
+ssize_t p_psStringPrepend(const char *file,
+                          unsigned int lineno,
+                          const char *func,
+                          char **dest,
+                          const char *format,
+                          ...)
 {
     PS_ASSERT_PTR_NON_NULL(dest, 0);
@@ -169,5 +198,5 @@
     va_list ap;
     va_start(ap, format);
-    ssize_t length = psStringPrependV(dest, format, ap);
+    ssize_t length = p_psStringPrependV(file, lineno, func, dest, format, ap);
     va_end(ap);
 
@@ -175,7 +204,11 @@
 }
 
-ssize_t psStringPrependV(char **dest,
-                         const char *format,
-                         va_list ap)
+
+ssize_t p_psStringPrependV(const char *file,
+                           unsigned int lineno,
+                           const char *func,
+                           char **dest,
+                           const char *format,
+                           va_list ap)
 {
     PS_ASSERT_PTR_NON_NULL(dest, 0);
@@ -188,5 +221,5 @@
     if (!*dest) {
         // makes the string backup and concatination pointless
-        *dest = psStringCopy("");
+        *dest = p_psStringCopy(file, lineno, func, "");
         length = 0;
     } else {
@@ -210,5 +243,5 @@
 
     // backup original string
-    oldDest = psStringCopy(*dest);
+    oldDest = p_psStringCopy(file, lineno, func, *dest);
 
     // new string length (sans \0)
@@ -216,5 +249,5 @@
 
     // realloc string to head + string + \0
-    *dest = psRealloc(*dest, length + 1);
+    *dest = p_psRealloc(file, lineno, func, *dest, length + 1);
 
     // copy the new head to the beginning of string
@@ -234,4 +267,5 @@
 }
 
+
 // split the string by the given splitters
 // NULL input string returns empty (not NULL) list
@@ -276,4 +310,5 @@
     return values;
 }
+
 
 // given the input string, search for all copies of the key, and replace with the replacement value
@@ -343,4 +378,5 @@
 }
 
+
 psArray *psStringSplitArray(const char *string, const char *splitters, bool multi)
 {
@@ -352,4 +388,5 @@
 }
 
+
 #ifndef whitespace
 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
@@ -376,4 +413,6 @@
     return i;
 }
+
+
 /*
  * Used by PS_FILE_LINE
Index: trunk/psLib/src/sys/psString.h
===================================================================
--- trunk/psLib/src/sys/psString.h	(revision 11710)
+++ trunk/psLib/src/sys/psString.h	(revision 11711)
@@ -11,6 +11,6 @@
  * @author Joshua Hoblitt, University of Hawaii
  *
- * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-02-08 01:59:28 $
+ * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-02-08 22:27:30 $
  *
  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -39,11 +39,23 @@
 #define PS_FILE_LINE p_psFileLine(__FILE__,__LINE__)
 
+
 /** Allocates a new psString.
  *
  *  @return psString:       Newly allocated string of length n.
  */
+#ifdef DOXYGEN
 psString psStringAlloc(
     long nChar                         ///< Size of psString to allocate.
 );
+#else // ifdef DOXYGEN
+psString p_psStringAlloc(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    long nChar                         ///< Size of psString to allocate.
+);
+#define psStringAlloc(nChar) \
+      p_psStringAlloc(__FILE__, __LINE__, __func__, nChar)
+#endif // ifdef DOXYGEN
 
 
@@ -68,7 +80,18 @@
  *  @return psString:      Copy of input string
  */
+#ifdef DOXYGEN
 psString psStringCopy(
-    const char *string                 ///< Input string of characters to copy
-);
+    const char *string                  ///< Input string of characters to copy
+);
+#else // ifdef DOXYGEN
+psString p_psStringCopy(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    const char *string                  ///< Input string of characters to copy
+);
+#define psStringCopy(string) \
+      p_psStringCopy(__FILE__, __LINE__, __func__, string)
+#endif // ifdef DOXYGEN
 
 
@@ -85,8 +108,20 @@
  *  @return  psString:   Copy of input string
  */
+#ifdef DOXYGEN
 psString psStringNCopy(
     const char *string,                ///< Input string of characters to copy
     unsigned int nChar                 ///< Number of bytes to allocate for string copy
 );
+#else // ifdef DOXYGEN
+psString p_psStringNCopy(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    const char *string,                 ///< Input string of characters to copy
+    unsigned int nChar                  ///< Number of bytes to allocate for string copy
+);
+#define psStringNCopy(string, nChar) \
+      p_psStringNCopy(__FILE__, __LINE__, __func__, string, nChar)
+#endif // ifdef DOXYGEN
 
 
@@ -98,13 +133,26 @@
  * @return ssize_t:     The length of the new string (excluding '\0')
  */
+#ifdef DOXYGEN
 ssize_t psStringAppend(
+    char **dest,                        ///< existing string
+    const char *format,                 ///< format to append
+    ...                                 ///< format arguments
+);
+#else // ifdef DOXYGEN
+ssize_t p_psStringAppend(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
     char **dest,                        ///< existing string
     const char *format,                 ///< format to append
     ...                                 ///< format arguments
 #ifdef __GNUC__
-) __attribute__((format(printf, 2, 3)));
-#else // __GNUC__
-);
-#endif // __GNUC__
+) __attribute__((format(printf, 5, 6)));
+#else // ifdef __GNUC__
+);
+#endif // ifdef __GNUC__
+#define psStringAppend(dest, ...) \
+      p_psStringAppend(__FILE__, __LINE__, __func__, dest, __VA_ARGS__)
+#endif // ifdef DOXYGEN
 
 
@@ -116,4 +164,5 @@
  * @return ssize_t:     The length of the new string (excluding '\0')
  */
+#ifdef DOXYGEN
 ssize_t psStringAppendV(
     char **dest,                        ///< existing string
@@ -121,4 +170,16 @@
     va_list ap                          ///< va_list of format arguments
 );
+#else // ifdef DOXYGEN
+ssize_t p_psStringAppendV(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    char **dest,                        ///< existing string
+    const char *format,                 ///< format to append
+    va_list ap                          ///< va_list of format arguments
+);
+#define psStringAppendV(dest, format, ap) \
+      p_psStringAppendV(__FILE__, __LINE__, __func__, dest, format, ap)
+#endif // ifdef DOXYGEN
 
 
@@ -130,13 +191,26 @@
  * @return ssize_t:     The length of the new string (excluding '\0')
  */
+#ifdef DOXYGEN
 ssize_t psStringPrepend(
+    char **dest,                        ///< existing string
+    const char *format,                 ///< format to append
+    ...                                 ///< format arguments
+);
+#else // ifdef DOXYGEN
+ssize_t p_psStringPrepend(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
     char **dest,                        ///< existing string
     const char *format,                 ///< format to append
     ...                                 ///< format arguments
 #ifdef __GNUC__
-) __attribute__((format(printf, 2, 3)));
-# else // __GNUC__
-);
-#endif // __GNUC__
+) __attribute__((format(printf, 5, 6)));
+# else // ifdef __GNUC__
+);
+#endif // ifdef __GNUC__
+#define psStringPrepend(dest, ...) \
+      p_psStringPrepend(__FILE__, __LINE__, __func__, dest, __VA_ARGS__)
+#endif // ifdef DOXYGEN
 
 
@@ -148,4 +222,5 @@
  * @return ssize_t:     The length of the new string (excluding '\0')
  */
+#ifdef DOXYGEN
 ssize_t psStringPrependV(
     char **dest,                        ///< existing string
@@ -153,4 +228,16 @@
     va_list ap                          ///< va_list of format arguments
 );
+#else // ifdef DOXYGEN
+ssize_t p_psStringPrependV(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    char **dest,                        ///< existing string
+    const char *format,                 ///< format to append
+    va_list ap                          ///< va_list of format arguments
+);
+#define psStringPrependV(dest, format, ap) \
+      p_psStringPrependV(__FILE__, __LINE__, __func__, dest, format, ap)
+#endif // ifdef DOXYGEN
 
 
