Index: trunk/archive/pslib/include/psMemory.h
===================================================================
--- trunk/archive/pslib/include/psMemory.h	(revision 344)
+++ trunk/archive/pslib/include/psMemory.h	(revision 369)
@@ -16,20 +16,24 @@
  */
 typedef struct {
-    const void *magic0;			///< initialised to p_psMEMMAGIC
+    const void *startblock;		///< initialised to p_psMEMMAGIC
     const unsigned long id;		///< a unique ID for this allocation
     const char *file;			///< set from __FILE__ in e.g. p_psAlloc
     const int lineno;			///< set from __LINE__ in e.g. p_psAlloc
     int refCounter;			///< how many times pointer is referenced
-    const void *magic;			///< initialised to p_psMEMMAGIC
+    const void **endpost;		///< initialised to p_psMEMMAGIC
+    const void *endblock;		///< initialised to p_psMEMMAGIC
 } psMemBlock;
 
 /// prototype of a basic callback used by memory functions 
-typedef int (*psMemCallback)(const psMemBlock *ptr);
+typedef long (*psMemAllocateCB)(const psMemBlock *ptr);
+
+/// prototype of memory free callback used by memory functions 
+typedef long (*psMemFreeCB)(const psMemBlock *ptr);
 
 /// prototype of a callback used in error conditions 
-typedef void (*psMemProblemCallback)(const psMemBlock *ptr, const char *file, int lineno);
+typedef void (*psMemProblemCB)(const psMemBlock *ptr, const char *file, int lineno);
 
 /// prototype of a callback used when memory runs out 
-typedef void *(*psMemExhaustedCallback)(size_t size);
+typedef void *(*psMemExhaustedCB)(size_t size);
 
 /** Functions **************************************************************/
@@ -41,6 +45,6 @@
 void *p_psAlloc(size_t size,		///< Size required
 		const char *file,	///< File of call
-		int lineno		///< Line number of call
-		);
+		int lineno)		///< Line number of call
+;
 
 /// Memory re-allocation.  Underlying private function called by macro psRealloc. 
@@ -48,61 +52,62 @@
 		  size_t size,		///< Size required
 		  const char *file,	///< File of call
-		  int lineno		///< Line number of call
-		  );
+		  int lineno)		///< Line number of call
+;
 
 /// Free memory.  Underlying private function called by macro psFree. 
 void p_psFree(void *ptr,		///< Pointer to free
 	      const char *file,		///< File of call
-	      int lineno		///< Line number of call
-	      );
+	      int lineno)		///< Line number of call
+;
 
 /// Check for memory leaks 
 int psMemCheckLeaks(int id0,		///< don't list blocks with id < id0
 		    psMemBlock ***arr,	///< pointer to array of pointers to leaked blocks, or NULL
-		    FILE *fd		///< print list of leaks to fd (or NULL)
-		    );
+		    FILE *fd)		///< print list of leaks to fd (or NULL)
+;
 
 /// Check for memory corruption 
-int psMemCheckCorruption(int abort_on_error ///< Abort on detecting corruption?
-			 );
+int psMemCheckCorruption(int abort_on_error) ///< Abort on detecting corruption?
+;
 
 /// Return reference counter 
-int psMemGetRefCounter(void *vptr	///< Pointer to get refCounter for
-		       );
+int psMemGetRefCounter(void *vptr)	///< Pointer to get refCounter for
+;
 
 /// Increment reference counter and return the pointer 
-void *psMemIncrRefCounter(void *vptr	///< Pointer to increment refCounter, and return
-			  );
+void *psMemIncrRefCounter(void *vptr)	///< Pointer to increment refCounter, and return
+;
 
 /// Decrement reference counter and return the pointer 
-void *psMemDecrRefCounter(void *vptr	///< Pointer to decrement refCounter, and return
-			  );
+void *psMemDecrRefCounter(void *vptr)	///< Pointer to decrement refCounter, and return
+;
 
 /// Set callback for problems 
-psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func ///< Function to run
-				       );
+psMemProblemCB psMemProblemCBSet(psMemProblemCB func) ///< Function to run
+;
 
 /// Set callback for out-of-memory 
-psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func ///< Function to run
-					   );
+psMemExhaustedCB psMemExhaustedCBSet(psMemExhaustedCB func) ///< Function to run
+;
 
 /// Set call back for when a particular memory block is allocated 
-psMemCallback psMemAllocateSetCB(psMemCallback func ///< Function to run
-				 );
+psMemCB psMemAllocateCBSet(psMemAllocateCB func) ///< Function to run
+;
 
 /// Set call back for when a particular memory block is freed 
-psMemCallback psMemFreeSetCB(psMemCallback func
-			     );
+psMemCB psMemFreeCBSet(psMemFreeCB func) ///< Function to run
+;
 
 /// get next memory ID 
-int psMemGetId(void);
+int psMemGetId(void)
+;
 
 /// set p_psMemAllocateID to id 
-long psMemSetAllocateID(long id		///< ID to set
-			);
+long psMemAllocateIDSet(long id)	///< ID to set
+;
 
 /// set p_psMemFreeID to id 
-long psMemSetFreeID(long id		///< ID to set
-		    );
+long psMemFreeIDSet(long id)		///< ID to set
+;
 
 /* \} */ // End of SystemGroup Functions
