Index: trunk/psLib/src/sys/psMemory.h
===================================================================
--- trunk/psLib/src/sys/psMemory.h	(revision 11416)
+++ trunk/psLib/src/sys/psMemory.h	(revision 11672)
@@ -15,6 +15,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-30 03:00:50 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-07 00:36:02 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,7 +27,8 @@
 /// @{
 
-#include <stdio.h>                     // needed for FILE
-#include <pthread.h>                   // we need a mutex to make this stuff thread safe.
-#include "psType.h"
+#include <stdio.h>                      // needed for FILE
+#include <pthread.h>                    // we need a mutex to make this stuff thread safe.
+#include <stdint.h>                     // for uint32_t
+#include <stdbool.h>
 
 /** @addtogroup MemoryManagement
@@ -35,5 +36,5 @@
  */
 
-#define P_PS_MEMMAGIC (psU32)0xdeadbeef   // Magic number in psMemBlock header
+#define P_PS_MEMMAGIC (uint32_t)0xdeadbeef   // Magic number in psMemBlock header
 
 /// typedef for memory identification numbers.  Guaranteed to be some variety of integer.
@@ -44,5 +45,5 @@
 
 /// typedef for deallocator.
-typedef void (*psFreeFunc) (void* ptr);
+typedef void (*psFreeFunc) (void *ptr);
 
 /** Book-keeping data for storage allocator.
@@ -57,5 +58,5 @@
 typedef struct psMemBlock
 {
-    const psU32 startblock;            ///< initialised to p_psMEMMAGIC
+    const uint32_t startblock;            ///< initialised to p_psMEMMAGIC
     struct psMemBlock* previousBlock;  ///< previous block in allocation list
     struct psMemBlock* nextBlock;      ///< next block allocation list
@@ -75,5 +76,5 @@
     psReferenceCount refCounter;       ///< how many times pointer is referenced
     bool persistent;                   ///< marks if this non-user persistent data like error stack, etc.
-    const psU32 endblock;              ///< initialised to p_psMEMMAGIC
+    const uint32_t endblock;              ///< initialised to p_psMEMMAGIC
 }
 psMemBlock;
@@ -109,10 +110,10 @@
 /** prototype of a callback function used when memory runs out
  *
- *  @return psPtr pointer to requested buffer of the size size_t, or NULL if memory could not
+ *  @return void * pointer to requested buffer of the size size_t, or NULL if memory could not
  *          be found.
  *
  *  @see psMemExhaustedCallbackSet
  */
