;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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")
 
#? *** py

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

#? * (dummy_py)
#? * (py_flushline)
#? * (py_addpendingcall <func> <arg>)
#? * (py_makependingcalls)
#? * (py_setrecursionlimit <im>)
#? * (py_getrecursionlimit)
#? * (py_findmethod <s> <o1> <om>)
#? * (py_findmethodinchain <o1> <o2> <om>)
#? * (py_initmodule4 <name> <methods> <doc> <self> <apiver>)
#? * (py_reprenter <om>)
#? * (py_reprleave <om>)
#? * (_py_hashdouble <s>)
#? * (_py_hashpointer <om>)
#? * (_py_dealloc <om>)
#? * (_py_newreference <om>)
#? * (_py_forgetreference <om>)
#? * (_py_printreferences <om>)
#? * (_py_resetreferences)
#? * (py_fatalerror <message>)
#? * (py_setprogramname <om>)
#? * (py_getprogramname)
#? * (py_setpythonhome <om>)
#? * (py_getpythonhome)
#? * (py_initialize)
#? * (py_finalize)
#? * (py_isinitialized)
#? * (py_newinterpreter)
#? * (py_endinterpreter <om>)
#? * (py_compilestring <o1> <o2> <im>)
#? * (py_compilestringflags <o1> <o2> <s> <om>)
#? * (py_symtablestring <o1> <o2> <im>)
#? * (py_atexit <func>)
#? * (py_exit <im>)
#? * (py_fdisinteractive <o1> <om>)
#? * (py_getprogramfullpath)
#? * (py_getprefix)
#? * (py_getexecprefix)
#? * (py_getpath)
#? * (py_getversion)
#? * (py_getplatform)
#? * (py_getcopyright)
#? * (py_getcompiler)
#? * (py_getbuildinfo)
#? * (_py_releaseinternedstrings)

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

