Index: /trunk/psLib/configure.in
===================================================================
--- /trunk/psLib/configure.in	(revision 3144)
+++ /trunk/psLib/configure.in	(revision 3145)
@@ -1,3 +1,3 @@
-AC_INIT([pslib],[1.5])
+AC_INIT([pslib],[1.4])
 AM_CONFIG_HEADER(src/config.h)
 AM_INIT_AUTOMAKE(pslib, 1.4)
@@ -13,4 +13,5 @@
 AC_PROG_F77
 AC_F77_WRAPPERS
+dnl AC_F77_LIBRARY_LDFLAGS
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
@@ -21,5 +22,4 @@
 dnl Setup CFLAGS/FFLAGS/LDFLAGS with project-particulars
 CFLAGS="${CFLAGS=} -Wall -std=c99 -D_GNU_SOURCE"
-LDFLAGS="-release 5"
 
 dnl Setup the info for psLib for pkg-config
Index: /trunk/psLib/src/astronomy/slalib.h
===================================================================
--- /trunk/psLib/src/astronomy/slalib.h	(revision 3144)
+++ /trunk/psLib/src/astronomy/slalib.h	(revision 3145)
@@ -7,6 +7,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-05 08:33:20 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-07 23:26:24 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,6 +16,7 @@
 #define SLALIB_H
 
+#include "config.h"
 
-#define fslaAoppa F77_FUNC(sla_aoppa,SLA_AOPPA)
+#define fslaAoppa F77_FUNC_(sla_aoppa,SLA_AOPPA)
 extern void fslaAoppa(
         const double* date,
@@ -34,5 +35,5 @@
     );
 
-#define fslaAopqk F77_FUNC(sla_aopqk,SLA_AOPQK)
+#define fslaAopqk F77_FUNC_(sla_aopqk,SLA_AOPQK)
 extern void fslaAopqk(
         const double* RAP,
@@ -46,5 +47,5 @@
     );
 
-#define fslaOapqk F77_FUNC(sla_oapqk,SLA_OAPQK)
+#define fslaOapqk F77_FUNC_(sla_oapqk,SLA_OAPQK)
 extern void fslaOapqk(
         char* TYPE,
@@ -56,5 +57,5 @@
     );
 
