From 18e08e4e78210e5ad1dcf0988df8fe17e77721ef Mon Sep 17 00:00:00 2001
From: "Liam M. Healy" <lhealy@common-lisp.net>
Date: Sun, 30 Oct 2011 00:44:08 -0400
Subject: [PATCH] Foreign structure with CFFI's new syntax

Specify the foreign structures with CFFI's new syntax, (:struct foo),
and fix #'creturn-st so that it will not take :struct (or any other
keyword) as a return variable name.  GSLL now compiles and loads
without error or warning, but it has not been tested.
---
 init/body-expand.lisp                        |  19 +-
 mathematical/complex.lisp                    | 208 +++++++++----------
 polynomial.lisp                              |  18 +-
 special-functions/airy.lisp                  |  36 ++--
 special-functions/bessel.lisp                |  92 ++++----
 special-functions/clausen.lisp               |   6 +-
 special-functions/coulomb.lisp               |  13 +-
 special-functions/coupling.lisp              |   8 +-
 special-functions/dawson.lisp                |   6 +-
 special-functions/debye.lisp                 |  12 +-
 special-functions/dilogarithm.lisp           |  11 +-
 special-functions/elementary.lisp            |   9 +-
 special-functions/elliptic-integrals.lisp    |  25 +--
 special-functions/error-functions.lisp       |  16 +-
 special-functions/exponential-functions.lisp |  23 +-
 special-functions/exponential-integrals.lisp |  25 +--
 special-functions/fermi-dirac.lisp           |  24 ++-
 special-functions/gamma.lisp                 |  64 +++---
 special-functions/gegenbauer.lisp            |  13 +-
 special-functions/hypergeometric.lisp        |  29 +--
 special-functions/laguerre.lisp              |  16 +-
 special-functions/lambert.lisp               |   8 +-
 special-functions/legendre.lisp              |  48 +++--
 special-functions/logarithm.lisp             |  15 +-
 special-functions/mathieu.lisp               |  14 +-
 special-functions/power.lisp                 |   6 +-
 special-functions/psi.lisp                   |  14 +-
 special-functions/synchrotron.lisp           |   8 +-
 special-functions/transport.lisp             |  12 +-
 special-functions/trigonometry.lisp          |  36 ++--
 special-functions/zeta.lisp                  |  16 +-
 31 files changed, 460 insertions(+), 390 deletions(-)

diff --git a/init/body-expand.lisp b/init/body-expand.lisp
index d570dd6d..34e16025 100644
--- a/init/body-expand.lisp
+++ b/init/body-expand.lisp
@@ -1,6 +1,6 @@
 ;; Expand the body of a defmfun
 ;; Liam Healy 2009-04-13 22:07:13EDT body-expand.lisp