-typedef psPtr (*psMemExhaustedCallback) (
+typedef void *(*psMemExhaustedCallback) (
     size_t size                        ///< the size of buffer required
 );
@@ -120,10 +121,10 @@
 /** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
  *
- *  @return psPtr pointer to the allocated buffer. This will not be NULL.
+ *  @return void * pointer to the allocated buffer. This will not be NULL.
  *  @see psFree
  */
 #ifdef DOXYGEN
 
-psPtr psAlloc(
+void *psAlloc(
     size_t size                        ///< Size required
 );
@@ -132,5 +133,5 @@
 
 #ifdef __GNUC__
-psPtr p_psAlloc(
+void *p_psAlloc(
     size_t size,                       ///< Size required
     const char *file,                  ///< File of caller
@@ -139,6 +140,5 @@
 ) __attribute__((malloc));
 # else // __GNUC__
-
-    psPtr p_psAlloc(
+    void *p_psAlloc(
         size_t size,                       ///< Size required
         const char *file,                  ///< File of caller
@@ -167,5 +167,5 @@
 
 void psMemSetDeallocator(
-    psPtr ptr,                         ///< the memory block to operate on
+    void *ptr,                         ///< the memory block to operate on
     psFreeFunc freeFunc                ///< the function to be executed at deallocation
 );
@@ -174,5 +174,5 @@
 
 void p_psMemSetDeallocator(
-    psPtr ptr,                          ///< the memory block to operate on
+    void *ptr,                          ///< the memory block to operate on
     psFreeFunc freeFunc,                ///< the function to be executed at deallocation
     const char *file,                   ///< File of caller
@@ -201,5 +201,5 @@
 
 psFreeFunc psMemGetDeallocator(
-    const psPtr ptr                     ///< the memory block
+    void *ptr                     ///< the memory block
 );
 
@@ -207,5 +207,5 @@
 
 psFreeFunc p_psMemGetDeallocator(
-    const psPtr ptr,                    ///< the memory block
+    void *ptr,                    ///< the memory block
     const char *file,                   ///< File of caller
     unsigned int lineno,                ///< Line number of caller
@@ -256,6 +256,6 @@
 
 void psMemSetPersistent(
-    psPtr ptr,                         ///< the memory block to operate on
-    bool value,                        ///< true if memory is persistent, otherwise false
+    void *ptr,                          ///< the memory block to operate on
+    bool value,                         ///< true if memory is persistent, otherwise false
 );
 
@@ -263,9 +263,9 @@
 
 void p_psMemSetPersistent(
-    psPtr ptr,                         ///< the memory block to operate on
-    bool value,                        ///< true if memory is persistent, otherwise false
-    const char *file,                  ///< File of caller
-    unsigned int lineno,               ///< Line number of caller
-    const char *func                   ///< Function name of caller
+    void *ptr,                          ///< the memory block to operate on
+    bool value,                         ///< true if memory is persistent, otherwise false
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func                    ///< Function name of caller
 );
 
@@ -299,13 +299,13 @@
 
 bool psMemGetPersistent(
-    psPtr ptr,                         ///< the memory block to check.
+    void *ptr,                          ///< the memory block to check.
 );
 #else // ifdef DOXYGEN
 
 bool p_psMemGetPersistent(
-    psPtr ptr,                         ///< the memory block to check.
-    const char *file,                  ///< File of caller
-    unsigned int lineno,               ///< Line number of caller
-    const char *func                   ///< Function name of caller
+    void *ptr,                          ///< the memory block to check.
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func                    ///< Function name of caller
 );
 
@@ -320,31 +320,29 @@
 /** Memory re-allocation.  This operates much like realloc(), but is guaranteed to return a non-NULL value.
  *
- *  @return psPtr pointer to resized buffer. This will not be NULL.
+ *  @return void * pointer to resized buffer. This will not be NULL.
  *  @see psAlloc, psFree
  */
 #ifdef DOXYGEN
 
-psPtr psRealloc(
-    psPtr ptr,                         ///< Pointer to re-allocate
-    size_t size                        ///< Size required
+void *psRealloc(
+    void *ptr,                          ///< Pointer to re-allocate
+    size_t size                         ///< Size required
 );
 #else // #ifdef DOXYGEN
-
 #ifdef __GNUC__
-psPtr p_psRealloc(
-    psPtr ptr,                         ///< Pointer to re-allocate
-    size_t size,                       ///< Size required
-    const char *file,                  ///< File of caller
-    unsigned int lineno,               ///< Line number of caller
-    const char *func                   ///< Function name of caller
+void *p_psRealloc(
+    void *ptr,                          ///< Pointer to re-allocate
+    size_t size,                        ///< Size required
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func                    ///< Function name of caller
 ) __attribute__((malloc));
 # else // __GNUC__
-
-    psPtr p_psRealloc(
-        psPtr ptr,                         ///< Pointer to re-allocate
-        size_t size,                       ///< Size required
-        const char *file,                  ///< File of caller
-        unsigned int lineno,               ///< Line number of caller
-        const char *func                   ///< Function name of caller
+    void *p_psRealloc(
+        void *ptr,                          ///< Pointer to re-allocate
+        size_t size,                        ///< Size required
+        const char *file,                   ///< File of caller
+        unsigned int lineno,                ///< Line number of caller
+        const char *func                    ///< Function name of caller
     );
 #endif // __GNUC__
@@ -365,5 +363,5 @@
 #ifdef DOXYGEN
 void psFree(
-    psPtr ptr                          ///< Pointer to free, if NULL, function returns immediately.
+    void *ptr                           ///< Pointer to free, if NULL, function returns immediately.
 );
 #else // #ifdef DOXYGEN
@@ -372,5 +370,5 @@
 #ifndef SWIG
 #define            psFree(ptr) \
-p_psMemDecrRefCounter((psPtr *)ptr, __FILE__, __LINE__, __func__);
+p_psMemDecrRefCounter((void **)ptr, __FILE__, __LINE__, __func__);
 #endif // ! SWIG
 
@@ -449,5 +447,5 @@
 
 psReferenceCount psMemGetRefCounter(
-    const psPtr ptr                    ///< Pointer to get refCounter for
+    void *ptr                     ///< Pointer to get refCounter for
 );
 
@@ -455,8 +453,8 @@
 
 psReferenceCount p_psMemGetRefCounter(
-    const psPtr ptr,                   ///< Pointer to get refCounter for
-    const char *file,                  ///< File of call
-    unsigned int lineno,               ///< Line number of call
-    const char *func                   ///< Function name of caller
+    void *ptr,                    ///< Pointer to get refCounter for
+    const char *file,                   ///< File of call
+    unsigned int lineno,                ///< Line number of call
+    const char *func                    ///< Function name of caller
 );
 
@@ -471,19 +469,19 @@
 /** Increment reference counter and return the pointer
  *
- *  @return psPtr
- *
- */
-#ifdef DOXYGEN
-
-psPtr psMemIncrRefCounter(
-    const psPtr ptr                    ///< Pointer to increment refCounter, and return
+ *  @return void *
+ *
+ */
+#ifdef DOXYGEN
+
+void *psMemIncrRefCounter(
+    void *ptr                           ///< Pointer to increment refCounter, and return
 );
 #else // ifdef DOXYGEN
 
-psPtr p_psMemIncrRefCounter(
-    const psPtr ptr,                  ///< Pointer to increment refCounter, and return
-    const char *file,                  ///< File of call
-    unsigned int lineno,               ///< Line number of call
-    const char *func                   ///< Function name of caller
+void *p_psMemIncrRefCounter(
+    void *ptr,                          ///< Pointer to increment refCounter, and return
+    const char *file,                   ///< File of call
+    unsigned int lineno,                ///< Line number of call
+    const char *func                    ///< Function name of caller
 );
 
@@ -499,20 +497,20 @@
  *
  *
- *  @return psPtr    the pointer deremented in refCount, or NULL if pointer is
+ *  @return void *    the pointer deremented in refCount, or NULL if pointer is
  *                   fully dereferenced.
  */
 #ifdef DOXYGEN
 
-psPtr psMemDecrRefCounter(
-    psPtr ptr                         ///< Pointer to decrement refCounter, and return
+void *psMemDecrRefCounter(
+    void *ptr                           ///< Pointer to decrement refCounter, and return
 );
 
 #else // DOXYGEN
 
-psPtr p_psMemDecrRefCounter(
-    psPtr ptr,                        ///< Pointer to decrement refCounter, and return
-    const char *file,                  ///< File of call
-    unsigned int lineno,               ///< Line number of call
-    const char *func                   ///< Function name of caller
+void *p_psMemDecrRefCounter(
+    void *ptr,                          ///< Pointer to decrement refCounter, and return
+    const char *file,                   ///< File of call
+    unsigned int lineno,                ///< Line number of call
+    const char *func                    ///< Function name of caller
 );
 
@@ -527,15 +525,15 @@
 /** Set reference counter and return the pointer
  *
- *  @return psPtr    the pointer with refCount set, or NULL if pointer is
+ *  @return void *    the pointer with refCount set, or NULL if pointer is
  *                   fully dereferenced.
  */
 #ifdef DOXYGEN
-psPtr psMemSetRefCounter(
-    psPtr ptr,                        ///< Pointer to decrement refCounter, and return
+void * psMemSetRefCounter(
+    void * ptr,                        ///< Pointer to decrement refCounter, and return
     psReferenceCount count            ///< New reference count
 );
 #else // DOXYGEN
-psPtr p_psMemSetRefCounter(
-    psPtr vptr,                        ///< Pointer to decrement refCounter, and return
+void * p_psMemSetRefCounter(
+    void * vptr,                        ///< Pointer to decrement refCounter, and return
     psReferenceCount count,            ///< New reference count
     const char *file,                  ///< File of call
