;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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")



#? *** err

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

#? * (dummy_err)
#? * (gsl_error <reason> <file> <line> <gsl_errno>)
#? * (gsl_warning <reason> <file> <line> <gsl_errno>)
#? * (gsl_stream_printf <label> <file> <line> <reason>)
#? * (gsl_strerror <gsl_errno>)
#? * (gsl_set_error_handler <new_handler>)
#? * (gsl_set_error_handler_off)
#? * (gsl_set_stream_handler <new_handler>)
#? * (gsl_set_stream <new_stream>)
#? * (gsl_message <message> <file> <line> <mask>)

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

;;;;************************************************************************************
;;;;          gsl_errno

(de gsl_error (    reason  file  line  gsl_errno )
    ((-gptr- "const char *") reason) 
    ((-gptr- "const char *") file) 
    ((-int-) line) 
    ((-int-) gsl_errno) 
    #{ gsl_error (  $reason ,$file ,$line ,$gsl_errno) #} 
    ()
)


(de gsl_warning (    reason  file  line  gsl_errno )
    ((-gptr- "const char *") reason) 
    ((-gptr- "const char *") file) 
    ((-int-) line) 
    ((-int-) gsl_errno) 
    #{ gsl_warning (  $reason ,$file ,$line ,$gsl_errno)  #} 
    ()
)


(de gsl_stream_printf (     label   file  line   reason )
    ((-gptr- "const char *") label) 
    ((-gptr- "const char *") file) 
    ((-int-) line) 
    ((-gptr- "const char *") reason) 
    #{ gsl_stream_printf (  $label ,$file ,$line ,$reason) #} 
    ()
)


(de gsl_strerror (    gsl_errno )
    ((-int-) gsl_errno) 
    (gptr #{ gsl_strerror (  $gsl_errno) #} )          ;; const char * -> gptr
)



(de gsl_set_error_handler (    new_handler )
    ((-gptr- "gsl_error_handler_t *") new_handler) 
    (gptr #{ gsl_set_error_handler (  $new_handler) #} )          ;; gsl_error_handler_t * -> gptr
)


(de gsl_set_error_handler_off ( )
    (gptr #{ gsl_set_error_handler_off ( ) #} )          ;; gsl_error_handler_t * -> gptr
)


(de gsl_set_stream_handler (    new_handler )
    ((-gptr- "gsl_stream_handler_t *") new_handler) 
    (gptr #{ gsl_set_stream_handler (  $new_handler) #} )          ;; gsl_stream_handler_t * -> gptr
)


(de gsl_set_stream (    new_stream )
    ((-gptr- "FILE *") new_stream) 
    (gptr #{ gsl_set_stream (  $new_stream) #} )          ;; FILE * -> gptr
)

;;;;*************************************************************************************************
;;;;        gsl_message

(de gsl_message (    message  file  line  mask )
    ((-gptr- "const char *") message) 
    ((-gptr- "const char *") file) 
    ((-int-) line) 
    ((-int-) mask)                                  ;; unsigned -> signed
    #{ gsl_message(  $message ,$file ,$line ,$mask) #} 
    ()
)

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

(dhc-make ()
  dummy_err
;;  gsl_error
;;  gsl_warning
  gsl_stream_printf
  gsl_strerror
  gsl_set_error_handler
  gsl_set_error_handler_off
  gsl_set_stream_handler
  gsl_set_stream
;;  gsl_message
)
