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


#? *** pycall

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

#? * (dummy_pycall)
#? * (pyclass_new <o1> <o2> <om>)
#? * (pyinstance_new <o1> <o2> <om>)
#? * (pyinstance_newraw <o1> <om>)
#? * (pymethod_new <o1> <o2> <om>)
#? * (pymethod_function <om>)
#? * (pymethod_self <om>)
#? * (pymethod_class <om>)
#? * (pyclass_issubclass <o1> <om>)
#? * (pyfunction_new <o1> <om>)
#? * (pyfunction_getcode <om>)
#? * (pyfunction_getglobals <om>)
#? * (pyfunction_getdefaults <om>)
#? * (pyfunction_setdefaults <o1> <om>)
#? * (pyfunction_getclosure <om>)
#? * (pyfunction_setclosure <o1> <om>)
#? * (pyclassmethod_new <om>)
#? * (pystaticmethod_new <om>)
#? * (pycallable_check <o>)


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

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

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

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

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

(de PyMethod_Function ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyMethod_Function( $om )  #} ))        ;; PyObject * -> gptr

(de PyMethod_Self ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyMethod_Self( $om )  #} ))        ;; PyObject * -> gptr

(de PyMethod_Class ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyMethod_Class( $om )  #} ))        ;; PyObject * -> gptr

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

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

(de PyFunction_GetCode ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyFunction_GetCode( $om )  #} ))        ;; PyObject * -> gptr

(de PyFunction_GetGlobals ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyFunction_GetGlobals( $om )  #} ))        ;; PyObject * -> gptr

(de PyFunction_GetDefaults ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyFunction_GetDefaults( $om )  #} ))        ;; PyObject * -> gptr

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

(de PyFunction_GetClosure ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyFunction_GetClosure( $om )  #} ))        ;; PyObject * -> gptr

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

(de PyClassMethod_New ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyClassMethod_New( $om )  #} ))        ;; PyObject * -> gptr

(de PyStaticMethod_New ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyStaticMethod_New( $om )  #} ))        ;; PyObject * -> gptr

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

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

(dhc-make () 
  dummy_pycall
  pyclass_new
  pyinstance_new
  pyinstance_newraw
  pymethod_new
  pymethod_function
  pymethod_self
  pymethod_class
  pyclass_issubclass
  pyfunction_new
  pyfunction_getcode
  pyfunction_getglobals
  pyfunction_getdefaults
  pyfunction_setdefaults
  pyfunction_getclosure
  pyfunction_setclosure
  pyclassmethod_new
  pystaticmethod_new
  pycallable_check
)
