;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "gsl/gsl-config")



#? *** ieee_utils

;; dummy function that adds GSL C header files in C file
(eval `(de dummy_ieee_utils () ,gsl-cpheader-cmd ()))

#? * (dummy_ieee_utils)
#? * (gsl_ieee_printf_float <x>)
#? * (gsl_ieee_printf_double <x>)
#? * (gsl_ieee_fprintf_float <stream> <x>)
#? * (gsl_ieee_fprintf_double <stream> <x>)
#? * (gsl_ieee_float_to_rep <x> <r>)
#? * (gsl_ieee_double_to_rep <x> <r>)
#? * (gsl_ieee_env_setup)
#? * (gsl_ieee_read_mode_string <description> <precision> <rounding> <exception_mask>)
#? * (gsl_ieee_set_mode <precision> <rounding> <exception_mask>)

;; ********************************************************


(de gsl_ieee_printf_float (    x )
    ((-gptr- "const float *") x) 
    #{ gsl_ieee_printf_float (  $x)  #} 
    ()
)

(de gsl_ieee_printf_double (    x )
    ((-gptr- "const double *") x) 
    #{ gsl_ieee_printf_double (  $x)  #} 
    ()
)


(de gsl_ieee_fprintf_float (    stream  x )
    ((-gptr- "FILE *") stream) 
    ((-gptr- "const float *") x) 
    #{ gsl_ieee_fprintf_float (  $stream ,$x)  #} 
    ()
)

(de gsl_ieee_fprintf_double (    stream  x )
    ((-gptr- "FILE *") stream) 
    ((-gptr- "const double *") x) 
    #{ gsl_ieee_fprintf_double (  $stream ,$x)  #} 
    ()
)


(de gsl_ieee_float_to_rep (    x  r )
    ((-gptr- "const float *") x) 
    ((-gptr- "gsl_ieee_float_rep *") r) 
    #{ gsl_ieee_float_to_rep (  $x ,$r)  #} 
    ()
)

(de gsl_ieee_double_to_rep (    x  r )
    ((-gptr- "const double *") x) 
    ((-gptr- "gsl_ieee_double_rep *") r) 
    #{ gsl_ieee_double_to_rep (  $x ,$r)  #} 
    ()
)


(de gsl_ieee_env_setup ( )
    #{ gsl_ieee_env_setup ( )  #} 
    ()
)

(de gsl_ieee_read_mode_string (    description  precision  rounding  exception_mask )
    ((-gptr- "const char *") description) 
    ((-gptr- "int *") precision) 
    ((-gptr- "int *") rounding) 
    ((-gptr- "int *") exception_mask) 
    (int #{ gsl_ieee_read_mode_string (  $description ,$precision ,$rounding ,$exception_mask)  #} )
)

(de gsl_ieee_set_mode (    precision  rounding  exception_mask )
    ((-int-) precision) 
    ((-int-) rounding) 
    ((-int-) exception_mask) 
    (int #{ gsl_ieee_set_mode (  $precision ,$rounding ,$exception_mask)  #} )
)

;; ********************************************************

(dhc-make ()
  dummy_ieee_utils
  gsl_ieee_printf_float
  gsl_ieee_printf_double
  gsl_ieee_fprintf_float
  gsl_ieee_fprintf_double
  gsl_ieee_float_to_rep
  gsl_ieee_double_to_rep
  gsl_ieee_env_setup
  gsl_ieee_read_mode_string
  gsl_ieee_set_mode
)