-;; Time-stamp: <2011-10-29 18:52:05EDT body-expand.lisp>
+;; Time-stamp: <2011-10-30 00:35:29EDT body-expand.lisp>
 ;;
 ;; Copyright 2009, 2010, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -22,13 +22,16 @@
 
 (defun creturn-st (c-return)
   "The symbol-type of the return from the C function."
-  (grid:make-st
-   (if (listp c-return)
-       (grid:st-symbol c-return)
-       (make-symbol "CRETURN"))
-   (if (member c-return *special-c-return*)
-       :int
-       (if (listp c-return) (grid:st-type c-return) c-return))))
+  (let ((supplied-symbol-p		; return symbol supplied
+	  (and (listp c-return)		; accommodate (:struct foo) type spec
+	       (not (eq (symbol-package (first c-return)) (find-package :keyword))))))
+    (grid:make-st
+     (if supplied-symbol-p
+      (grid:st-symbol c-return)
+      (make-symbol "CRETURN"))
+     (if (member c-return *special-c-return*)
+	 :int
+	 (if supplied-symbol-p (grid:st-type c-return) c-return)))))
 
 (defun cl-convert-form (decl)
   "Generate a form that calls the appropriate converter from C/GSL to CL."
diff --git a/mathematical/complex.lisp b/mathematical/complex.lisp
index dac76439..9dadd5c6 100644
--- a/mathematical/complex.lisp
+++ b/mathematical/complex.lisp
@@ -1,6 +1,6 @@
 ;; Functions of complex numbers
 ;; Liam Healy 2009-01-13 21:19:38EST complex.lisp
-;; Time-stamp: <2010-06-27 18:03:16EDT complex.lisp>
+;; Time-stamp: <2011-10-29 23:20:40EDT complex.lisp>
 ;;
 ;; Copyright 2009 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -28,26 +28,26 @@
 
 (defmfun argument (number)
   "gsl_complex_arg"
-  ((number grid:complex-double-c))
+  ((number (:struct grid:complex-double-c)))
   :c-return :double
   :documentation
   "The angle of the complex number.")
 
 (defmfun modulus (number)
   "gsl_complex_abs"
-  ((number grid:complex-double-c))
+  ((number (:struct grid:complex-double-c)))
   :c-return :double
   :documentation "The magnitude, or modulus of the complex number.")
 
 (defmfun modulus2 (number)
   "gsl_complex_abs2"
-  ((number grid:complex-double-c))
+  ((number (:struct grid:complex-double-c)))
   :c-return :double
   :documentation "The magnitude squared of the complex number.")
 
 (defmfun log-modulus (number)
   "gsl_complex_logabs"
-  ((number grid:complex-double-c))
+  ((number (:struct grid:complex-double-c)))
   :c-return :double
   :documentation "The logarithm of the magnitude of the complex number.")
 
@@ -61,78 +61,78 @@
 
 (defmfun cx-add (c1 c2)
   "gsl_complex_add"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sub (c1 c2)
   "gsl_complex_sub"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-mul (c1 c2)
   "gsl_complex_mul"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-div (c1 c2)
   "gsl_complex_div"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-add-real (c1 num)
   "gsl_complex_add_real"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sub-real (c1 num)
   "gsl_complex_sub_real"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-mul-real (c1 num)
   "gsl_complex_mul_real"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-div-real (c1 num)
   "gsl_complex_div_real"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-add-imag (c1 num)
   "gsl_complex_add_imag"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sub-imag (c1 num)
   "gsl_complex_sub_imag"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-mul-imag (c1 num)
   "gsl_complex_mul_imag"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-div-imag (c1 num)
   "gsl_complex_div_imag"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-conjugate (c1)
   "gsl_complex_conjugate"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-inverse (c1)
   "gsl_complex_inverse"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-negative (c1)
   "gsl_complex_negative"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 ;;;;****************************************************************************
 ;;; Complex functions
@@ -144,43 +144,43 @@
 
 (defmfun cx-sqrt (c1)
   "gsl_complex_sqrt"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sqrt-real (num)
   "gsl_complex_sqrt_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-expt (c1 c2)
   "gsl_complex_pow"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-expt-real (c1 num)
   "gsl_complex_pow_real"
-  ((c1 grid:complex-double-c) (num :double))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (num :double))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-exp (c1)
   "gsl_complex_exp"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-log (c1)
   "gsl_complex_log"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-log10 (c1)
   "gsl_complex_log10"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-logb (c1 c2)
   "gsl_complex_log_b"
-  ((c1 grid:complex-double-c) (c2 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)) (c2 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 ;;;;****************************************************************************
 ;;; Trigonometric functions
@@ -192,33 +192,33 @@
 
 (defmfun cx-sin (c1)
   "gsl_complex_sin"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-cos (c1)
   "gsl_complex_cos"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sec (c1)
   "gsl_complex_sec"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-csc (c1)
   "gsl_complex_csc"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-tan (c1)
   "gsl_complex_tan"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-cot (c1)
   "gsl_complex_cot"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 ;;;;****************************************************************************
 ;;; Inverse trigonometric functions
@@ -230,53 +230,53 @@
 
 (defmfun cx-arcsin (c1)
   "gsl_complex_arcsin"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arcsin-real (num)
   "gsl_complex_arcsin_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccos (c1)
   "gsl_complex_arccos"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccos-real (num)
   "gsl_complex_arccos_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arcsec (c1)
   "gsl_complex_arcsec"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arcsec-real (num)
   "gsl_complex_arcsec_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccsc (c1)
   "gsl_complex_arccsc"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccsc-real (num)
   "gsl_complex_arccsc_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arctan (c1)
   "gsl_complex_arctan"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccot (c1)
   "gsl_complex_arccot"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 ;;;;****************************************************************************
 ;;; Hyperbolic functions
@@ -284,33 +284,33 @@
 
 (defmfun cx-sinh (c1)
   "gsl_complex_sinh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-cosh (c1)
   "gsl_complex_cosh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-sech (c1)
   "gsl_complex_sech"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-csch (c1)
   "gsl_complex_csch"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-tanh (c1)
   "gsl_complex_tanh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-coth (c1)
   "gsl_complex_coth"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 ;;;;****************************************************************************
 ;;; Inverse trigonometric functions
@@ -318,40 +318,40 @@
 
 (defmfun cx-arcsinh (c1)
   "gsl_complex_arcsinh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccosh (c1)
   "gsl_complex_arccosh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccosh-real (num)
   "gsl_complex_arccosh_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arcsech (c1)
   "gsl_complex_arcsech"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccsch (c1)
   "gsl_complex_arccsch"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arctanh (c1)
   "gsl_complex_arctanh"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arctanh-real (num)
   "gsl_complex_arctanh_real"
   ((num :double))
-  :c-return grid:complex-double-c)
+  :c-return (:struct grid:complex-double-c))
 
 (defmfun cx-arccoth (c1)
   "gsl_complex_arccoth"
-  ((c1 grid:complex-double-c))
-  :c-return grid:complex-double-c)
+  ((c1 (:struct grid:complex-double-c)))
+  :c-return (:struct grid:complex-double-c))
diff --git a/polynomial.lisp b/polynomial.lisp
index 81065dd9..022a7297 100644
--- a/polynomial.lisp
+++ b/polynomial.lisp
@@ -1,6 +1,6 @@
 ;; Polynomials
 ;; Liam Healy, Tue Mar 21 2006 - 18:33
-;; Time-stamp: <2011-01-10 17:47:56EST polynomial.lisp>
+;; Time-stamp: <2011-10-29 23:21:19EDT polynomial.lisp>
 ;;
 ;; Copyright 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -47,11 +47,11 @@
      &key)
   "gsl_poly_complex_eval"
   (((grid:foreign-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
-   (x grid:complex-double-c))
+   (x (:struct grid:complex-double-c)))
   :definition :method
   :gsl-version (1 11)
   :inputs (coefficients)
-  :c-return grid:complex-double-c
+  :c-return (:struct grid:complex-double-c)
   :documentation			; FDL
   "Evaluate the polyonomial with coefficients at the complex value x.")
 
@@ -61,11 +61,11 @@
      &key)
   "gsl_complex_poly_complex_eval"
   (((grid:foreign-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
-   (x grid:complex-double-c))
+   (x (:struct grid:complex-double-c)))
   :definition :method
   :gsl-version (1 11)
   :inputs (coefficients)
-  :c-return grid:complex-double-c
+  :c-return (:struct grid:complex-double-c)
   :documentation			; FDL
   "Evaluate the polyonomial with coefficients at the complex value x.")
 
@@ -128,7 +128,8 @@
 (defmfun solve-quadratic-complex (a b c)
   "gsl_poly_complex_solve_quadratic"
   ((a :double) (b :double) (c :double)
-   (root1 (:pointer grid:complex-double-c)) (root2 (:pointer grid:complex-double-c)))
+   (root1 (:pointer (:struct grid:complex-double-c)))
+   (root2 (:pointer (:struct grid:complex-double-c))))
   :c-return :number-of-answers
   :documentation			; FDL
   "The complex roots of the quadratic equation a x^2 + b x + c = 0.
@@ -154,8 +155,9 @@
 (defmfun solve-cubic-complex (a b c)
   "gsl_poly_complex_solve_cubic"
   ((a :double) (b :double) (c :double)
-   (root1 (:pointer grid:complex-double-c)) (root2 (:pointer grid:complex-double-c))
-   (root3 (:pointer grid:complex-double-c)))
+   (root1 (:pointer (:struct grid:complex-double-c)))
+   (root2 (:pointer (:struct grid:complex-double-c)))
+   (root3 (:pointer (:struct grid:complex-double-c))))
   :c-return :number-of-answers
   :documentation			; FDL
   "Find the complex roots of the cubic equation, x^3 + a x^2 + b x + c = 0
diff --git a/special-functions/airy.lisp b/special-functions/airy.lisp
index 67df3e45..2f3a3a17 100644
--- a/special-functions/airy.lisp
+++ b/special-functions/airy.lisp
@@ -1,8 +1,8 @@
 ;; Airy functions
 ;; Liam Healy, Fri Mar 17 2006 - 18:41
-;; Time-stamp: <2009-12-27 10:10:07EST airy.lisp>
+;; Time-stamp: <2011-10-29 23:30:34EDT airy.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -25,69 +25,77 @@
 ;;;;****************************************************************************
 
 (defmfun airy-Ai (x &optional (mode :double))
-    "gsl_sf_airy_Ai_e" ((x :double) (mode sf-mode) (ret sf-result))
+    "gsl_sf_airy_Ai_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Airy function Ai(x).")
 
 (defmfun airy-Bi (x &optional (mode :double))
-  "gsl_sf_airy_Bi_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Bi_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Airy function Bi(x).")
 
 (defmfun airy-Ai-scaled (x &optional (mode :double))
-  "gsl_sf_airy_Ai_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Ai_scaled_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled Airy function S_A(x) Ai(x).
    For x>0 the scaling factor S_A(x) is \exp(+(2/3) x^(3/2)),
    and is 1 for x<0.")
 
 (defmfun airy-Bi-scaled (x &optional (mode :double))
-  "gsl_sf_airy_Bi_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Bi_scaled_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled Airy function S_B(x) Bi(x).
    For x>0 the scaling factor S_B(x) is exp(-(2/3) x^(3/2)),
    and is 1 for x<0.")
 
 (defmfun airy-Ai-deriv (x &optional (mode :double))
-  "gsl_sf_airy_Ai_deriv_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Ai_deriv_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Airy function derivative Ai'(x).")
 
 (defmfun airy-Bi-deriv (x &optional (mode :double))
-  "gsl_sf_airy_Bi_deriv_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Bi_deriv_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation "The Airy function derivative Bi'(x).")
 
 (defmfun airy-Ai-deriv-scaled (x &optional (mode :double))
-  "gsl_sf_airy_Ai_deriv_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Ai_deriv_scaled_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled Airy function derivative S_A(x) Ai'(x).
   For x>0 the scaling factor S_A(x) is exp(+(2/3) x^(3/2)),
   and is 1 for x<0.")
 
 (defmfun airy-Bi-deriv-scaled (x &optional (mode :double))
-  "gsl_sf_airy_Bi_deriv_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_airy_Bi_deriv_scaled_e"
+  ((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled Airy function derivative S_B(x) Bi'(x).
    For x>0 the scaling factor S_B(x) is
    exp(-(2/3) x^(3/2)), and is 1 for x<0.")
 
 (defmfun airy-zero-Ai (s)
-  "gsl_sf_airy_zero_Ai_e" ((s sizet) (ret sf-result))
+  "gsl_sf_airy_zero_Ai_e" ((s sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th zero of the Airy function Ai(x).")
 
 (defmfun airy-zero-Bi (s)
-  "gsl_sf_airy_zero_Bi_e" ((s sizet) (ret sf-result))
+  "gsl_sf_airy_zero_Bi_e" ((s sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th zero of the Airy function Bi(x).")
 
 (defmfun airy-zero-Ai-deriv (s)
-  "gsl_sf_airy_zero_Ai_deriv_e" ((s sizet) (ret sf-result))
+  "gsl_sf_airy_zero_Ai_deriv_e" ((s sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th zero of the Airy function derivative Ai'(x).")
 
 (defmfun airy-zero-Bi-deriv (s)
-  "gsl_sf_airy_zero_Bi_deriv_e" ((s sizet) (ret sf-result))
+  "gsl_sf_airy_zero_Bi_deriv_e" ((s sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th zero of the Airy function derivative Bi'(x).")
 
diff --git a/special-functions/bessel.lisp b/special-functions/bessel.lisp
index d68eed81..aa0a040a 100644
--- a/special-functions/bessel.lisp
+++ b/special-functions/bessel.lisp
@@ -1,6 +1,6 @@
 ;; Bessel functions
 ;; Liam Healy, Fri Mar 17 2006 - 18:42
-;; Time-stamp: <2011-01-10 17:59:32EST bessel.lisp>
+;; Time-stamp: <2011-10-29 23:31:13EDT bessel.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -26,12 +26,12 @@
 
 (defmfun cylindrical-bessel-J0 (x)
     "gsl_sf_bessel_J0_e"
-  ((x :double) (ret sf-result))
+  ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular cylindrical Bessel function of zeroth order, J_0(x).")
 
 (defmfun cylindrical-bessel-J1 (x)
-  "gsl_sf_bessel_J1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_J1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular cylindrical Bessel function of first order, J_1(x).")
 
@@ -41,7 +41,7 @@
    "The regular cylindrical Bessel function of order n, J_n(x)."))
 
 (defmfun cylindrical-bessel-J ((n integer) x)
-  "gsl_sf_bessel_Jn_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Jn_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun cylindrical-bessel-J-array-order
@@ -60,7 +60,7 @@
 ;;; Fractional order
 
 (defmfun cylindrical-bessel-J ((nu float) x)
-  "gsl_sf_bessel_Jnu_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Jnu_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun cylindrical-bessel-J-array-x (nu v &optional (mode :double))
@@ -80,12 +80,12 @@
 ;;;;****************************************************************************
 
 (defmfun cylindrical-bessel-Y0 (x)
-  "gsl_sf_bessel_Y0_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_Y0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular cylindrical Bessel function of zeroth order, Y_0(x).")
 
 (defmfun cylindrical-bessel-Y1 (x)
-  "gsl_sf_bessel_Y1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_Y1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular cylindrical Bessel function of first order, Y_1(x).")
 
@@ -96,7 +96,7 @@
 
 (defmfun cylindrical-bessel-Y ((n integer) x)
   "gsl_sf_bessel_Yn_e"
-  ((n :int) (x :double) (ret sf-result))
+  ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The irregular cylindrical Bessel function of order n, Y_n(x).")
@@ -118,7 +118,7 @@
 ;;; Irregular Bessel Function - Fractional Order
 
 (defmfun cylindrical-bessel-Y ((nu float) x)
-  "gsl_sf_bessel_Ynu_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Ynu_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 ;;;;****************************************************************************
@@ -126,12 +126,12 @@
 ;;;;****************************************************************************
 
 (defmfun cylindrical-bessel-I0 (x)
-  "gsl_sf_bessel_I0_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_I0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular modified cylindrical Bessel function of zeroth order, I_0(x).")
 
 (defmfun cylindrical-bessel-I1 (x)
-  "gsl_sf_bessel_I1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_I1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular modified cylindrical Bessel function of first order, I_1(x).")
 
@@ -142,7 +142,7 @@
 
 (defmfun cylindrical-bessel-I ((n integer) x)
   "gsl_sf_bessel_In_e"
-  ((n :int) (x :double) (ret sf-result))
+  ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun cylindrical-bessel-In-array
@@ -159,13 +159,13 @@
    therefore may differ slightly from the exact values.")
 
 (defmfun cylindrical-bessel-I0-scaled (x)
-  "gsl_sf_bessel_I0_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_I0_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified cylindrical Bessel function of zeroth order,
   \exp(-|x|) I_0(x).")
 
 (defmfun cylindrical-bessel-I1-scaled (x)
-  "gsl_sf_bessel_I1_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_I1_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified cylindrical Bessel function of first order,
   \exp(-|x|) I_1(x).")
@@ -177,7 +177,7 @@
   \exp(-|x|) I_n(x)}."))
 
 (defmfun cylindrical-bessel-I-scaled ((n integer) x)
-  "gsl_sf_bessel_In_scaled_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_In_scaled_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The scaled regular modified cylindrical Bessel function of order n,
@@ -201,14 +201,14 @@
 ;;; Regular Modified Bessel Functions - Fractional Order
 
 (defmfun cylindrical-bessel-I ((nu float) x)
-  "gsl_sf_bessel_Inu_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Inu_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The regular modified Bessel function of fractional order
   \nu, I_\nu(x) for x>0, \nu>0.")
 
 (defmfun cylindrical-bessel-I-scaled ((nu float) x)
-  "gsl_sf_bessel_Inu_scaled_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Inu_scaled_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The scaled regular modified Bessel function of fractional order
@@ -219,13 +219,13 @@
 ;;;;****************************************************************************
 
 (defmfun cylindrical-bessel-K0 (x)
-  "gsl_sf_bessel_K0_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_K0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular modified cylindrical Bessel function of zeroth order,
   K_0(x).")
 
 (defmfun cylindrical-bessel-K1 (x)
-  "gsl_sf_bessel_K1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_K1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular modified cylindrical Bessel function of first order, K_1(x).")
 
@@ -235,7 +235,7 @@
    "The irregular modified cylindrical Bessel function of order n, K_n(x)."))
 
 (defmfun cylindrical-bessel-K ((n integer) x)
-  "gsl_sf_bessel_Kn_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Kn_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun cylindrical-bessel-Kn-array
@@ -252,13 +252,13 @@
    therefore may differ slightly from the exact values.")
 
 (defmfun cylindrical-bessel-K0-scaled (x)
-  "gsl_sf_bessel_K0_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_K0_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified cylindrical Bessel function of zeroth order,
   \exp(-|x|) K_0(x).")
 
 (defmfun cylindrical-bessel-K1-scaled (x)
-  "gsl_sf_bessel_K1_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_K1_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified cylindrical Bessel function of first order,
    \exp(-|x|) K_1(x).")
@@ -270,7 +270,7 @@
   \exp(-|x|) K_n(x)."))
 
 (defmfun cylindrical-bessel-K-scaled ((n integer) x)
-  "gsl_sf_bessel_Kn_scaled_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Kn_scaled_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun cylindrical-bessel-Kn-scaled-array
@@ -292,20 +292,20 @@
 ;;; Irregular Modified Bessel Functions - Fractional Order
 
 (defmfun cylindrical-bessel-K ((nu float) x)
-  "gsl_sf_bessel_Knu_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Knu_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The irregular modified Bessel function of fractional order \nu,
    K_\nu(x) for x>0, \nu>0.")
 
 (defmfun bessel-lnKnu (nu x)
-  "gsl_sf_bessel_lnKnu_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_lnKnu_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the irregular modified Bessel function of fractional
    order \nu, \ln(K_\nu(x)) for x>0, \nu>0.")
 
 (defmfun cylindrical-bessel-K-scaled ((nu float) x)
-  "gsl_sf_bessel_Knu_scaled_e" ((nu :double) (x :double) (ret sf-result))
+  "gsl_sf_bessel_Knu_scaled_e" ((nu :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The scaled irregular modified Bessel function of fractional order
@@ -316,24 +316,24 @@
 ;;;;****************************************************************************
 
 (defmfun spherical-bessel-j0 (x)
-  "gsl_sf_bessel_j0_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_j0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular spherical Bessel function of zeroth order, j_0(x) = \sin(x)/x.")
 
 (defmfun spherical-bessel-j1 (x)
-  "gsl_sf_bessel_j1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_j1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular spherical Bessel function of first order, j_1(x)
    = (\sin(x)/x - \cos(x))/x.")
 
 (defmfun spherical-bessel-j2 (x)
-  "gsl_sf_bessel_j2_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_j2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular spherical Bessel function of second order, j_2(x)
    = ((3/x^2 - 1)\sin(x) - 3\cos(x)/x)/x.")
 
 (defmfun spherical-bessel-jl (l x)
-  "gsl_sf_bessel_jl_e" ((l :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_jl_e" ((l :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular spherical Bessel function of order
    l, j_l(x), for l >= 0 and x >= 0.")
@@ -369,25 +369,25 @@
 ;;;;****************************************************************************
 
 (defmfun spherical-bessel-y0 (x)
-  "gsl_sf_bessel_y0_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_y0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular spherical Bessel function of zeroth order,
   y_0(x) = -\cos(x)/x.")
 
 (defmfun spherical-bessel-y1 (x)
-  "gsl_sf_bessel_y1_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_y1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular spherical Bessel function of first order,
   y_1(x) = -(\cos(x)/x + \sin(x))/x.")
 
 (defmfun spherical-bessel-y2 (x)
-  "gsl_sf_bessel_y2_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_y2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular spherical Bessel function of second order,
   y_2(x) = (-3/x^3 + 1/x)\cos(x) - (3/x^2)\sin(x).")
 
 (defmfun spherical-bessel-yl (l x)
-  "gsl_sf_bessel_yl_e" ((l :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_yl_e" ((l :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular spherical Bessel function of order l, y_l(x), for l >= 0.")
 
@@ -408,25 +408,26 @@
 ;;;;****************************************************************************
 
 (defmfun spherical-bessel-i0-scaled (x)
-  "gsl_sf_bessel_i0_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_i0_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified spherical Bessel function of zeroth
   order, \exp(-|x|) i_0(x).")
 
 (defmfun spherical-bessel-i1-scaled (x)
-  "gsl_sf_bessel_i1_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_i1_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified spherical Bessel function of first order,
   \exp(-|x|) i_1(x).")
 
 (defmfun spherical-bessel-i2-scaled (x)
-  "gsl_sf_bessel_i2_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_i2_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified spherical Bessel function of second order,
    \exp(-|x|) i_2(x).")
 
 (defmfun spherical-bessel-il-scaled (n x)
-  "gsl_sf_bessel_il_scaled_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_il_scaled_e"
+  ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled regular modified spherical Bessel function of order l,
    \exp(-|x|) i_l(x).")
@@ -448,25 +449,25 @@
 ;;;;****************************************************************************
 
 (defmfun spherical-bessel-k0-scaled (x)
-  "gsl_sf_bessel_k0_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_k0_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified spherical Bessel function of zeroth
   order, \exp(x) k_0(x), for x>0.")
 
 (defmfun spherical-bessel-k1-scaled (x)
-  "gsl_sf_bessel_k1_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_k1_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified spherical Bessel function of first order,
    \exp(x) k_1(x), for x>0.")
 
 (defmfun spherical-bessel-k2-scaled (x)
-  "gsl_sf_bessel_k2_scaled_e" ((x :double) (ret sf-result))
+  "gsl_sf_bessel_k2_scaled_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified spherical Bessel function of second order,
   \exp(x) k_2(x), for x>0.")
 
 (defmfun spherical-bessel-kl-scaled (n x)
-  "gsl_sf_bessel_il_scaled_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_bessel_il_scaled_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The scaled irregular modified spherical Bessel function of order l,
    \exp(x) k_l(x), for x>0.")
@@ -489,19 +490,20 @@
 ;;;;****************************************************************************
 
 (defmfun bessel-zero-J0 (s)
-  "gsl_sf_bessel_zero_J0_e" ((s :int) (ret sf-result))
+  "gsl_sf_bessel_zero_J0_e" ((s :int) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th positive zero of the Bessel function
   J_0(x).")
 
 (defmfun bessel-zero-J1 (s)
-  "gsl_sf_bessel_zero_J1_e" ((s :int) (ret sf-result))
+  "gsl_sf_bessel_zero_J1_e" ((s :int) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The location of the s-th positive zero of the Bessel function
   J_1(x).")
 
 (defmfun bessel-zero-Jnu (nu s)
-  "gsl_sf_bessel_zero_Jnu_e" ((nu :double) (s :int) (ret sf-result))
+  "gsl_sf_bessel_zero_Jnu_e"
+  ((nu :double) (s :int) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "These routines compute the location of the s-th positive zero
   of the Bessel function J_\nu(x).  The current implementation
diff --git a/special-functions/clausen.lisp b/special-functions/clausen.lisp
index 19b569c6..9764c96d 100644
--- a/special-functions/clausen.lisp
+++ b/special-functions/clausen.lisp
@@ -1,8 +1,8 @@
 ;; Clausen function
 ;; Liam Healy, Sat Mar 18 2006 - 23:18
-;; Time-stamp: <2009-12-27 10:10:07EST clausen.lisp>
+;; Time-stamp: <2011-10-29 23:31:30EDT clausen.lisp>
 ;;
-;; Copyright 2006, 2007, 2008 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 (in-package :gsl)
 
 (defmfun clausen (x)
-  "gsl_sf_clausen_e" ((x :double) (ret sf-result))
+  "gsl_sf_clausen_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Clausen integral Cl_2(x).")
 
diff --git a/special-functions/coulomb.lisp b/special-functions/coulomb.lisp
index 085b855b..1039565b 100644
--- a/special-functions/coulomb.lisp
+++ b/special-functions/coulomb.lisp
@@ -1,6 +1,6 @@
 ;; Coulumb functions
 ;; Liam Healy, Sat Mar 18 2006 - 23:23
-;; Time-stamp: <2011-10-23 22:04:09EDT coulomb.lisp>
+;; Time-stamp: <2011-10-29 23:32:13EDT coulomb.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -27,14 +27,15 @@
 ;;;;****************************************************************************
 
 (defmfun hydrogenicR-1 (x r)
-  "gsl_sf_hydrogenicR_1_e" ((x :double) (r :double) (ret sf-result))
+  "gsl_sf_hydrogenicR_1_e"
+  ((x :double) (r :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The lowest-order normalized hydrogenic bound state radial
    wavefunction R_1 := 2Z \sqrt{Z} \exp(-Z r).")
 
 (defmfun hydrogenicR (n l x r)
   "gsl_sf_hydrogenicR_e"
-  ((n :int) (l :int) (x :double) (r :double) (ret sf-result))
+  ((n :int) (l :int) (x :double) (r :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The n-th normalized hydrogenic bound state radial wavefunction,
   R_n := {2 Z^{3/2} \over n^2}  \left({2Z \over n}\right)^l
@@ -49,7 +50,8 @@
 (defmfun coulomb-wave-FG (eta x L-F k)
   "gsl_sf_coulomb_wave_FG_e"
   ((eta :double) (x :double) (L-F :double) (k :int)
-   (F sf-result) (Fp sf-result) (G sf-result) (Gp sf-result)
+   (F (:pointer (:struct sf-result))) (Fp (:pointer (:struct sf-result)))
+   (G (:pointer (:struct sf-result))) (Gp (:pointer (:struct sf-result)))
    (exp-F (:pointer :double)) (exp-G (:pointer :double)))
   :return
   ((let ((vl (multiple-value-list (values-with-errors F Fp G Gp))))
@@ -150,7 +152,8 @@
 ;;;;****************************************************************************
 
 (defmfun coulomb-CL (L eta)
-  "gsl_sf_coulomb_CL_e" ((L :double) (eta :double) (ret sf-result))
+  "gsl_sf_coulomb_CL_e"
+  ((L :double) (eta :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Coulomb wave function normalization constant C_L(\eta)
    for L > -1.")
diff --git a/special-functions/coupling.lisp b/special-functions/coupling.lisp
index 695bd321..23e3d047 100644
--- a/special-functions/coupling.lisp
+++ b/special-functions/coupling.lisp
@@ -1,6 +1,6 @@
 ;; Coupling coefficients
 ;; Liam Healy, Sun Mar 19 2006 - 13:30
-;; Time-stamp: <2009-12-27 10:10:06EST coupling.lisp>
+;; Time-stamp: <2011-10-29 23:24:21EDT coupling.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -35,7 +35,7 @@ section are declared in the header file gsl_sf_coupling.h.
   "gsl_sf_coupling_3j_e" 
   ((two-ja :int) (two-jb :int) (two-jc :int)
    (two-ma :int) (two-mb :int) (two-mc :int)
-   (ret sf-result))
+   (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Wigner 3-j coefficient, 
   \pmatrix{ja & jb & jc\cr
@@ -47,7 +47,7 @@ section are declared in the header file gsl_sf_coupling.h.
   "gsl_sf_coupling_6j_e" 
   ((two-ja :int) (two-jb :int) (two-jc :int)
    (two-jd :int) (two-je :int) (two-jf :int)
-   (ret sf-result))
+   (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Wigner 6-j coefficient, 
    ja & jb & jc
@@ -61,7 +61,7 @@ section are declared in the header file gsl_sf_coupling.h.
   ((two-ja :int) (two-jb :int) (two-jc :int)
    (two-jd :int) (two-je :int) (two-jf :int)
    (two-jg :int) (two-jh :int) (two-ji :int)
-   (ret sf-result))
+   (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Wigner 9-j coefficient, 
   ja & jb & jc
diff --git a/special-functions/dawson.lisp b/special-functions/dawson.lisp
index 0c23f189..6dcdae50 100644
--- a/special-functions/dawson.lisp
+++ b/special-functions/dawson.lisp
@@ -1,8 +1,8 @@
 ;; Dawson function
 ;; Liam Healy, Sun Mar 19 2006 - 14:31
-;; Time-stamp: <2009-12-27 10:10:06EST dawson.lisp>
+;; Time-stamp: <2011-10-29 23:34:56EDT dawson.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -29,7 +29,7 @@ gsl_sf_dawson.h.
 (in-package :gsl)
 
 (defmfun dawson (x)
-  "gsl_sf_dawson_e" ((x :double) (ret sf-result))
+  "gsl_sf_dawson_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Dawson's integral for x.")
 
diff --git a/special-functions/debye.lisp b/special-functions/debye.lisp
index 7ae99fb5..497780f9 100644
--- a/special-functions/debye.lisp
+++ b/special-functions/debye.lisp
@@ -1,8 +1,8 @@
 ;; Deybe functions
 ;; Liam Healy, Sun Mar 19 2006 - 14:34
-;; Time-stamp: <2009-12-27 10:10:05EST debye.lisp>
+;; Time-stamp: <2011-10-29 23:35:07EDT debye.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -29,24 +29,24 @@ Stegun, Section 27.1.
 (in-package :gsl)
 
 (defmfun debye-1 (x)
-  "gsl_sf_debye_1_e" ((x :double) (ret sf-result))
+  "gsl_sf_debye_1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The first-order Debye function D_1(x) = (1/x) \int_0^x dt (t/(e^t - 1)).")
 
 (defmfun debye-2 (x)
-  "gsl_sf_debye_2_e" ((x :double) (ret sf-result))
+  "gsl_sf_debye_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The second-order Debye function
    D_2(x) = (2/x^2) \int_0^x dt (t^2/(e^t - 1)).")
 
 (defmfun debye-3 (x)
-  "gsl_sf_debye_3_e" ((x :double) (ret sf-result))
+  "gsl_sf_debye_3_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The third-order Debye function
    D_3(x) = (3/x^3) \int_0^x dt (t^3/(e^t - 1)).")
 
 (defmfun debye-4 (x)
-  "gsl_sf_debye_4_e" ((x :double) (ret sf-result))
+  "gsl_sf_debye_4_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The fourth-order Debye function
   D_4(x) = (4/x^4) \int_0^x dt (t^4/(e^t - 1)).")
diff --git a/special-functions/dilogarithm.lisp b/special-functions/dilogarithm.lisp
index 2d12073f..3a0e2165 100644
--- a/special-functions/dilogarithm.lisp
+++ b/special-functions/dilogarithm.lisp
@@ -1,8 +1,8 @@
 ;; Dilogarithm
 ;; Liam Healy, Fri Mar 17 2006 - 18:44
-;; Time-stamp: <2010-12-04 11:51:29EST dilogarithm.lisp>
+;; Time-stamp: <2011-10-29 23:35:35EDT dilogarithm.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -27,12 +27,15 @@
    "The dilogarithm."))
 
 (defmfun dilogarithm ((x float))
-  "gsl_sf_dilog_e" ((x :double) (ret sf-result))
+  "gsl_sf_dilog_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method)
 
 (defmfun dilogarithm ((x complex))
   "gsl_sf_complex_dilog_e"
-  (((abs x) :double) ((phase x) :double) (re sf-result) (im sf-result))
+  (((abs x) :double)
+   ((phase x) :double)
+   (re (:pointer (:struct sf-result)))
+   (im (:pointer (:struct sf-result))))
   :definition :method
   :return ((complex-with-error re im)))
 
diff --git a/special-functions/elementary.lisp b/special-functions/elementary.lisp
index 929054b8..1e7786a0 100644
--- a/special-functions/elementary.lisp
+++ b/special-functions/elementary.lisp
@@ -1,8 +1,8 @@
 ;; Elementary functions
 ;; Liam Healy, Mon Mar 20 2006 - 21:43
-;; Time-stamp: <2009-12-27 10:10:05EST elementary.lisp>
+;; Time-stamp: <2011-10-29 23:35:51EDT elementary.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -22,13 +22,14 @@
 
 (defmfun multiply (x y)
   "gsl_sf_multiply_e"
-  ((x :double) (y :double) (ret sf-result))
+  ((x :double) (y :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Multiplies x and y returning the product and associated error.")
 
 (defmfun multiply-err (x dx y dy)
     "gsl_sf_multiply_err_e"
-  ((x :double) (dx :double) (y :double)  (dy :double) (ret sf-result))
+  ((x :double) (dx :double) (y :double)  (dy :double)
+	       (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Multiplies x and y with associated absolute
    errors dx and dy.  The product xy +/- xy \sqrt((dx/x)^2 +(dy/y)^2)
diff --git a/special-functions/elliptic-integrals.lisp b/special-functions/elliptic-integrals.lisp
index edea822b..22718e04 100644
--- a/special-functions/elliptic-integrals.lisp
+++ b/special-functions/elliptic-integrals.lisp
@@ -1,8 +1,8 @@
 ;; Elliptic integrals
 ;; Liam Healy, Mon Mar 20 2006 - 21:50
-;; Time-stamp: <2009-12-27 10:10:04EST elliptic-integrals.lisp>
+;; Time-stamp: <2011-10-29 23:36:10EDT elliptic-integrals.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -25,14 +25,14 @@
 ;;;;****************************************************************************
 
 (defmfun elliptic-integral-K-complete (k &optional (mode :double))
-  "gsl_sf_ellint_Kcomp_e" ((k :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_ellint_Kcomp_e" ((k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete elliptic integral of the first kind, K(k).  Note that
   Abramowitz & Stegun define this function in terms of the parameter m
   = k^2.")
 
 (defmfun elliptic-integral-E-complete (k &optional (mode :double))
-  "gsl_sf_ellint_Ecomp_e" ((k :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_ellint_Ecomp_e" ((k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete elliptic integral of the second kind, E(k).
    Note that Abramowitz & Stegun define this function in terms of the
@@ -43,14 +43,14 @@
 ;;;;****************************************************************************
 
 (defmfun elliptic-integral-F (phi k &optional (mode :double))
-  "gsl_sf_ellint_F_e" ((phi :double) (k :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_ellint_F_e" ((phi :double) (k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral of the first kind, F(phi,k).  Note
   that Abramowitz & Stegun define this function in terms of the
   parameter m = k^2.")
 
 (defmfun elliptic-integral-E (phi k &optional (mode :double))
-  "gsl_sf_ellint_E_e" ((phi :double) (k :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_ellint_E_e" ((phi :double) (k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral of the second kind, E(phi,k).  Note
   that Abramowitz & Stegun define this function in terms of the
@@ -58,7 +58,7 @@
 
 (defmfun elliptic-integral-P (phi k n &optional (mode :double))
   "gsl_sf_ellint_P_e"
-  ((phi :double) (k :double) (n :double) (mode sf-mode) (ret sf-result))
+  ((phi :double) (k :double) (n :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral of the third kind, P(phi,k,n).
   Note that Abramowitz & Stegun define this function in terms of the
@@ -67,7 +67,7 @@
 
 (defmfun elliptic-integral-D (phi k n &optional (mode :double))
   "gsl_sf_ellint_D_e"
-  ((phi :double) (k :double) (n :double) (mode sf-mode) (ret sf-result))
+  ((phi :double) (k :double) (n :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral D(phi,k,n) which is
    defined through the Carlson form RD(x,y,z)
@@ -79,25 +79,26 @@
 ;;;;****************************************************************************
 
 (defmfun elliptic-integral-RC (x y &optional (mode :double))
-  "gsl_sf_ellint_RC_e" ((x :double) (y :double) (mode sf-mode) (ret sf-result))
+  "gsl_sf_ellint_RC_e" ((x :double) (y :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral RC(x,y).")
 
 (defmfun elliptic-integral-RD (x y z &optional (mode :double))
   "gsl_sf_ellint_RD_e"
-  ((x :double) (y :double) (z :double) (mode sf-mode) (ret sf-result))
+  ((x :double) (y :double) (z :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral RD(x,y,z).")
 
 (defmfun elliptic-integral-RF (x y z &optional (mode :double))
   "gsl_sf_ellint_RF_e"
-  ((x :double) (y :double) (z :double) (mode sf-mode) (ret sf-result))
+  ((x :double) (y :double) (z :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral RF(x,y,z).")
 
 (defmfun elliptic-integral-RJ (x y z p &optional (mode :double))
   "gsl_sf_ellint_RJ_e"
-  ((x :double) (y :double) (z :double) (p :double) (mode sf-mode) (ret sf-result))
+  ((x :double) (y :double) (z :double) (p :double) (mode sf-mode)
+	       (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete elliptic integral RJ(x,y,z,p).")
 
diff --git a/special-functions/error-functions.lisp b/special-functions/error-functions.lisp
index 7e6128b2..f75d66f9 100644
--- a/special-functions/error-functions.lisp
+++ b/special-functions/error-functions.lisp
@@ -1,8 +1,8 @@
 ;; Error functions
 ;; Liam Healy, Mon Mar 20 2006 - 22:31
-;; Time-stamp: <2009-12-27 10:10:04EST error-functions.lisp>
+;; Time-stamp: <2011-10-29 23:36:27EDT error-functions.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,36 +21,36 @@
 (in-package :gsl)
 
 (defmfun erf (x)
-  "gsl_sf_erf_e" ((x :double) (ret sf-result))
+  "gsl_sf_erf_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The error function erf(x), where
   erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2).")
 
 (defmfun erfc (x)
-  "gsl_sf_erfc_e" ((x :double) (ret sf-result))
+  "gsl_sf_erfc_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complementary error function 
   erfc(x) = 1 - erf(x) = (2/\sqrt(\pi)) \int_x^\infty \exp(-t^2).")
 
 (defmfun log-erfc (x)
-  "gsl_sf_log_erfc_e" ((x :double) (ret sf-result))
+  "gsl_sf_log_erfc_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the complementary error function \log(\erfc(x)).")
 
 (defmfun erf-Z (x)
-  "gsl_sf_erf_Z_e" ((x :double) (ret sf-result))
+  "gsl_sf_erf_Z_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gaussian probability density function 
   Z(x) = (1/sqrt{2\pi}) \exp(-x^2/2)}.")
 
 (defmfun erf-Q (x)
-  "gsl_sf_erf_Q_e" ((x :double) (ret sf-result))
+  "gsl_sf_erf_Q_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The upper tail of the Gaussian probability function 
   Q(x) = (1/\sqrt{2\pi}) \int_x^\infty dt \exp(-t^2/2)}.")
 
 (defmfun hazard (x)
-  "gsl_sf_hazard_e" ((x :double) (ret sf-result))
+  "gsl_sf_hazard_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The hazard function for the normal distribution.")
 
diff --git a/special-functions/exponential-functions.lisp b/special-functions/exponential-functions.lisp
index 3fb59026..dcbce154 100644
--- a/special-functions/exponential-functions.lisp
+++ b/special-functions/exponential-functions.lisp
@@ -1,8 +1,8 @@
 ;; Exponential functions
 ;; Liam Healy, Tue Mar 21 2006 - 17:05
-;; Time-stamp: <2010-05-31 23:32:15EDT exponential-functions.lisp>
+;; Time-stamp: <2011-10-29 23:37:02EDT exponential-functions.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 ;;;;****************************************************************************
 
 (defmfun gsl-exp (x)
-  "gsl_sf_exp_e" ((x :double) (ret sf-result))
+  "gsl_sf_exp_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The exponential function.")
 
@@ -36,7 +36,8 @@
    of exp(x) would overflow the numeric range of double.")
 
 (defmfun exp-mult (x y)
-  "gsl_sf_exp_mult_e" ((x :double) (y :double) (ret sf-result))
+  "gsl_sf_exp_mult_e"
+  ((x :double) (y :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Exponentiate x and multiply by the factor y to
    return the product y \exp(x).")
@@ -51,26 +52,26 @@
 ;;;;****************************************************************************
 
 (defmfun expm1 (x)
-  "gsl_sf_expm1_e" ((x :double) (ret sf-result))
+  "gsl_sf_expm1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "\exp(x)-1 using an algorithm that is accurate for small x.")
 
 (defmfun exprel (x)
-  "gsl_sf_exprel_e" ((x :double) (ret sf-result))
+  "gsl_sf_exprel_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "(\exp(x)-1)/x using an algorithm that is accurate for small x.
   For small x the algorithm is based on the expansion
   (\exp(x)-1)/x = 1 + x/2 + x^2/(2*3) + x^3/(2*3*4) + ...")
 
 (defmfun exprel-2 (x)
-  "gsl_sf_exprel_2_e" ((x :double) (ret sf-result))
+  "gsl_sf_exprel_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "2(\exp(x)-1-x)/x^2 using an algorithm that is accurate for small
    x.  For small x the algorithm is based on the expansion
    2(\exp(x)-1-x)/x^2 = 1 + x/3 + x^2/(3*4) + x^3/(3*4*5) + ...")
 
 (defmfun exprel-n (n x)
-  "gsl_sf_exprel_n_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_exprel_n_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "N-relative exponential, which is the n-th generalization
    of the functions #'exprel and #'exprel-2.")
@@ -80,7 +81,8 @@
 ;;;;****************************************************************************
 
 (defmfun exp-err (x dx)
-  "gsl_sf_exp_err_e" ((x :double) (dx :double) (ret sf-result))
+  "gsl_sf_exp_err_e"
+  ((x :double) (dx :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Exponentiate x with an associated absolute error dx.")
 
@@ -93,7 +95,8 @@
 
 (defmfun exp-mult-err (x dx y dy)
   "gsl_sf_exp_mult_err_e"
-  ((x :double) (dx :double) (y :double) (dy :double) (ret sf-result))
+  ((x :double) (dx :double) (y :double) (dy :double)
+	       (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The product y \exp(x) for the quantities x, y
    with associated absolute errors dx, dy.")
diff --git a/special-functions/exponential-integrals.lisp b/special-functions/exponential-integrals.lisp
index b804c705..0c44b4fb 100644
--- a/special-functions/exponential-integrals.lisp
+++ b/special-functions/exponential-integrals.lisp
@@ -1,8 +1,8 @@
 ;; Exponential integrals
 ;; Liam Healy, Tue Mar 21 2006 - 17:37
-;; Time-stamp: <2009-12-27 10:10:03EST exponential-integrals.lisp>
+;; Time-stamp: <2011-10-29 23:38:04EDT exponential-integrals.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -25,19 +25,20 @@
 ;;;;****************************************************************************
 
 (defmfun exponential-integral-E1 (x)
-  "gsl_sf_expint_E1_e" ((x :double) (ret sf-result))
+  "gsl_sf_expint_E1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The exponential integral
    E_1(x)}, E_1(x) := \Re \int_1^\infty dt \exp(-xt)/t..")
 
 (defmfun exponential-integral-E2 (x)
-  "gsl_sf_expint_E2_e" ((x :double) (ret sf-result))
+  "gsl_sf_expint_E2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The second-order exponential integral
    E_2(x)}, E_2(x) := \Re \int_1^\infty dt \exp(-xt)/t^2.")
 
 (defmfun exponential-integral-En (n x)
-  "gsl_sf_expint_En_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_expint_En_e"
+  ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 10)
   :documentation			; FDL
   "The exponential integral E_n(x) of order n,
@@ -49,7 +50,7 @@
 ;;;;****************************************************************************
 
 (defmfun exponential-integral-Ei (x)
-    "gsl_sf_expint_Ei_e" ((x :double) (ret sf-result))
+    "gsl_sf_expint_Ei_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The exponential integral Ei(x),
    Ei(x) := - PV\left(\int_{-x}^\infty dt \exp(-t)/t\right).")
@@ -59,12 +60,12 @@
 ;;;;****************************************************************************
 
 (defmfun Shi (x)
-  "gsl_sf_Shi_e" ((x :double) (ret sf-result))
+  "gsl_sf_Shi_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The integral Shi(x) = \int_0^x dt \sinh(t)/t.")
 
 (defmfun Chi (x)
-  "gsl_sf_Chi_e" ((x :double) (ret sf-result))
+  "gsl_sf_Chi_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The integral
    Chi(x) := \Re[ \gamma_E + \log(x) + \int_0^x dt (\cosh[t]-1)/t],
@@ -75,7 +76,7 @@
 ;;;;****************************************************************************
 
 (defmfun exponential-integral-3 (x)
-  "gsl_sf_expint_3_e" ((x :double) (ret sf-result))
+  "gsl_sf_expint_3_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The third-order exponential integral Ei_3(x) = \int_0^xdt \exp(-t^3)
   for x >= 0.")
@@ -85,12 +86,12 @@
 ;;;;****************************************************************************
 
 (defmfun Si (x)
-  "gsl_sf_Si_e" ((x :double) (ret sf-result))
+  "gsl_sf_Si_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Sine integral Si(x) = \int_0^x dt \sin(t)/t.")
 
 (defmfun Ci (x)
-  "gsl_sf_Ci_e" ((x :double) (ret sf-result))
+  "gsl_sf_Ci_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Cosine integral Ci(x) = -\int_x^\infty dt \cos(t)/t
    for x > 0.")
@@ -100,7 +101,7 @@
 ;;;;****************************************************************************
 
 (defmfun atanint (x)
-  "gsl_sf_atanint_e" ((x :double) (ret sf-result))
+  "gsl_sf_atanint_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Arctangent integral, which is defined as
    AtanInt(x) = \int_0^x dt \arctan(t)/t.")
diff --git a/special-functions/fermi-dirac.lisp b/special-functions/fermi-dirac.lisp
index 09e3da1f..110f969c 100644
--- a/special-functions/fermi-dirac.lisp
+++ b/special-functions/fermi-dirac.lisp
@@ -1,8 +1,8 @@
 ;; Fermi-Dirac function.
 ;; Liam Healy, Sat Apr 22 2006 - 16:12
-;; Time-stamp: <2009-12-27 10:10:03EST fermi-dirac.lisp>
+;; Time-stamp: <2011-10-29 23:38:02EDT fermi-dirac.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -25,47 +25,48 @@
 ;;;;****************************************************************************
 
 (defmfun fermi-dirac-m1 (x)
-  "gsl_sf_fermi_dirac_m1_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_m1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral with an index of -1. 
   This integral is given by F_{-1}(x) = e^x / (1 + e^x).")
 
 (defmfun fermi-dirac-0 (x)
-  "gsl_sf_fermi_dirac_0_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral with an index of 0. 
    This integral is given by F_0(x) = \ln(1 + e^x).")
 
 (defmfun fermi-dirac-1 (x)
-  "gsl_sf_fermi_dirac_1_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral with an index of 1,
    F_1(x) = \int_0^\infty dt (t /(\exp(t-x)+1)).")
 
 (defmfun fermi-dirac-2 (x)
-  "gsl_sf_fermi_dirac_2_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral with an index of 2,
    F_2(x) = (1/2) \int_0^\infty dt (t^2 /(\exp(t-x)+1)).")
 
 (defmfun fermi-dirac-integral (j x)
-  "gsl_sf_fermi_dirac_int_e" ((j :int) (x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_int_e"
+  ((j :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral with an integer index of j,
    F_j(x) = (1/\Gamma(j+1)) \int_0^\infty dt (t^j /(\exp(t-x)+1)).")
 
 (defmfun fermi-dirac-m1/2 (x)
-  "gsl_sf_fermi_dirac_mhalf_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_mhalf_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral F_{-1/2}(x).")
 
 (defmfun fermi-dirac-1/2 (x)
-  "gsl_sf_fermi_dirac_half_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_half_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral F_{1/2}(x).")
 
 (defmfun fermi-dirac-3/2 (x)
-  "gsl_sf_fermi_dirac_3half_e" ((x :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_3half_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complete Fermi-Dirac integral F_{3/2}(x).")
 
@@ -74,7 +75,8 @@
 ;;;;****************************************************************************
 
 (defmfun fermi-dirac-inc-0 (x b)
-  "gsl_sf_fermi_dirac_inc_0_e" ((x :double) (b :double) (ret sf-result))
+  "gsl_sf_fermi_dirac_inc_0_e"
+  ((x :double) (b :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete Fermi-Dirac integral with an index
   of zero, F_0(x,b) = \ln(1 + e^{b-x}) - (b-x).")
diff --git a/special-functions/gamma.lisp b/special-functions/gamma.lisp
index 15c81084..d8e3e944 100644
--- a/special-functions/gamma.lisp
+++ b/special-functions/gamma.lisp
@@ -1,6 +1,6 @@
 ;; Gamma functions
 ;; Liam Healy, Thu Apr 27 2006 - 22:06
-;; Time-stamp: <2011-10-29 18:19:04EDT gamma.lisp>
+;; Time-stamp: <2011-10-30 00:37:46EDT gamma.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -33,7 +33,7 @@
 (defconstant +gamma-xmax+ 171.0d0)
 
 (defmfun gamma (x)
-  "gsl_sf_gamma_e" ((x :double) (ret sf-result))
+  "gsl_sf_gamma_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gamma function Gamma(x), subject to x
    not being a negative integer.  The function is computed using the real
@@ -41,7 +41,8 @@
    Gamma(x) is not considered an overflow is given by +gamma-xmax+.")
 
 (defmfun log-gamma (x)
-  "gsl_sf_lngamma_e" ((x :double) (ret (:pointer (:struct sf-result))))
+  "gsl_sf_lngamma_e"
+  ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the Gamma function,
    log(Gamma(x)), subject to x not a being negative
@@ -51,9 +52,11 @@
 
 (defmfun log-gamma-sign (x)
   "gsl_sf_lngamma_sgn_e"
-  ((x :double) (ret (:pointer (:struct sf-result))) (sign (:pointer :double)))
+  ((x :double)
+   (ret (:pointer (:struct sf-result)))
+   (sign (:pointer :double)))
   :return ((multiple-value-bind (val err)
-	       (cffi:convert-from-foreign ret '(:struct sf-result))
+	       (cffi:convert-from-foreign ret '(:pointer (:struct sf-result)))
 	     (values val (cffi:mem-ref sign :double) err )))
   :documentation			; FDL
   "Compute the sign of the gamma function and the logarithm of
@@ -63,7 +66,7 @@
   sgn * exp(resultlg)}.")
 
 (defmfun gamma* (x)
-  "gsl_sf_gammastar_e" ((x :double) (ret sf-result))
+  "gsl_sf_gammastar_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regulated Gamma Function Gamma^*(x)
   for x > 0, given by
@@ -72,7 +75,7 @@
   for x to infinity.")
 
 (defmfun 1/gamma (x)
-  "gsl_sf_gammainv_e" ((x :double) (ret sf-result))
+  "gsl_sf_gammainv_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The reciprocal of the gamma function,
   1/\Gamma(x) using the real Lanczos method.")
@@ -80,7 +83,7 @@
 (defmfun log-gamma-complex (z)
   "gsl_sf_lngamma_complex_e"
   (((realpart z) :double) ((imagpart z) :double)
-   (lnr sf-result) (arg sf-result))
+   (lnr (:pointer (:struct sf-result))) (arg (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Compute log(Gamma(z)) for complex z=z_r+i z_i
   and z not a negative integer, using the complex Lanczos
@@ -94,45 +97,51 @@
   ((values-with-errors lnr arg)))
 
 (defmfun taylor-coefficient (n x)
-  "gsl_sf_taylorcoeff_e" ((n :int) (x :double) (ret sf-result))
+  "gsl_sf_taylorcoeff_e"
+  ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Compute the Taylor coefficient x^n / n! for x >= 0, n >= 0.")
 
 (defmfun factorial (n)
-  "gsl_sf_fact_e" ((n sizet) (ret sf-result))
+  "gsl_sf_fact_e" ((n sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The factorial n!, related to the Gamma function by n! = \Gamma(n+1).")
 
 (defmfun double-factorial (n)
-  "gsl_sf_doublefact_e" ((n sizet) (ret sf-result))
+  "gsl_sf_doublefact_e" ((n sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The double factorial n!! = n(n-2)(n-4) \dots.")
 
 (defmfun log-factorial (n)
-  "gsl_sf_lnfact_e" ((n sizet) (ret sf-result))
+  "gsl_sf_lnfact_e"
+  ((n sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the factorial of n, log(n!).
   The algorithm is faster than computing
   ln(Gamma(n+1)) via #'log-gamma for n < 170, but defers for larger n.")
 
 (defmfun log-double-factorial (n)
-  "gsl_sf_lndoublefact_e" ((n sizet) (ret sf-result))
+  "gsl_sf_lndoublefact_e"
+  ((n sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Compute the logarithm of the double factorial of n, log(n!!).")
 
 (defmfun choose (n m)
-  "gsl_sf_choose_e" ((n sizet) (m sizet) (ret sf-result))
+  "gsl_sf_choose_e"
+  ((n sizet) (m sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The combinatorial factor (n choose m) = n!/(m!(n-m)!).")
 
 (defmfun log-choose (n m)
-  "gsl_sf_lnchoose_e" ((n sizet) (m sizet) (ret sf-result))
+  "gsl_sf_lnchoose_e"
+  ((n sizet) (m sizet) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of (n choose m).  This is
   equivalent to the sum log(n!) - log(m!) - log((n-m)!).")
 
 (defmfun pochammer (a x)
-  "gsl_sf_poch_e"  ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_poch_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Pochhammer symbol (a)_x := Gamma(a +
    x)/Gamma(a), subject to a and a+x not being negative
@@ -140,7 +149,8 @@
    sometimes written as (a,x).")
 
 (defmfun log-pochammer (a x)
-  "gsl_sf_lnpoch_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_lnpoch_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the Pochhammer symbol,
   log((a)_x) = log(Gamma(a + x)/Gamma(a)) for a > 0, a+x > 0.")
@@ -157,23 +167,26 @@
   log(|(a)_x|) and sgn = sgn((a)_x) where (a)_x :=
   Gamma(a + x)/Gamma(a), subject to a, a+x not being negative integers."
   :return  ((multiple-value-bind (val err)
-		(cffi:convert-from-foreign ret '(:struct sf-result))
+		(cffi:convert-from-foreign ret '(:pointer (:struct sf-result)))
 	      (values val (cffi:mem-ref sign :double) err ))))
 
 (defmfun relative-pochammer (a x)
-  "gsl_sf_pochrel_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_pochrel_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The relative Pochhammer symbol ((a)_x -
   1)/x where (a)_x := Gamma(a + x)/Gamma(a)}.")
 
 (defmfun incomplete-gamma (a x)
-  "gsl_sf_gamma_inc_Q_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_gamma_inc_Q_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The normalized incomplete Gamma Function
   Q(a,x) = 1/Gamma(a) \int_x^\infty dt t^{a-1} \exp(-t) for a > 0, x >= 0.")
 
 (defmfun complementary-incomplete-gamma (a x)
-  "gsl_sf_gamma_inc_P_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_gamma_inc_P_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The complementary normalized incomplete Gamma Function
   P(a,x) = 1/\Gamma(a) \int_0^x dt t^{a-1} \exp(-t)}
@@ -181,7 +194,8 @@
   call P(a,x) the incomplete gamma function (section 6.5).")
 
 (defmfun nonnormalized-incomplete-gamma (a x)
-  "gsl_sf_gamma_inc_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_gamma_inc_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The incomplete Gamma Function
    Gamma(a,x), without the normalization factor
@@ -190,18 +204,18 @@
    for a real and x >= 0.")
 
 (defmfun beta (a b)
-  "gsl_sf_beta_e" ((a :double) (b :double) (ret sf-result))
+  "gsl_sf_beta_e" ((a :double) (b :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Beta Function, B(a,b) = Gamma(a)Gamma(b)/Gamma(a+b)} for a > 0, b > 0.")
 
 (defmfun log-beta (a b)
-  "gsl_sf_lnbeta_e" ((a :double) (b :double) (ret sf-result))
+  "gsl_sf_lnbeta_e" ((a :double) (b :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The logarithm of the Beta Function, log(B(a,b)) for a > 0, b > 0.")
 
 (defmfun incomplete-beta (a b x)
   "gsl_sf_beta_inc_e"
-  ((a :double) (b :double) (x :double) (ret sf-result))
+  ((a :double) (b :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The normalized incomplete Beta function
    B_x(a,b)/B(a,b) where
diff --git a/special-functions/gegenbauer.lisp b/special-functions/gegenbauer.lisp
index 53c7ed85..177de60d 100644
--- a/special-functions/gegenbauer.lisp
+++ b/special-functions/gegenbauer.lisp
@@ -1,6 +1,6 @@
 ;; Gegenbauer polynomials
 ;; Liam Healy, Fri Apr 28 2006 - 20:40
-;; Time-stamp: <2011-01-10 17:59:32EST gegenbauer.lisp>
+;; Time-stamp: <2011-10-29 23:29:22EDT gegenbauer.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -21,23 +21,26 @@
 (in-package :gsl)
 
 (defmfun gegenbauer-1 (lambda x)
-  "gsl_sf_gegenpoly_1_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_gegenpoly_1_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gegenbauer polynomial C^{(\lambda)}_1(x)}.")
 
 (defmfun gegenbauer-2 (lambda x)
-  "gsl_sf_gegenpoly_2_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_gegenpoly_2_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gegenbauer polynomial C^{(\lambda)}_2(x)}.")
 
 (defmfun gegenbauer-3 (lambda x)
-  "gsl_sf_gegenpoly_3_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_gegenpoly_3_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gegenbauer polynomial C^{(\lambda)}_3(x)}.")
 
 (defmfun gegenbauer (n lambda x)
   "gsl_sf_gegenpoly_n_e"
-  ((n :int) (lambda :double) (x :double) (ret sf-result))
+  ((n :int) (lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gegenbauer polynomial C^{(\lambda)}_n(x)} for a specific value of n,
   lambda, x subject to \lambda > -1/2, n >= 0.")
diff --git a/special-functions/hypergeometric.lisp b/special-functions/hypergeometric.lisp
index 2684afb0..22ed9ee0 100644
--- a/special-functions/hypergeometric.lisp
+++ b/special-functions/hypergeometric.lisp
@@ -1,8 +1,8 @@
 ;; Hypergeometric function
 ;; Liam Healy, Fri Apr 28 2006 - 23:00
-;; Time-stamp: <2009-12-27 10:10:02EST hypergeometric.lisp>
+;; Time-stamp: <2011-10-29 23:40:22EDT hypergeometric.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,8 @@
 (in-package :gsl)
 
 (defmfun hypergeometric-0F1 (c x)
-  "gsl_sf_hyperg_0F1_e" ((c :double) (x :double) (ret sf-result))
+  "gsl_sf_hyperg_0F1_e"
+  ((c :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The hypergeometric function 0F1(c,x).")
 
@@ -30,7 +31,8 @@
    "The confluent hypergeometric function 1F1(m,n,x) = M(m,n,x)."))
 
 (defmfun hypergeometric-1F1 ((m integer) (n integer) x)
-  "gsl_sf_hyperg_1F1_int_e" ((m :int) (n :int) (x :double) (ret sf-result))
+  "gsl_sf_hyperg_1F1_int_e"
+  ((m :int) (n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t
   :documentation			; FDL
@@ -38,7 +40,8 @@
    for integer parameters m, n.")
 
 (defmfun hypergeometric-1F1 ((a float) (b float) x)
-  "gsl_sf_hyperg_1F1_e" ((a :double) (b :double) (x :double) (ret sf-result))
+  "gsl_sf_hyperg_1F1_e"
+  ((a :double) (b :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The confluent hypergeometric function
@@ -49,14 +52,16 @@
    "The confluent hypergeometric function U(m,n,x)."))
 
 (defmfun hypergeometric-U ((m integer) (n integer) x)
-  "gsl_sf_hyperg_U_int_e" ((m :int) (n :int) (x :double) (ret sf-result))
+  "gsl_sf_hyperg_U_int_e"
+  ((m :int) (n :int) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t
   :documentation			; FDL
   "The confluent hypergeometric function U(m,n,x) for integer parameters m, n.")
 
 (defmfun hypergeometric-U ((a float) (b float) x)
-  "gsl_sf_hyperg_U_e" ((a :double) (b :double) (x :double) (ret sf-result))
+  "gsl_sf_hyperg_U_e"
+  ((a :double) (b :double) (x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation "The confluent hypergeometric function U(a,b,x).")
 
@@ -85,7 +90,7 @@
 
 (defmfun hypergeometric-2F1 (a b c x)
   "gsl_sf_hyperg_2F1_e"
-  ((a :double) (b :double) (c :double) (x :double) (ret sf-result))
+  ((a :double) (b :double) (c :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gauss hypergeometric function
   2F1(a,b,c,x) for |x| < 1. If the arguments
@@ -97,14 +102,14 @@
 (defmfun hypergeometric-2F1-conj (a c x)
   "gsl_sf_hyperg_2F1_conj_e"
   (((realpart a) :double) ((imagpart a) :double)
-   (c :double) (x :double) (ret sf-result))
+   (c :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Gauss hypergeometric function 2F1(a, a*, c, x) with complex parameters 
   for |x| < 1.")
 
 (defmfun hypergeometric-2F1-renorm (a b c x)
   "gsl_sf_hyperg_2F1_renorm_e"
-  ((a :double) (b :double) (c :double) (x :double) (ret sf-result))
+  ((a :double) (b :double) (c :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The renormalized Gauss hypergeometric function
   2F1(a,b,c,x) / Gamma(c) for |x| < 1.")
@@ -112,14 +117,14 @@
 (defmfun hypergeometric-2F1-conj-renorm (a c x)
   "gsl_sf_hyperg_2F1_conj_renorm_e"
   (((realpart a) :double) ((imagpart a) :double)
-   (c :double) (x :double) (ret sf-result))
+   (c :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The renormalized Gauss hypergeometric function
   2F1(a, a*, c, x) / Gamma(c) for |x| < 1.")
 
 (defmfun hypergeometric-2F0 (a b x)
   "gsl_sf_hyperg_2F0_e"
-  ((a :double) (b :double) (x :double) (ret sf-result))
+  ((a :double) (b :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation 			; FDL
   "The hypergeometric function 
   2F0(a,b,x).  The series representation
diff --git a/special-functions/laguerre.lisp b/special-functions/laguerre.lisp
index 6930daa3..3f1d6312 100644
--- a/special-functions/laguerre.lisp
+++ b/special-functions/laguerre.lisp
@@ -1,8 +1,8 @@
 ;; Laguerre polynomials
 ;; Liam Healy, Fri Apr 28 2006 - 20:40
-;; Time-stamp: <2009-12-27 10:10:02EST laguerre.lisp>
+;; Time-stamp: <2011-10-29 23:40:48EDT laguerre.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,25 +21,29 @@
 (in-package :gsl)
 
 (defmfun laguerre-1 (a x)
-  "gsl_sf_laguerre_1_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_laguerre_1_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The generalized Laguerre polynomial L^a_1(x) using
    explicit representations.")
 
 (defmfun laguerre-2 (a x)
-  "gsl_sf_laguerre_2_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_laguerre_2_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The generalized Laguerre polynomial
    L^a_2(x) using explicit representations.")
 
 (defmfun laguerre-3 (a x)
-  "gsl_sf_laguerre_3_e" ((a :double) (x :double) (ret sf-result))
+  "gsl_sf_laguerre_3_e"
+  ((a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The generalized Laguerre polynomial
    L^a_3(x) using explicit representations.")
 
 (defmfun laguerre (n a x)
-  "gsl_sf_laguerre_n_e" ((n :int) (a :double) (x :double) (ret sf-result))
+  "gsl_sf_laguerre_n_e"
+  ((n :int) (a :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The generalized Laguerre polynomials L^a_n(x) for a > -1, n >= 0.")
 
diff --git a/special-functions/lambert.lisp b/special-functions/lambert.lisp
index ea178d13..34ad230a 100644
--- a/special-functions/lambert.lisp
+++ b/special-functions/lambert.lisp
@@ -1,8 +1,8 @@
 ;; Lambert's W functions
 ;; Liam Healy, Fri Apr 28 2006 - 20:40
-;; Time-stamp: <2009-12-27 10:10:01EST lambert.lisp>
+;; Time-stamp: <2011-10-29 23:41:05EDT lambert.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -31,12 +31,12 @@
 ;;; W < -1 for x < 0.  
 
 (defmfun lambert-W0 (x)
-  "gsl_sf_lambert_W0_e" ((x :double) (ret sf-result))
+  "gsl_sf_lambert_W0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The principal branch of the Lambert W function, W_0(x).")
 
 (defmfun lambert-Wm1 (x)
-  "gsl_sf_lambert_Wm1_e" ((x :double) (ret sf-result))
+  "gsl_sf_lambert_Wm1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The secondary real-valued branch of the Lambert W function, 
    W_{-1}(x).")
diff --git a/special-functions/legendre.lisp b/special-functions/legendre.lisp
index 37aecf37..ed61e662 100644
--- a/special-functions/legendre.lisp
+++ b/special-functions/legendre.lisp
@@ -1,6 +1,6 @@
 ;; Legendre functions
 ;; Liam Healy, Sat Apr 29 2006 - 19:16
-;; Time-stamp: <2011-01-10 17:59:33EST legendre.lisp>
+;; Time-stamp: <2011-10-29 23:42:17EDT legendre.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -27,25 +27,26 @@
 ;;;;****************************************************************************
 
 (defmfun legendre-P1 (x)
-  "gsl_sf_legendre_P1_e" ((x :double) (ret sf-result))
+  "gsl_sf_legendre_P1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre polynomials P_1(x) using an explicit
    representation.")
 
 (defmfun legendre-P2 (x)
-  "gsl_sf_legendre_P2_e" ((x :double) (ret sf-result))
+  "gsl_sf_legendre_P2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre polynomials P_2(x) using an explicit
    representation.")
 
 (defmfun legendre-P3 (x)
-  "gsl_sf_legendre_P3_e" ((x :double) (ret sf-result))
+  "gsl_sf_legendre_P3_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre polynomials P_3(x) using an explicit
    representation.")
 
 (defmfun legendre-Pl (l x)
-  "gsl_sf_legendre_Pl_e" ((l :int) (x :double) (ret sf-result))
+  "gsl_sf_legendre_Pl_e"
+  ((l :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre polynomial P_l(x) for a specific value of l,
    x subject to l >= 0, |x| <= 1.")
@@ -71,19 +72,19 @@
   dP_l(x)/dx, for l = 0, ...,  length(array), |x| <= 1.")
 
 (defmfun legendre-Q0 (x)
-  "gsl_sf_legendre_Q0_e" ((x :double) (ret sf-result))
+  "gsl_sf_legendre_Q0_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre function Q_0(x) for x > -1,
    x /= 1.")
 
 (defmfun legendre-Q1 (x)
-  "gsl_sf_legendre_Q1_e" ((x :double) (ret sf-result))
+  "gsl_sf_legendre_Q1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre function Q_1(x) for x > -1,
    x /= 1.")
 
 (defmfun legendre-Ql (l x)
-  "gsl_sf_legendre_Ql_e" ((l :int) (x :double) (ret sf-result))
+  "gsl_sf_legendre_Ql_e" ((l :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Legendre function Q_l(x) for x > -1, x /= 1, l >= 0.")
 
@@ -105,7 +106,8 @@
 ;;; which uses a similar recursion, but with the normalized functions.
 
 (defmfun legendre-Plm (l m x)
-  "gsl_sf_legendre_Plm_e" ((l :int) (m :int) (x :double) (ret sf-result))
+  "gsl_sf_legendre_Plm_e"
+  ((l :int) (m :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The associated Legendre polynomial
    P_l^m(x) for m >= 0, l >= m, |x| <= 1.")
@@ -137,7 +139,8 @@
     l = |m|, ..., length(values) and |x| <= 1.")
 
 (defmfun legendre-sphPlm (l m x)
-  "gsl_sf_legendre_sphPlm_e" ((l :int) (m :int) (x :double) (ret sf-result))
+  "gsl_sf_legendre_sphPlm_e"
+  ((l :int) (m :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The normalized associated Legendre polynomial
    \sqrt{(2l+1)/(4\pi) \sqrt{(l-m)!/(l+m)!} P_l^m(x) suitable
@@ -164,7 +167,8 @@
        (derivatives (vdf derivatives-size-or-array)))
   "gsl_sf_legendre_sphPlm_deriv_array"
   (((+ (dim0 values) m -1) :int) (m :int) (x :double)
-   ((grid:foreign-pointer values) :pointer) ((grid:foreign-pointer derivatives) :pointer))
+   ((grid:foreign-pointer values) :pointer)
+   ((grid:foreign-pointer derivatives) :pointer))
   :outputs (values derivatives)
   :documentation			; FDL
   "An array of normalized associated Legendre functions
@@ -188,38 +192,42 @@
 ;;; are described in Abramowitz & Stegun, Section 8.12.
 
 (defmfun legendre-conicalP-half (lambda x)
-  "gsl_sf_conicalP_half_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_conicalP_half_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The irregular Spherical Conical Function
    P^{1/2}_{-1/2 + i \lambda}(x) for x > -1.")
 
 (defmfun legendre-conicalP-mhalf (lambda x)
-  "gsl_sf_conicalP_mhalf_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_conicalP_mhalf_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The regular Spherical Conical Function
    P^{-1/2}_{-1/2 + i \lambda}(x) for x > -1.")
 
 (defmfun legendre-conicalP-0 (lambda x)
-  "gsl_sf_conicalP_0_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_conicalP_0_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The conical function P^0_{-1/2 + i \lambda(x)} for x > -1.")
 
 (defmfun legendre-conicalP-1 (lambda x)
-  "gsl_sf_conicalP_1_e" ((lambda :double) (x :double) (ret sf-result))
+  "gsl_sf_conicalP_1_e"
+  ((lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The conical function 
    P^1_{-1/2 + i \lambda}(x)} for x > -1.")
 
 (defmfun legendre-regular-spherical-conical (l lambda x)
   "gsl_sf_conicalP_sph_reg_e"
-  ((l :int) (lambda :double) (x :double) (ret sf-result))
+  ((l :int) (lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Regular Spherical Conical Function
    P^{-1/2-l}_{-1/2 + i \lambda}(x) for x > -1, l >= -1.")
 
 (defmfun legendre-regular-cylindrical-conical (l lambda x)
   "gsl_sf_conicalP_cyl_reg_e"
-  ((l :int) (lambda :double) (x :double) (ret sf-result))
+  ((l :int) (lambda :double) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Regular Cylindrical Conical Function
    P^{-m}_{-1/2 + i \lambda}(x) for x > -1, m >= -1.")
@@ -237,7 +245,7 @@
 
 (defmfun legendre-H3d-0 (lambda eta)
   "gsl_sf_legendre_H3d_0_e"
-  ((lambda :double) (eta :double) (ret sf-result))
+  ((lambda :double) (eta :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The zeroth radial eigenfunction of the Laplacian on the
    3-dimensional hyperbolic space,
@@ -247,7 +255,7 @@
 
 (defmfun legendre-H3d-1 (lambda eta)
   "gsl_sf_legendre_H3d_1_e"
-  ((lambda :double) (eta :double) (ret sf-result))
+  ((lambda :double) (eta :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The first radial eigenfunction of the Laplacian on
    the 3-dimensional hyperbolic space,
@@ -258,7 +266,7 @@
 
 (defmfun legendre-H3d (l lambda eta)
   "gsl_sf_legendre_H3d_e"
-  ((l :int) (lambda :double) (eta :double) (ret sf-result))
+  ((l :int) (lambda :double) (eta :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The l-th radial eigenfunction of the
    Laplacian on the 3-dimensional hyperbolic space
diff --git a/special-functions/logarithm.lisp b/special-functions/logarithm.lisp
index 89d19694..003060a3 100644
--- a/special-functions/logarithm.lisp
+++ b/special-functions/logarithm.lisp
@@ -1,8 +1,8 @@
 ;; Logarithm
 ;; Liam Healy, Sun Apr 30 2006 - 22:08
-;; Time-stamp: <2010-12-04 11:41:14EST logarithm.lisp>
+;; Time-stamp: <2011-10-29 23:42:37EDT logarithm.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -26,14 +26,15 @@
 
 (defmfun gsl-log ((x float))
   "gsl_sf_log_e"
-  ((x :double) (ret sf-result))
+  ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t)
 
 (defmfun gsl-log ((x complex))
   "gsl_sf_complex_log_e"
   (((realpart x) :double) ((imagpart x) :double)
-   (re-ret sf-result) (im-ret sf-result))
+   (re-ret (:pointer (:struct sf-result)))
+   (im-ret (:pointer (:struct sf-result))))
   :definition :method
   :return ((complex-with-error re-ret im-ret))
   :documentation			; FDL
@@ -41,17 +42,17 @@
   exp(lnr + i \theta) = z_r + i z_i, where theta lies in the range [-\pi,\pi].")
 
 (defmfun log-abs (x)
-  "gsl_sf_log_abs_e" ((x :double) (ret sf-result))
+  "gsl_sf_log_abs_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The natural logarithm of the magnitude of x, log(|x|), for x ne 0.")
 
 (defmfun log-1+x (x)
-  "gsl_sf_log_1plusx_e" ((x :double) (ret sf-result))
+  "gsl_sf_log_1plusx_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "log(1 + x) for x > -1 using an algorithm that is accurate for small x.")
 
 (defmfun log-1+x-m1 (x)
-  "gsl_sf_log_1plusx_mx_e" ((x :double) (ret sf-result))
+  "gsl_sf_log_1plusx_mx_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "log(1 + x) - x for x > -1 using an algorithm that is accurate for small x.")
 
diff --git a/special-functions/mathieu.lisp b/special-functions/mathieu.lisp
index 0e3e454c..7d1b6133 100644
--- a/special-functions/mathieu.lisp
+++ b/special-functions/mathieu.lisp
@@ -1,6 +1,6 @@
 ;; Mathieu functions
 ;; Liam Healy 2009-02-16 16:30:59EST mathieu.lisp
-;; Time-stamp: <2011-01-10 17:59:33EST mathieu.lisp>
+;; Time-stamp: <2011-10-29 23:29:25EDT mathieu.lisp>
 ;;
 ;; Copyright 2009, 2010, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -36,7 +36,7 @@
 
 (defmfun mathieu-a (n q)
   "gsl_sf_mathieu_a"
-  ((n :int) (q :double) (ret sf-result))
+  ((n :int) (q :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the characteristic value a_n(q) of the Mathieu function
@@ -44,7 +44,7 @@
 
 (defmfun mathieu-b (n q)
   "gsl_sf_mathieu_b"
-  ((n :int) (q :double) (ret sf-result))
+  ((n :int) (q :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the characteristic values b_n(q) of the Mathieu
@@ -94,14 +94,14 @@
 
 (defmfun mathieu-ce (n q x)
   "gsl_sf_mathieu_ce"
-  ((n :int) (q :double) (x :double) (ret sf-result))
+  ((n :int) (q :double) (x :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the angular Mathieu functions ce_n(q,x).")
 
 (defmfun mathieu-se (n q x)
   "gsl_sf_mathieu_se"
-  ((n :int) (q :double) (x :double) (ret sf-result))
+  ((n :int) (q :double) (x :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the angular Mathieu functions se_n(q,x).")
@@ -152,7 +152,7 @@
 
 (defmfun mathieu-Mc (j n q x)
   "gsl_sf_mathieu_Mc"
-  ((j :int) (n :int) (q :double) (x :double) (ret sf-result))
+  ((j :int) (n :int) (q :double) (x :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the radial j-th kind Mathieu functions Mc_n^{(j)}(q,x) of
@@ -163,7 +163,7 @@
 
 (defmfun mathieu-Ms (j n q x)
   "gsl_sf_mathieu_Ms"
-  ((j :int) (n :int) (q :double) (x :double) (ret sf-result))
+  ((j :int) (n :int) (q :double) (x :double) (ret (:pointer (:struct sf-result))))
   :gsl-version (1 9)
   :documentation			; FDL
   "Compute the radial j-th kind Mathieu functions Ms_n^{(j)}(q,x) of order n.
diff --git a/special-functions/power.lisp b/special-functions/power.lisp
index d11733f0..67782e82 100644
--- a/special-functions/power.lisp
+++ b/special-functions/power.lisp
@@ -1,8 +1,8 @@
 ;; Integer powers
 ;; Liam Healy, Sun Apr 30 2006 - 22:46
-;; Time-stamp: <2009-12-27 10:10:00EST power.lisp>
+;; Time-stamp: <2011-10-29 23:43:17EDT power.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 (in-package :gsl)
 
 (defmfun pow (x n)
-  "gsl_sf_pow_int_e" ((x :double) (n :int) (ret sf-result))
+  "gsl_sf_pow_int_e" ((x :double) (n :int) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The power x^n for integer n.  The
   power is computed using the minimum number of multiplications. For
diff --git a/special-functions/psi.lisp b/special-functions/psi.lisp
index 745f4c78..c06aa4b8 100644
--- a/special-functions/psi.lisp
+++ b/special-functions/psi.lisp
@@ -1,6 +1,6 @@
 ;; Psi (digamma) functions
 ;; Liam Healy, Mon May  1 2006 - 22:11
-;; Time-stamp: <2011-01-13 10:25:00EST psi.lisp>
+;; Time-stamp: <2011-10-29 23:29:29EDT psi.lisp>
 ;;
 ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
@@ -29,20 +29,20 @@
   (:documentation "The psi, or digamma, function."))
 
 (defmfun psi  ((n integer))
-  "gsl_sf_psi_int_e" ((n :int) (ret sf-result))
+  "gsl_sf_psi_int_e" ((n :int) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t
   :documentation			; FDL
   "Domain: n integer, n > 0.")
 
 (defmfun psi ((x float))
-  "gsl_sf_psi_e" ((x :double) (ret sf-result))
+  "gsl_sf_psi_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method 
   :documentation			; FDL
   "Domain: x /= 0.0, -1.0, -2.0, ...")
 
 (defmfun psi-1+iy (x)
-  "gsl_sf_psi_1piy_e" ((x :double) (ret sf-result))
+  "gsl_sf_psi_1piy_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The real part of the digamma function
   on the line 1+i y, Re[psi(1 + i y)].")
@@ -57,13 +57,13 @@
   (:documentation "The Trigamma function."))
 
 (defmfun psi-1 ((n integer))
-  "gsl_sf_psi_1_int_e" ((n :int) (ret sf-result))
+  "gsl_sf_psi_1_int_e" ((n :int) (ret (:pointer (:struct sf-result))))
   :definition :method 
   :documentation			; FDL
   "Domain: n integer, n > 0.")
 
 (defmfun psi-1 ((x float))
-  "gsl_sf_psi_1_e" ((x :double) (ret sf-result))
+  "gsl_sf_psi_1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "Domain: x /= 0.0, -1.0, -2.0, ...")
@@ -73,7 +73,7 @@
 ;;;;****************************************************************************
 
 (defmfun psi-n (m x)
-  "gsl_sf_psi_n_e" ((m :int) (x :double) (ret sf-result))
+  "gsl_sf_psi_n_e" ((m :int) (x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The polygamma function psi^{(m)}(x)} for m >= 0, x > 0.")
 
diff --git a/special-functions/synchrotron.lisp b/special-functions/synchrotron.lisp
index 3c43ac52..290bb62b 100644
--- a/special-functions/synchrotron.lisp
+++ b/special-functions/synchrotron.lisp
@@ -1,8 +1,8 @@
 ;; Synchrotron functions
 ;; Liam Healy, Mon May  1 2006 - 22:29
-;; Time-stamp: <2009-12-27 10:09:59EST synchrotron.lisp>
+;; Time-stamp: <2011-10-29 23:43:50EDT synchrotron.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -21,12 +21,12 @@
 (in-package :gsl)
 
 (defmfun synchrotron-1 (x)
-  "gsl_sf_synchrotron_1_e" ((x :double) (ret sf-result))
+  "gsl_sf_synchrotron_1_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The first synchrotron function x \int_x^\infty dt K_{5/3}(t)} for x >= 0.")
 
 (defmfun synchrotron-2 (x)
-  "gsl_sf_synchrotron_2_e" ((x :double) (ret sf-result))
+  "gsl_sf_synchrotron_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The second synchrotron function x K_{2/3}(x)} for x >= 0.")
 
diff --git a/special-functions/transport.lisp b/special-functions/transport.lisp
index c10395c7..b0e62ed7 100644
--- a/special-functions/transport.lisp
+++ b/special-functions/transport.lisp
@@ -1,8 +1,8 @@
 ;; Transport functions
 ;; Liam Healy, Mon May  1 2006 - 22:29
-;; Time-stamp: <2009-12-27 10:09:59EST transport.lisp>
+;; Time-stamp: <2011-10-29 23:44:51EDT transport.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -26,22 +26,22 @@
 ;;; J(n,x) := \int_0^x dt \, t^n e^t /(e^t - 1)^2.
 
 (defmfun transport-2 (x)
-  "gsl_sf_transport_2_e" ((x :double) (ret sf-result))
+  "gsl_sf_transport_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The transport function J(2,x).")
 
 (defmfun transport-3 (x)
-  "gsl_sf_transport_3_e" ((x :double) (ret sf-result))
+  "gsl_sf_transport_3_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The transport function J(3,x).")
 
 (defmfun transport-4 (x)
-  "gsl_sf_transport_4_e" ((x :double) (ret sf-result))
+  "gsl_sf_transport_4_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The transport function J(4,x).")
 
 (defmfun transport-5 (x)
-  "gsl_sf_transport_5_e" ((x :double) (ret sf-result))
+  "gsl_sf_transport_5_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The transport function J(5,x).")
 
diff --git a/special-functions/trigonometry.lisp b/special-functions/trigonometry.lisp
index 91de2fed..c7c786fa 100644
--- a/special-functions/trigonometry.lisp
+++ b/special-functions/trigonometry.lisp
@@ -1,8 +1,8 @@
 ;; Trigonometry
 ;; Liam Healy, Thu May  4 2006 - 22:58
-;; Time-stamp: <2010-12-04 11:32:57EST trigonometry.lisp>
+;; Time-stamp: <2011-10-29 23:44:51EDT trigonometry.lisp>
 ;;
-;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -31,43 +31,47 @@
   (:documentation "The cosine function cos(x)."))
 
 (defmfun gsl-sin ((x float))
-  "gsl_sf_sin_e" ((x :double) (ret sf-result))
+  "gsl_sf_sin_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t)
 
 (defmfun gsl-sin ((x complex))
   "gsl_sf_complex_sin_e"
   (((realpart x) :double) ((imagpart x) :double)
-   (re-ret sf-result) (im-ret sf-result))
+   (re-ret (:pointer (:struct sf-result)))
+   (im-ret (:pointer (:struct sf-result))))
   :definition :method
   :return ((complex-with-error re-ret im-ret)))
 
 (defmfun gsl-cos ((x float))
-  "gsl_sf_cos_e" ((x :double) (ret sf-result))
+  "gsl_sf_cos_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t)
 
 (defmfun gsl-cos ((x complex))
   "gsl_sf_complex_cos_e"
   (((realpart x) :double) ((imagpart x) :double)
-   (re-ret sf-result) (im-ret sf-result))
+   (re-ret (:pointer (:struct sf-result)))
+   (im-ret (:pointer (:struct sf-result))))
   :definition :method 
   :return ((complex-with-error re-ret im-ret)))
 
 (defmfun hypotenuse (x y)
-  "gsl_sf_hypot_e" ((x :double) (y :double) (ret sf-result))
+  "gsl_sf_hypot_e"
+  ((x :double) (y :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The hypotenuse function sqrt{x^2 + y^2}.")
 
 (defmfun sinc (x)
-  "gsl_sf_sinc_e" ((x :double) (ret sf-result))
+  "gsl_sf_sinc_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "sinc(x) = sin(pi x) / (pi x)}")
 
 (defmfun log-sin (x)
   "gsl_sf_complex_logsin_e"
   (((realpart x) :double) ((imagpart x) :double)
-   (re-ret sf-result) (im-ret sf-result))
+   (re-ret (:pointer (:struct sf-result)))
+   (im-ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "This function computes the logarithm of the complex sine,
   \log(\sin(z_r + i z_i)) storing the real and imaginary parts in
@@ -79,13 +83,13 @@
 ;;;;****************************************************************************
 
 (defmfun log-sinh (x)
-  "gsl_sf_lnsinh_e" ((x :double) (ret sf-result))
+  "gsl_sf_lnsinh_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Logarithm of sinh function, special functions
   These routines compute log(\sinh(x)) for x > 0.")
 
 (defmfun log-cosh (x)
-  "gsl_sf_lncosh_e" ((x :double) (ret sf-result))
+  "gsl_sf_lncosh_e" ((x :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Logarithm of cosh function, special functions
    These routines compute log(cosh(x)) for any x.")
@@ -96,7 +100,8 @@
 
 (defmfun polar-to-rectangular (r theta)
   "gsl_sf_polar_to_rect"
-  ((r :double) (theta :double) (x sf-result) (y sf-result))
+  ((r :double) (theta :double) (x (:pointer (:struct sf-result)))
+	       (y (:pointer (:struct sf-result))))
   :return ((values-with-errors x y))
   :documentation			; FDL
   "Convert the polar coordinates (r, theta) to
@@ -104,7 +109,8 @@
 
 (defmfun rectangular-to-polar (x y)
   "gsl_sf_rect_to_polar"
-  ((x :double) (y :double) (r sf-result) (theta sf-result))
+  ((x :double) (y :double) (r (:pointer (:struct sf-result)))
+	       (theta (:pointer (:struct sf-result))))
   :return ((values-with-errors r theta))
   :documentation			; FDL
   "Convert the rectilinear coordinates (x, y) to
@@ -133,13 +139,13 @@
 ;;;;****************************************************************************
 
 (defmfun sin-err (x dx)
-  "gsl_sf_sin_err_e" ((x :double) (dx :double) (ret sf-result))
+  "gsl_sf_sin_err_e" ((x :double) (dx :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "Compute the sine of an angle x with
    an associated absolute error dx, sin(x \pm dx).")
 
 (defmfun cos-err (x dx)
-  "gsl_sf_cos_err_e" ((x :double) (dx :double) (ret sf-result))
+  "gsl_sf_cos_err_e" ((x :double) (dx :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The cosine of an angle x with an associated
   absolute error dx, cos(x \pm dx).")
diff --git a/special-functions/zeta.lisp b/special-functions/zeta.lisp
index 1fe13ee1..0ec76a2f 100644
--- a/special-functions/zeta.lisp
+++ b/special-functions/zeta.lisp
@@ -1,8 +1,8 @@
 ;; Zeta functions
 ;; Liam Healy, Sat May 13 2006 - 23:27
-;; Time-stamp: <2009-12-27 10:09:58EST zeta.lisp>
+;; Time-stamp: <2011-10-29 23:45:11EDT zeta.lisp>
 ;;
-;; Copyright 2006, 2007, 2008 Liam M. Healy
+;; Copyright 2006, 2007, 2008, 2011 Liam M. Healy
 ;; Distributed under the terms of the GNU General Public License
 ;;
 ;; This program is free software: you can redistribute it and/or modify
@@ -33,14 +33,14 @@
    "The Riemann zeta function zeta(n)."))
 
 (defmfun zeta ((n integer))
-  "gsl_sf_zeta_int_e" ((n :int) (ret sf-result))
+  "gsl_sf_zeta_int_e" ((n :int) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t
   :documentation			; FDL
   "The Riemann zeta function zeta(n) for integer n, n \ne 1.")
 
 (defmfun zeta ((s float))
-  "gsl_sf_zeta_e" ((s :double) (ret sf-result))
+  "gsl_sf_zeta_e" ((s :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.")
@@ -53,14 +53,14 @@
   (:documentation "zeta - 1."))
 
 (defmfun zeta-1 ((n integer))
-  "gsl_sf_zetam1_int_e" ((n :int) (ret sf-result))
+  "gsl_sf_zetam1_int_e" ((n :int) (ret (:pointer (:struct sf-result))))
   :definition :method
   :export t
   :documentation			; FDL
   "The Riemann zeta function zeta(n) for integer n, n \ne 1.")
 
 (defmfun zeta-1 ((s float))
-  "gsl_sf_zetam1_e" ((s :double) (ret sf-result))
+  "gsl_sf_zetam1_e" ((s :double) (ret (:pointer (:struct sf-result))))
   :definition :method
   :documentation			; FDL
   "The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.")
@@ -70,7 +70,7 @@
 ;;;;****************************************************************************
 
 (defmfun hurwitz-zeta (s q)
-  "gsl_sf_hzeta_e" ((s :double) (q :double) (ret sf-result))
+  "gsl_sf_hzeta_e" ((s :double) (q :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The Hurwitz zeta function zeta(s,q) for s > 1, q > 0.")
 
@@ -79,7 +79,7 @@
 ;;;;****************************************************************************
 
 (defmfun eta (s)
-  "gsl_sf_eta_e" ((s :double) (ret sf-result))
+  "gsl_sf_eta_e" ((s :double) (ret (:pointer (:struct sf-result))))
   :documentation			; FDL
   "The eta function eta(s) for arbitrary s.")
 
-- 
GitLab