-#define fslaAirmas F77_FUNC(sla_airmas,SLA_AIRMAS)
+#define fslaAirmas F77_FUNC_(sla_airmas,SLA_AIRMAS)
 extern double fslaAirmas(
         const double* zenithDistance
Index: /trunk/psLib/src/sys/psError.h
===================================================================
--- /trunk/psLib/src/sys/psError.h	(revision 3144)
+++ /trunk/psLib/src/sys/psError.h	(revision 3145)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-03 00:54:11 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -116,4 +116,12 @@
  *  @return psErrorCode    the given error code
  */
+#ifdef DOXYGEN
+psErrorCode psError(
+    psErrorCode code,                  ///< Error class code
+    psBool new,                        ///< true if error originates at this location
+    const char* fmt,
+    ...
+);
+#else
 psErrorCode p_psError(
     const char* file,
@@ -126,5 +134,9 @@
 );
 
+#ifndef SWIG
 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
+#endif
+
+#endif
 
 /** Create a new psErr struct
Index: /trunk/psLib/src/sys/psMemory.h
===================================================================
--- /trunk/psLib/src/sys/psMemory.h	(revision 3144)
+++ /trunk/psLib/src/sys/psMemory.h	(revision 3145)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-22 20:49:59 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -127,9 +127,10 @@
  *  @see psFree 
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psAlloc(size_t size       ///< Size required
              );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psAlloc(size_t size,    ///< Size required
                 const char *file,       ///< File of call
@@ -138,5 +139,8 @@
 
 /// Memory allocation. psAlloc sends file and line number to p_psAlloc.
+#ifndef SWIG
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
+#endif
+
 #endif
 
@@ -200,20 +204,23 @@
  *  @see psAlloc, psFree
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psRealloc(
-    psPtr ptr                          ///< Pointer to re-allocate
-    size_t size,                       ///< Size required
-);
-#else
-
+    psPtr ptr,                          ///< Pointer to re-allocate
+    size_t size                         ///< Size required
+);
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psRealloc(
     psPtr ptr,                         ///< Pointer to re-allocate
     size_t size,                       ///< Size required
     const char *file,                  ///< File of call
-    psS32 lineno                         ///< Line number of call
+    psS32 lineno                       ///< Line number of call
 );
 
 /// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
+#ifndef SWIG
 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
+#endif
 
 #endif
@@ -223,18 +230,21 @@
  *  @see psAlloc, psRealloc
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 void psFree(
-    psPtr ptr,                         ///< Pointer to free, if NULL, function returns immediately.
-);
-#else
-
+    psPtr ptr                          ///< Pointer to free, if NULL, function returns immediately.
+);
+#endif
+
+#ifndef DOXYGEN
 void p_psFree(
-    psPtr ptr,                        ///< Pointer to free
-    const char *file,                 ///< File of call
-    psS32 lineno                        ///< Line number of call
+    psPtr ptr,                         ///< Pointer to free
+    const char *file,                  ///< File of call
+    psS32 lineno                       ///< Line number of call
 );
 
 /// Free memory.  psFree sends file and line number to p_psFree.
-#define psFree(size) p_psFree(size, __FILE__, __LINE__)
+#ifndef SWIG
+#define psFree(ptr) p_psFree(ptr, __FILE__, __LINE__)
+#endif
 
 #endif
@@ -282,10 +292,11 @@
  *  @ingroup memRefCount
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psMemIncrRefCounter(
     psPtr vptr                         ///< Pointer to increment refCounter, and return
 );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psMemIncrRefCounter(
     psPtr vptr,                        ///< Pointer to increment refCounter, and return
@@ -294,5 +305,8 @@
 );
 
+#ifndef SWIG
 #define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
+#endif
+
 #endif
 
@@ -304,10 +318,11 @@
  *                   fully dereferenced.
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psMemDecrRefCounter(
     psPtr vptr                         ///< Pointer to decrement refCounter, and return
 );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psMemDecrRefCounter(
     psPtr vptr,                        ///< Pointer to decrement refCounter, and return
@@ -316,5 +331,8 @@
 );
 
+#ifndef SWIG
 #define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
+#endif
+
 #endif
 
Index: /trunk/psLib/src/sys/psTrace.h
===================================================================
--- /trunk/psLib/src/sys/psTrace.h	(revision 3144)
+++ /trunk/psLib/src/sys/psTrace.h	(revision 3145)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-24 20:12:28 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -58,10 +58,20 @@
 p_psComponent;
 
-#ifndef DOXYGEN
+#ifdef DOXYGEN
+void psTrace(const char *facil,        ///< facilty of interest
+             psS32 myLevel,            ///< desired trace level
+             ...)                      ///< trace message arguments
+;
+#else
 /// Send a trace message
-void p_psTrace(const char *facil,       ///< facilty of interest
-               psS32 myLevel,     ///< desired trace level
-               ...)             ///< trace message arguments
+void p_psTrace(const char *facil,      ///< facilty of interest
+               psS32 myLevel,          ///< desired trace level
+               ...)                    ///< trace message arguments
 ;
+
+#ifndef SWIG
+#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
+#endif
+
 #endif
 
@@ -89,5 +99,4 @@
 /* \} */// End of SystemGroup Functions
 
-#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
 #endif
 
Index: /trunk/psLib/src/sysUtils/psError.h
===================================================================
--- /trunk/psLib/src/sysUtils/psError.h	(revision 3144)
+++ /trunk/psLib/src/sysUtils/psError.h	(revision 3145)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-03 00:54:11 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -116,4 +116,12 @@
  *  @return psErrorCode    the given error code
  */
+#ifdef DOXYGEN
+psErrorCode psError(
+    psErrorCode code,                  ///< Error class code
+    psBool new,                        ///< true if error originates at this location
+    const char* fmt,
+    ...
+);
+#else
 psErrorCode p_psError(
     const char* file,
@@ -126,5 +134,9 @@
 );
 
+#ifndef SWIG
 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
+#endif
+
+#endif
 
 /** Create a new psErr struct
Index: /trunk/psLib/src/sysUtils/psMemory.h
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.h	(revision 3144)
+++ /trunk/psLib/src/sysUtils/psMemory.h	(revision 3145)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-22 20:49:59 $
+ *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -127,9 +127,10 @@
  *  @see psFree 
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psAlloc(size_t size       ///< Size required
              );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psAlloc(size_t size,    ///< Size required
                 const char *file,       ///< File of call
@@ -138,5 +139,8 @@
 
 /// Memory allocation. psAlloc sends file and line number to p_psAlloc.
+#ifndef SWIG
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
+#endif
+
 #endif
 
@@ -200,20 +204,23 @@
  *  @see psAlloc, psFree
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psRealloc(
-    psPtr ptr                          ///< Pointer to re-allocate
-    size_t size,                       ///< Size required
-);
-#else
-
+    psPtr ptr,                          ///< Pointer to re-allocate
+    size_t size                         ///< Size required
+);
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psRealloc(
     psPtr ptr,                         ///< Pointer to re-allocate
     size_t size,                       ///< Size required
     const char *file,                  ///< File of call
-    psS32 lineno                         ///< Line number of call
+    psS32 lineno                       ///< Line number of call
 );
 
 /// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
+#ifndef SWIG
 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
+#endif
 
 #endif
@@ -223,18 +230,21 @@
  *  @see psAlloc, psRealloc
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 void psFree(
-    psPtr ptr,                         ///< Pointer to free, if NULL, function returns immediately.
-);
-#else
-
+    psPtr ptr                          ///< Pointer to free, if NULL, function returns immediately.
+);
+#endif
+
+#ifndef DOXYGEN
 void p_psFree(
-    psPtr ptr,                        ///< Pointer to free
-    const char *file,                 ///< File of call
-    psS32 lineno                        ///< Line number of call
+    psPtr ptr,                         ///< Pointer to free
+    const char *file,                  ///< File of call
+    psS32 lineno                       ///< Line number of call
 );
 
 /// Free memory.  psFree sends file and line number to p_psFree.
-#define psFree(size) p_psFree(size, __FILE__, __LINE__)
+#ifndef SWIG
+#define psFree(ptr) p_psFree(ptr, __FILE__, __LINE__)
+#endif
 
 #endif
@@ -282,10 +292,11 @@
  *  @ingroup memRefCount
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psMemIncrRefCounter(
     psPtr vptr                         ///< Pointer to increment refCounter, and return
 );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psMemIncrRefCounter(
     psPtr vptr,                        ///< Pointer to increment refCounter, and return
@@ -294,5 +305,8 @@
 );
 
+#ifndef SWIG
 #define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
+#endif
+
 #endif
 
@@ -304,10 +318,11 @@
  *                   fully dereferenced.
  */
-#ifdef DOXYGEN
+#if defined(DOXYGEN) || defined(SWIG)
 psPtr psMemDecrRefCounter(
     psPtr vptr                         ///< Pointer to decrement refCounter, and return
 );
-#else
-
+#endif
+
+#ifndef DOXYGEN
 psPtr p_psMemDecrRefCounter(
     psPtr vptr,                        ///< Pointer to decrement refCounter, and return
@@ -316,5 +331,8 @@
 );
 
+#ifndef SWIG
 #define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
+#endif
+
 #endif
 
Index: /trunk/psLib/src/sysUtils/psTrace.h
===================================================================
--- /trunk/psLib/src/sysUtils/psTrace.h	(revision 3144)
+++ /trunk/psLib/src/sysUtils/psTrace.h	(revision 3145)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-24 20:12:28 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-07 23:26:24 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -58,10 +58,20 @@
 p_psComponent;
 
-#ifndef DOXYGEN
+#ifdef DOXYGEN
+void psTrace(const char *facil,        ///< facilty of interest
+             psS32 myLevel,            ///< desired trace level
+             ...)                      ///< trace message arguments
+;
+#else
 /// Send a trace message
-void p_psTrace(const char *facil,       ///< facilty of interest
-               psS32 myLevel,     ///< desired trace level
-               ...)             ///< trace message arguments
+void p_psTrace(const char *facil,      ///< facilty of interest
+               psS32 myLevel,          ///< desired trace level
+               ...)                    ///< trace message arguments
 ;
+
+#ifndef SWIG
+#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
+#endif
+
 #endif
 
@@ -89,5 +99,4 @@
 /* \} */// End of SystemGroup Functions
 
-#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
 #endif
 
Index: /trunk/psLib/src/sysUtils/sysUtils.i
===================================================================
--- /trunk/psLib/src/sysUtils/sysUtils.i	(revision 3144)
+++ /trunk/psLib/src/sysUtils/sysUtils.i	(revision 3145)
@@ -9,2 +9,34 @@
 %include "psTrace.h"
 %include "psType.h"
+
+%inline %{
+
+psErrorCode psError(psErrorCode code, psBool new, const char* msg) {
+    return p_psError("UNKNOWN",0,"SWIG",code,new,"%s",msg);
+}
+
+psPtr psAlloc(size_t size) {
+    return p_psAlloc(size,"UNKNOWN",0);
+}
+
+psPtr psRealloc(psPtr ptr, size_t size) {
+    return p_psRealloc(ptr,size,"UNKNOWN",0);
+}
+
+void psFree(psPtr ptr) {
+    p_psFree(ptr,"UNKNOWN",0);
+}
+
+psPtr psMemIncrRefCounter(psPtr vptr) {
+    return p_psMemIncrRefCounter(vptr,"UNKNOWN",0);
+}
+
+psPtr psMemDecrRefCounter(psPtr vptr) {
+    return p_psMemDecrRefCounter(vptr,"UNKNOWN",0);
+}
+
+void psTrace(const char* facil, psS32 myLevel, const char* msg) {
+    p_psTrace(facil, myLevel, msg);
+}
+
+%}
Index: /trunk/psLib/swig/Makefile.am
===================================================================
--- /trunk/psLib/swig/Makefile.am	(revision 3144)
+++ /trunk/psLib/swig/Makefile.am	(revision 3145)
@@ -5,11 +5,12 @@
 	rm -rf psLibModule
 
-INCLUDES = -I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/astronomy \
-	-I$(top_srcdir)/src/collections \
-	-I$(top_srcdir)/src/dataManip \
-	-I$(top_srcdir)/src/fileUtils \
-	-I$(top_srcdir)/src/image \
-	-I$(top_srcdir)/src/sysUtils
+SRCDIR = $(shell cd $(top_srcdir) && pwd)
+INCLUDES = -I$(SRCDIR)/src \
+	-I$(SRCDIR)/src/astronomy \
+	-I$(SRCDIR)/src/collections \
+	-I$(SRCDIR)/src/dataManip \
+	-I$(SRCDIR)/src/fileUtils \
+	-I$(SRCDIR)/src/image \
+	-I$(SRCDIR)/src/sysUtils
 
 ####################################################
@@ -25,5 +26,5 @@
 	echo "includes=$(INCLUDES)" > psLibModule/setup.txt
 	echo "ldflags=-L$(top_builddir)/src $(PSLIB_LIBS)" >> psLibModule/setup.txt
-	echo "cflags=$(PSLIB_CFLAGS) -Wno-unused -Wno-strict-aliasing" >> psLibModule/setup.txt
+	echo "cflags=$(CFLAGS) -std=c99 -Wno-unused -Wno-strict-aliasing" >> psLibModule/setup.txt
 
 psLibModule/pslib_wrap.c: psLibModule pslib.i
Index: /trunk/psLib/swig/pslib.i
===================================================================
--- /trunk/psLib/swig/pslib.i	(revision 3144)
+++ /trunk/psLib/swig/pslib.i	(revision 3145)
@@ -5,5 +5,17 @@
 #define SWIG
 #include "pslib.h"
+
+/* SWIG uses malloc/free - make it use the pslib memory functions instead. */
+/* 
+#define malloc(S)    psAlloc(S)
+#define realloc(P,S) psRealloc(P,S)
+#define free(P)      psFree(P)
+*/
+
 %}
+
+/* grab the typedefs used throughout psLib, e.g. psU8, psU16,... */
+%import "psType.h"
+%import "psMemory.h"
 
 %include "cpointer.i"
