;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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 "python/python-config")


#? *** pynumber

;; dummy function that adds Python C header files in C file
(eval `(de dummy_pynumber () ,python-cpheader-cmd ()))

#? * (dummy_pynumber)
#? * (pynumber_check <o>)
#? * (pynumber_add <o1> <o2>)
#? * (pynumber_subtract <o1> <o2>)
#? * (pynumber_multiply <o1> <o2>)
#? * (pynumber_divide <o1> <o2>)
#? * (pynumber_floordivide <o1> <o2>)
#? * (pynumber_truedivide <o1> <o2>)
#? * (pynumber_remainder <o1> <o2>)
#? * (pynumber_divmod <o1> <o2>)
#? * (pynumber_power <o1> <o2> <o3>)
#? * (pynumber_negative <o>)
#? * (pynumber_positive <o>)
#? * (pynumber_absolute <o>)
#? * (pynumber_invert <o>)
#? * (pynumber_lshift <o1> <o2>)
#? * (pynumber_rshift <o1> <o2>)
#? * (pynumber_and <o1> <o2>)
#? * (pynumber_xor <o1> <o2>)
#? * (pynumber_or <o1> <o2>)
#? * (pynumber_int <o>)
#? * (pynumber_long <o>)
#? * (pynumber_float <o>)
#? * (pynumber_inplaceadd <o1> <o2>)
#? * (pynumber_inplacesubtract <o1> <o2>)
#? * (pynumber_inplacemultiply <o1> <o2>)
#? * (pynumber_inplacedivide <o1> <o2>)
#? * (pynumber_inplacefloordivide <o1> <o2>)
#? * (pynumber_inplacetruedivide <o1> <o2>)
#? * (pynumber_inplaceremainder <o1> <o2>)
#? * (pynumber_inplacepower <o1> <o2> <o3>)
#? * (pynumber_inplacelshift <o1> <o2>)
#? * (pynumber_inplacershift <o1> <o2>)
#? * (pynumber_inplaceand <o1> <o2>)
#? * (pynumber_inplacexor <o1> <o2>)
#? * (pynumber_inplaceor <o1> <o2>)
#? * (pynumber_coerce <o1> <om>)
#? * (pynumber_coerceex <o1> <om>)

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

(de PyNumber_Check ( o )
    ((-gptr-"PyObject *") o)   
    (int  #{  PyNumber_Check( $o )  #} ))

(de PyNumber_Add ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Add( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Subtract ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Subtract( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Multiply ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Multiply( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Divide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Divide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_FloorDivide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_FloorDivide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_TrueDivide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_TrueDivide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Remainder ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Remainder( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Divmod ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Divmod( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Power ( o1  o2  o3 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)  
    ((-gptr-"PyObject *") o3)   
    (gptr  #{  PyNumber_Power( $o1   ,$o2   ,$o3 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Negative ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Negative( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Positive ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Positive( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Absolute ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Absolute( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Invert ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Invert( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Lshift ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Lshift( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Rshift ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Rshift( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_And ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_And( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Xor ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Xor( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Or ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_Or( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Int ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Int( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Long ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Long( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Float ( o )
    ((-gptr-"PyObject *") o)   
    (gptr  #{  PyNumber_Float( $o )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceAdd ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceAdd( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceSubtract ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceSubtract( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceMultiply ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceMultiply( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceDivide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceDivide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceFloorDivide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceFloorDivide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceTrueDivide ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceTrueDivide( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceRemainder ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceRemainder( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlacePower ( o1  o2  o3 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)  
    ((-gptr-"PyObject *") o3)   
    (gptr  #{  PyNumber_InPlacePower( $o1   ,$o2   ,$o3 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceLshift ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceLshift( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceRshift ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceRshift( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceAnd ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceAnd( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceXor ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceXor( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_InPlaceOr ( o1  o2 )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)   
    (gptr  #{  PyNumber_InPlaceOr( $o1   ,$o2 )  #} ))        ;; PyObject * -> gptr

(de PyNumber_Coerce ( o1  om )
    ((-gptr-"PyObject **") o1)  
    ((-gptr-"PyObject **") om)   
    (int  #{  PyNumber_Coerce( $o1   ,$om )  #} ))

(de PyNumber_CoerceEx ( o1  om )
    ((-gptr-"PyObject **") o1)  
    ((-gptr-"PyObject **") om)   
    (int  #{  PyNumber_CoerceEx( $o1   ,$om )  #} ))


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

(dhc-make () 
  dummy_pynumber
  pynumber_check
  pynumber_add
  pynumber_subtract
  pynumber_multiply
  pynumber_divide
  pynumber_floordivide
  pynumber_truedivide
  pynumber_remainder
  pynumber_divmod
  pynumber_power
  pynumber_negative
  pynumber_positive
  pynumber_absolute
  pynumber_invert
  pynumber_lshift
  pynumber_rshift
  pynumber_and
  pynumber_xor
  pynumber_or
  pynumber_int
  pynumber_long
  pynumber_float
  pynumber_inplaceadd
  pynumber_inplacesubtract
  pynumber_inplacemultiply
  pynumber_inplacedivide
  pynumber_inplacefloordivide
  pynumber_inplacetruedivide
  pynumber_inplaceremainder
  pynumber_inplacepower
  pynumber_inplacelshift
  pynumber_inplacershift
  pynumber_inplaceand
  pynumber_inplacexor
  pynumber_inplaceor
  pynumber_coerce
  pynumber_coerceex
)
