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


#? *** pysequence

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

#? * (dummy_pysequence)
#? * (pysequence_check <o>)
#? * (pysequence_size <o>)
#? * (pysequence_length <o>)
#? * (pysequence_concat <o1> <o2>)
#? * (pysequence_repeat <o> <count>)
#? * (pysequence_getitem <o> <i>)
#? * (pysequence_getslice <o> <i1> <i2>)
#? * (pysequence_setitem <o> <i> <v>)
#? * (pysequence_delitem <o> <i>)
#? * (pysequence_setslice <o> <i1> <i2> <v>)
#? * (pysequence_delslice <o> <i1> <i2>)
#? * (pysequence_tuple <o>)
#? * (pysequence_list <o>)
#? * (pysequence_fast <o> <m>)
#? * (pysequence_count <o> <value>)
#? * (pysequence_contains <seq> <ob>)
#? * (_pysequence_itersearch <seq> <obj> <operation>)
#? * (pysequence_in <o> <value>)
#? * (pysequence_index <o> <value>)
#? * (pysequence_inplaceconcat <o1> <o2>)
#? * (pysequence_inplacerepeat <o> <count>)

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

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

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

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

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

(de PySequence_Repeat ( o  count )
    ((-gptr-"PyObject *") o)  
    ((-int-) count)   
    (gptr  #{  PySequence_Repeat( $o   ,$count )  #} ))        ;; PyObject * -> gptr

(de PySequence_GetItem ( o  i )
    ((-gptr-"PyObject *") o)  
    ((-int-) i)   
    (gptr  #{  PySequence_GetItem( $o   ,$i )  #} ))        ;; PyObject * -> gptr

(de PySequence_GetSlice ( o  i1  i2 )
    ((-gptr-"PyObject *") o)  
    ((-int-) i1)  
    ((-int-) i2)   
    (gptr  #{  PySequence_GetSlice( $o   ,$i1   ,$i2 )  #} ))        ;; PyObject * -> gptr

(de PySequence_SetItem ( o  i  v )
    ((-gptr-"PyObject *") o)  
    ((-int-) i)  
    ((-gptr-"PyObject *") v)   
    (int  #{  PySequence_SetItem( $o   ,$i   ,$v )  #} ))

(de PySequence_DelItem ( o  i )
    ((-gptr-"PyObject *") o)  
    ((-int-) i)   
    (int  #{  PySequence_DelItem( $o   ,$i )  #} ))

(de PySequence_SetSlice ( o  i1  i2  v )
    ((-gptr-"PyObject *") o)  
    ((-int-) i1)  
    ((-int-) i2)  
    ((-gptr-"PyObject *") v)   
    (int  #{  PySequence_SetSlice( $o   ,$i1   ,$i2   ,$v )  #} ))

(de PySequence_DelSlice ( o  i1  i2 )
    ((-gptr-"PyObject *") o)  
    ((-int-) i1)  
    ((-int-) i2)   
    (int  #{  PySequence_DelSlice( $o   ,$i1   ,$i2 )  #} ))

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

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

(de PySequence_Fast ( o  m )
    ((-gptr-"PyObject *") o)  
    ((-str-) m)   
    (gptr  #{  PySequence_Fast( $o   ,$m->data )  #} ))        ;; PyObject * -> gptr

(de PySequence_Count ( o  value )
    ((-gptr-"PyObject *") o)  
    ((-gptr-"PyObject *") value)   
    (int  #{  PySequence_Count( $o   ,$value )  #} ))

(de PySequence_Contains ( seq  ob )
    ((-gptr-"PyObject *") seq)  
    ((-gptr-"PyObject *") ob)   
    (int  #{  PySequence_Contains( $seq   ,$ob )  #} ))

(de _PySequence_IterSearch ( seq  obj  operation )
    ((-gptr-"PyObject *") seq)  
    ((-gptr-"PyObject *") obj)  
    ((-int-) operation)   
    (int  #{ _PySequence_IterSearch( $seq   ,$obj   ,$operation )  #} ))

(de PySequence_In ( o  value )
    ((-gptr-"PyObject *") o)  
    ((-gptr-"PyObject *") value)   
    (int  #{  PySequence_In( $o   ,$value )  #} ))

(de PySequence_Index ( o  value )
    ((-gptr-"PyObject *") o)  
    ((-gptr-"PyObject *") value)   
    (int  #{  PySequence_Index( $o   ,$value )  #} ))

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

(de PySequence_InPlaceRepeat ( o  count )
    ((-gptr-"PyObject *") o)  
    ((-int-) count)   
    (gptr  #{  PySequence_InPlaceRepeat( $o   ,$count )  #} ))        ;; PyObject * -> gptr

()
;; ********************************************************

(dhc-make () 
  dummy_pysequence
  pysequence_check
  pysequence_size
  pysequence_length
  pysequence_concat
  pysequence_repeat
  pysequence_getitem
  pysequence_getslice
  pysequence_setitem
  pysequence_delitem
  pysequence_setslice
  pysequence_delslice
  pysequence_tuple
  pysequence_list
  pysequence_fast
  pysequence_count
  pysequence_contains
  _pysequence_itersearch
  pysequence_in
  pysequence_index
  pysequence_inplaceconcat
  pysequence_inplacerepeat
)