(de Py_FlushLine ()
    (int  #{  Py_FlushLine(  )  #} ))

(de Py_AddPendingCall ( func  arg )
    ((-gptr-) func)  
    ((-gptr-) arg)   
    (int  #{  Py_AddPendingCall( $func   ,$arg )  #} ))

(de Py_MakePendingCalls ()
    (int  #{  Py_MakePendingCalls(  )  #} ))

(de Py_SetRecursionLimit ( im )
    ((-int-) im)   
    #{  Py_SetRecursionLimit( $im );  #} 
    ())

(de Py_GetRecursionLimit ()
    (int  #{  Py_GetRecursionLimit(  )  #} ))


(de Py_FindMethod ( s  o1  om )
    ((-gptr- "PyMethodDef*") s)  
    ((-gptr- "PyObject *") o1)  
    ((-str-) om)   
    (gptr  #{  Py_FindMethod( $s   ,$o1   ,$om->data )  #} ))        ;; PyObject * -> gptr


(de Py_FindMethodInChain ( o1  o2  om )
    ((-gptr- "PyMethodChain *") o1)  
    ((-gptr- "PyObject *") o2)  
    ((-str-) om)   
    (gptr  #{  Py_FindMethodInChain( $o1   ,$o2   ,$om->data )  #} ))        ;; PyObject * -> gptr

(de Py_InitModule4 ( name  methods  doc  self  apiver )
    ((-str-) name)  
    ((-gptr- "PyMethodDef *") methods)  
    ((-str-) doc)  
    ((-gptr- "PyObject *") self)  
    ((-int-) apiver)   
    (gptr  #{  Py_InitModule4( $name->data ,$methods   ,$doc->data ,$self   ,$apiver )  #} ))        ;; PyObject * -> gptr


(de Py_ReprEnter ( om )
    ((-gptr- "PyObject *") om)   
    (int  #{  Py_ReprEnter( $om )  #} ))

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

(de _Py_HashDouble ( s )
    ((-double-) s)   
    (int  #{ _Py_HashDouble( $s )  #} ))            ;; long -> int

(de _Py_HashPointer ( om )
    ((-gptr-) om)   
    (int  #{ _Py_HashPointer( $om )  #} ))          ;; long -> int

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

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

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

(de _Py_PrintReferences ( om )
    ((-gptr- "FILE *") om)   
    #{ _Py_PrintReferences( $om );  #} 
    ())



(de _Py_ResetReferences ()
    #{ _Py_ResetReferences(  );  #} 
    ())


(de Py_FatalError ( message )
    ((-str-) message)   
    #{  Py_FatalError( $message->data );  #} 
    ())


(de Py_SetProgramName ( om )
    ((-str-) om)   
    #{  Py_SetProgramName( $om->data );  #} 
    ())

(de Py_GetProgramName ()
    (gptr  #{  Py_GetProgramName(  )  #} ))   ;; char * -> gptr

(de Py_SetPythonHome ( om )
    ((-str-) om)   
    #{  Py_SetPythonHome( $om->data );  #} 
    ())

(de Py_GetPythonHome ()
    (gptr  #{  Py_GetPythonHome(  )  #} ))   ;; char * -> gptr

(de Py_Initialize ()
    #{ Py_Initialize(  );  #} 
    ())

(de Py_Finalize ()
    #{ Py_Finalize(  );  #} 
    ())

(de Py_IsInitialized ()
    (int  #{  Py_IsInitialized(  )  #} ))

(de Py_NewInterpreter ()
    (gptr  #{  Py_NewInterpreter(  )  #} ))   ;; PyThreadState * -> gptr

(de Py_EndInterpreter ( om )
    ((-gptr- "PyThreadState *") om)   
    #{  Py_EndInterpreter( $om );  #} 
    ())


(de Py_CompileString ( o1  o2  im )
    ((-str- ) o1)  
    ((-str- ) o2)  
    ((-int-) im)   
    (gptr  #{  Py_CompileString( $o1->data ,$o2->data ,$im )  #} ))        ;; PyObject * -> gptr

(de Py_CompileStringFlags ( o1  o2  s  om )
    ((-str- ) o1)  
    ((-str- ) o2)  
    ((-int-) s)  
    ((-gptr- "PyCompilerFlags *") om)   
    (gptr  #{  Py_CompileStringFlags( $o1->data ,$o2->data ,$s   ,$om )  #} ))        ;; PyObject * -> gptr

(de Py_SymtableString ( o1  o2  im )
    ((-str- ) o1)  
    ((-str- ) o2)  
    ((-int-) im)   
    (gptr  #{  Py_SymtableString( $o1->data ,$o2->data ,$im )  #} ))   ;; struct symtable * -> gptr

(de Py_AtExit ( func )
    ((-gptr-) func)   
    (int  #{  Py_AtExit( $func )  #} ))

(de Py_Exit ( im )
    ((-int-) im)   
    #{  Py_Exit( $im );  #} 
    ())

(de Py_FdIsInteractive ( o1  om )
    ((-gptr- "FILE *") o1)  
    ((-str-) om)   
    (int  #{  Py_FdIsInteractive( $o1 ,$om->data )  #} ))

(de Py_GetProgramFullPath ()
    (gptr  #{  Py_GetProgramFullPath(  )  #} ))   ;; char * -> gptr

(de Py_GetPrefix ()
    (gptr  #{  Py_GetPrefix(  )  #} ))   ;; char * -> gptr

(de Py_GetExecPrefix ()
    (gptr  #{  Py_GetExecPrefix(  )  #} ))   ;; char * -> gptr

(de Py_GetPath ()
    (gptr  #{  Py_GetPath(  )  #} ))   ;; char * -> gptr

(de Py_GetVersion ()
    (gptr  #{  Py_GetVersion(  )  #} ))   ;; const char * -> gptr

(de Py_GetPlatform ()
    (gptr  #{  Py_GetPlatform(  )  #} ))   ;; const char * -> gptr

(de Py_GetCopyright ()
    (gptr  #{  Py_GetCopyright(  )  #} ))   ;; const char * -> gptr

(de Py_GetCompiler ()
    (gptr  #{  Py_GetCompiler(  )  #} ))   ;; const char * -> gptr

(de Py_GetBuildInfo ()
    (gptr  #{  Py_GetBuildInfo(  )  #} ))   ;; const char * -> gptr

(de _Py_ReleaseInternedStrings ()
    #{ _Py_ReleaseInternedStrings(  );  #} 
    ())


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

(dhc-make () 
  dummy_py
  py_flushline
  py_addpendingcall
  py_makependingcalls
  py_setrecursionlimit
  py_getrecursionlimit
  py_findmethod
  py_findmethodinchain
  py_initmodule4
  py_reprenter
  py_reprleave
  _py_hashdouble
  _py_hashpointer
  _py_dealloc
  _py_newreference
  _py_forgetreference
;;  _py_printreferences
;;  _py_resetreferences
  py_fatalerror
  py_setprogramname
  py_getprogramname
  py_setpythonhome
  py_getpythonhome
  py_initialize
  py_finalize
  py_isinitialized
  py_newinterpreter
  py_endinterpreter
  py_compilestring
  py_compilestringflags
  py_symtablestring
  py_atexit
  py_exit
  py_fdisinteractive
  py_getprogramfullpath
  py_getprefix
  py_getexecprefix
  py_getpath
  py_getversion
  py_getplatform
  py_getcopyright
  py_getcompiler
  py_getbuildinfo
  _py_releaseinternedstrings
)
