Index: trunk/archive/pslib/include/psMemory.h
===================================================================
--- trunk/archive/pslib/include/psMemory.h	(revision 181)
+++ trunk/archive/pslib/include/psMemory.h	(revision 196)
@@ -2,6 +2,6 @@
 #define PS_MEMORY_H
 #include <stdio.h>
-/*
- * Book-keeping data for storage allocator
+/**
+ * Book-keeping data for storage allocator.
  *
  * N.b. sizeof(psMemBlock) must be chosen such that if ptr is a pointer
@@ -10,12 +10,13 @@
  */
 typedef struct {
-    const void *magic0;			// 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 *magic0;			//!< 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
 } psMemBlock;
 
+/** */
 typedef int (*psMemCallback)(const psMemBlock *ptr);
 typedef void (*psMemProblemCallback)(const psMemBlock *ptr,
@@ -25,34 +26,63 @@
 /*****************************************************************************/
 
-void *psAlloc(size_t size);
-void *psRealloc(void *ptr, size_t size);
-void psFree(void *ptr);
+/** Fake for p_psAlloc */
+void *psAlloc(size_t size		//!< Size required
+    );
+/** Fake for p_psRealloc */
+void *psRealloc(void *ptr,		//!< Pointer to re-allocate
+		size_t size		//!< Size required
+    );
+/** Fake for p_psFree */
+void psFree(void *ptr			//!< Pointer to free
+    );
 
-void *p_psAlloc(size_t size, const char *file, int lineno);
-void *p_psRealloc(void *ptr, size_t size, const char *file, int lineno);
-void p_psFree(void *ptr, const char *file, int lineno);
+/** Memory allocation */
+void *p_psAlloc(size_t size,		//!< Size required
+		const char *file,	//!< File of call
+		int lineno		//!< Line number of call
+    );
 
+/** Memory re-allocation */
+void *p_psRealloc(void *ptr,		//!< Pointer to re-allocate
+		  size_t size,		//!< Size required
+		  const char *file,	//!< File of call
+		  int lineno		//!< Line number of call
+    );
+
+/** Free memory */
+void p_psFree(void *ptr,		//!< Pointer to free
+	      const char *file,		//!< File of call
+	      int lineno		//!< Line number of call
+    );
+
+/** psAlloc sends file and line number to p_psAlloc */
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
+/** psRealloc sends file and line number to p_psRealloc */
 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
+/** psFree sends file and line number to p_psFree */
 #define psFree(size) p_psFree(size, __FILE__, __LINE__)
 
 /*****************************************************************************/
-/*
- * Checks of memory system 
- */
-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)
-int psMemCheckCorruption(int abort_on_error);
+/** 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)
+    );
+
+/** Check for memory corruption */
+int psMemCheckCorruption(int abort_on_error //!< Abort on detecting corruption?
+    );
 
 /*****************************************************************************/
-/*
- * Manipulate reference counter
- */
-int psMemGetRefCounter(void *vptr);	// return refCounter
-void *psMemIncrRefCounter(void *vptr);	// increment refCounter and return vptr
-void *psMemDecrRefCounter(void *vptr);	// decrement refCounter and return vptr
+
+/** Return reference counter */
+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
+    );
+/** Decrement reference counter and return the pointer */
+void *psMemDecrRefCounter(void *vptr	//!< Pointer to decrement refCounter, and return
+    );
 
 /*****************************************************************************/
@@ -60,12 +90,18 @@
  * Functions to set and control callbacks
  */
-psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func);
-psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func);
 
-psMemCallback psMemAllocateSetCB(psMemCallback func);
-psMemCallback psMemFreeSetCB(psMemCallback func);
+/** Set callback for problems */
+psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func //!< Function to run
+    );
+psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func); //!< set call back for exhausted
+									 //!< memory
 
-int psMemGetId(void);			// get next memory ID
-long psMemSetAllocateID(long id);	// set p_psMemAllocateID to id
-long psMemSetFreeID(long id);		// set p_psMemFreeID to id
+psMemCallback psMemAllocateSetCB(psMemCallback func); //!< Set call back for when a particular memory block is
+						      //!< allocated
+psMemCallback psMemFreeSetCB(psMemCallback func); //!< set call back for when a particular memory block is
+						  //!< freed
+
+int psMemGetId(void);			//!< get next memory ID
+long psMemSetAllocateID(long id);	//!< set p_psMemAllocateID to id
+long psMemSetFreeID(long id);		//!< set p_psMemFreeID to id
 #endif
