Coccinelle release 1.0.0-rc1
[bpt/coccinelle.git] / pycaml / pycaml.ml
CommitLineData
34e49164
C
1(*
2 * (C) arty 2002
3 * This software is covered under the GNU lesser general public license
4 *)
5
6open Int64 ;;
7
ae4735db
C
8type funcptr
9type pyobject
34e49164
C
10type funcent = (funcptr * int * int)
11
ae4735db 12type pymodule_func = { pyml_name : string ;
34e49164
C
13 pyml_func : (pyobject -> pyobject) ;
14 pyml_flags : int ;
15 pyml_doc : string }
16
17type pyobject_type =
18 TupleType
19 | StringType
20 | IntType
21 | FloatType
22 | ListType
23 | NoneType
24 | CallableType
25 | ModuleType
26 | ClassType
27 | NullType
28 | TypeType
29 | OtherType
ae4735db 30
34e49164 31 (* Function list *)
ae4735db 32
34e49164 33external getfuncarray : unit -> funcent array = "pygetfuncarray"
ae4735db 34let py_funcs = getfuncarray ()
34e49164 35external pytype : pyobject -> pyobject_type = "pytype"
ae4735db 36
34e49164
C
37external pyfuncall1 : (funcptr * int * int) -> unit -> unit = "pygencall"
38external pyfuncall2 : (funcptr * int * int) -> int -> unit = "pygencall"
39external pyfuncall3 : (funcptr * int * int) -> string -> unit = "pygencall"
40external pyfuncall4 : (funcptr * int * int) -> unit -> int = "pygencall"
41external pyfuncall5 : (funcptr * int * int) -> string -> int = "pygencall"
42external pyfuncall6 : (funcptr * int * int) -> (int * string) -> int = "pygencall"
43external pyfuncall7 : (funcptr * int * int) -> (int * string * int) -> int =
44 "pygencall"
45external pyfuncall8 : (funcptr * int * int) -> unit -> string = "pygencall"
46external pyfuncall9 : (funcptr * int * int) -> (string * int * pyobject * pyobject) -> pyobject = "pygencall"
ae4735db 47external pyfuncall10 : (funcptr * int * int) ->
34e49164
C
48 (int * string * int * pyobject * pyobject) -> pyobject = "pygencall"
49external pyfuncall11 : (funcptr * int * int) ->
50 (int * string * int * pyobject * pyobject * int) -> pyobject = "pygencall"
51external pyfuncall12 : (funcptr * int * int) ->
52 (string * string * int) -> pyobject = "pygencall"
53external pyfuncall13 : (funcptr * int * int) ->
54 (pyobject * int * int) -> int = "pygencall"
55external pyfuncall14 : (funcptr * int * int) -> pyobject -> pyobject = "pygencall"
56external pyfuncall15 : (funcptr * int * int) -> (pyobject * pyobject * int) -> pyobject = "pygencall"
57external pyfuncall16 : (funcptr * int * int) -> (pyobject * string) -> pyobject = "pygencall"
58external pyfuncall17 : (funcptr * int * int) -> (pyobject * pyobject) -> pyobject = "pygencall"
59external pyfuncall18 : (funcptr * int * int) -> pyobject -> int = "pygencall"
60external pyfuncall19 : (funcptr * int * int) -> (pyobject * pyobject) -> int = "pygencall"
61external pyfuncall20 : (funcptr * int * int) -> (pyobject * pyobject * int) -> int = "pygencall"
62external pyfuncall21 : (funcptr * int * int) -> (pyobject * string * pyobject) -> int = "pygencall"
63external pyfuncall22 : (funcptr * int * int) -> (pyobject * string) -> int = "pygencall"
64external pyfuncall23 : (funcptr * int * int) -> (pyobject * pyobject) -> (pyobject * pyobject) option = "pygencall"
65external pyfuncall24 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) -> int = "pygencall"
66external pyfuncall25 : (funcptr * int * int) -> pyobject -> int64 = "pygencall"
67external pyfuncall26 : (funcptr * int * int) -> pyobject -> string = "pygencall"
68external pyfuncall27 : (funcptr * int * int) -> (pyobject * pyobject) -> pyobject = "pygencall"
69external pyfuncall28 : (funcptr * int * int) -> string -> pyobject = "pygencall"
70external pyfuncall29 : (funcptr * int * int) -> unit -> pyobject = "pygencall"
71external pyfuncall30 : (funcptr * int * int) -> pyobject -> unit = "pygencall"
ae4735db 72external pyfuncall31 : (funcptr * int * int) -> (pyobject * int) ->
34e49164
C
73 (pyobject * pyobject * int) option = "pygencall"
74external pyfuncall34 : (funcptr * int * int) -> int64 -> pyobject = "pygencall"
75external pyfuncall35 : (funcptr * int * int) -> unit -> int64 = "pygencall"
76external pyfuncall36 : (funcptr * int * int) -> float -> pyobject = "pygencall"
77external pyfuncall37 : (funcptr * int * int) -> pyobject -> float = "pygencall"
78external pyfuncall39 : (funcptr * int * int) -> int -> pyobject = "pygencall"
ae4735db 79external pyfuncall40 : (funcptr * int * int) -> (pyobject * int) ->
34e49164
C
80 pyobject = "pygencall"
81external pyfuncall41 : (funcptr * int * int) -> (pyobject * int * pyobject) ->
82 int = "pygencall"
83external pyfuncall42 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
84 pyobject = "pygencall"
ae4735db 85external pyfuncall43 : (funcptr * int * int) -> (pyobject * int) ->
34e49164 86 (int * int * int) option = "pygencall"
ae4735db 87external pyfuncall44 : (funcptr * int * int) -> (int * int * int * int) ->
34e49164
C
88 pyobject = "pygencall"
89external pyfuncall45 : (funcptr * int * int) -> (pyobject * pyobject) -> unit =
90 "pygencall"
91external pyfuncall46 : (funcptr * int * int) -> (pyobject * string) -> unit =
92 "pygencall"
93external pyfuncall47 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
94 (pyobject * pyobject * pyobject) = "pygencall"
95external pyfuncall48 : (funcptr * int * int) -> (pyobject * pyobject * pyobject) ->
96 unit = "pygencall"
97external pyfuncall49 : (funcptr * int * int) -> (pyobject * string) -> pyobject =
98 "pygencall"
99external pyfuncall50 : (funcptr * int * int) -> (string * pyobject * string) ->
100 pyobject = "pygencall"
ae4735db 101external pyfuncall51 : (funcptr * int * int) ->
34e49164
C
102 (string * pyobject * pyobject * pyobject) -> pyobject = "pygencall"
103external pyfuncall52 : (funcptr * int * int) -> pyobject -> string = "pygencall"
104external pyfuncall53 : (funcptr * int * int) -> (pyobject * int * int * pyobject) -> int = "pygencall"
105external pyfuncall54 : (funcptr * int * int) -> (pyobject * int * int) -> int =
106 "pygencall"
107
108let fmt1call func = pyfuncall1 func
109let fmt2call func = pyfuncall2 func
110let fmt3call func = pyfuncall3 func
111let fmt4call func = pyfuncall4 func
112let fmt5call func = pyfuncall5 func
113let fmt6call func = pyfuncall6 func
114let fmt7call func = pyfuncall7 func
115let fmt8call func = pyfuncall8 func
116let fmt9call func = pyfuncall9 func
117let fmt10call func = pyfuncall10 func
118let fmt11call func = pyfuncall11 func
119let fmt12call func = pyfuncall12 func
120let fmt13call func = pyfuncall13 func
121let fmt14call func = pyfuncall14 func
122let fmt15call func = pyfuncall15 func
123let fmt16call func = pyfuncall16 func
124let fmt17call func = pyfuncall17 func
125let fmt18call func = pyfuncall18 func
126let fmt19call func = pyfuncall19 func
127let fmt20call func = pyfuncall20 func
128let fmt21call func = pyfuncall21 func
129let fmt22call func = pyfuncall22 func
130let fmt23call func = pyfuncall23 func
131let fmt24call func = pyfuncall24 func
132let fmt25call func = pyfuncall25 func
133let fmt26call func = pyfuncall26 func
134let fmt27call func = pyfuncall27 func
135let fmt28call func = pyfuncall28 func
136let fmt29call func = pyfuncall29 func
137let fmt30call func = pyfuncall30 func
138let fmt31call func = pyfuncall31 func
139 (* 32 *)
140 (* 33 *)
141let fmt34call func = pyfuncall34 func
142let fmt35call func = pyfuncall35 func
143let fmt36call func = pyfuncall36 func
144let fmt37call func = pyfuncall37 func
145 (* 38 *)
146let fmt39call func = pyfuncall39 func
147let fmt40call func = pyfuncall40 func
148let fmt41call func = pyfuncall41 func
149let fmt42call func = pyfuncall42 func
150let fmt43call func = pyfuncall43 func
151let fmt44call func = pyfuncall44 func
152let fmt45call func = pyfuncall45 func
153let fmt46call func = pyfuncall46 func
154let fmt47call func = pyfuncall47 func
155let fmt48call func = pyfuncall48 func
156let fmt49call func = pyfuncall49 func
157let fmt50call func = pyfuncall50 func
158let fmt51call func = pyfuncall51 func
159let fmt52call func = pyfuncall52 func
160let fmt53call func = pyfuncall53 func
161let fmt54call func = pyfuncall54 func
ae4735db 162
34e49164 163let py_cur_func_num = ref 0
ae4735db 164let pnf () = let this_func = py_funcs.(!py_cur_func_num) in
34e49164 165py_cur_func_num := !py_cur_func_num + 1 ; this_func
ae4735db 166
34e49164
C
167 (* 1 *)
168let py_initialize = fmt1call (pnf ())
169let py_finalize = fmt1call (pnf ())
170let pyerr_print = fmt1call (pnf ())
171 (* 2 *)
172let py_exit = fmt2call (pnf ())
173let pyerr_printex = fmt2call (pnf ())
174 (* 3 *)
175let py_setprogramname = fmt3call (pnf ())
176let py_setpythonhome = fmt3call (pnf ())
177 (* 4 *)
178let py_isinitialized = fmt4call (pnf ())
179 (* 5 *)
180let pyrun_simplestring = fmt5call (pnf ())
181 (* 6 *)
182let pyrun_anyfile = fmt6call (pnf ())
183let pyrun_simplefile = fmt6call (pnf ())
184let pyrun_interactiveone = fmt6call (pnf ())
185let pyrun_interactiveloop = fmt6call (pnf ())
186let py_fdisinteractive = fmt6call (pnf ())
187 (* 7 *)
188let pyrun_anyfileex = fmt7call (pnf ())
189let pyrun_simplefileex = fmt7call (pnf ())
190 (* 8 *)
191let py_getprogramname = fmt8call (pnf ())
192let py_getpythonhome = fmt8call (pnf ())
193let py_getprogramfullpath = fmt8call (pnf ())
194let py_getprefix = fmt8call (pnf ())
195let py_getexecprefix = fmt8call (pnf ())
196let py_getpath = fmt8call (pnf ())
197let py_getversion = fmt8call (pnf ())
198let py_getplatform = fmt8call (pnf ())
199let py_getcopyright = fmt8call (pnf ())
200let py_getcompiler = fmt8call (pnf ())
201let py_getbuildinfo = fmt8call (pnf ())
202 (* 9 *)
203let pyrun_string = fmt9call (pnf ())
204 (* 10 *)
205let pyrun_file = fmt10call (pnf ())
206 (* 11 *)
207let pyrun_fileex = fmt11call (pnf ())
208 (* 12 *)
209let py_compilestring = fmt12call (pnf ())
210 (* 13 *)
211let pyobject_print = fmt13call (pnf ())
212 (* 14 *)
213let pyobject_repr = fmt14call (pnf ())
214let pyobject_str = fmt14call (pnf ())
215let pyobject_unicode = fmt14call (pnf ())
216(* 15 *)
217let pyobject_richcompare = fmt15call (pnf ())
218(* 16 *)
219let pyobject_getattrstring = fmt16call (pnf ())
220(* 17 *)
221let pyobject_getattr = fmt17call (pnf ())
222let pyobject_callobject = fmt17call (pnf ())
223(* 18 *)
224let pyobject_istrue = fmt18call (pnf ())
225let pyobject_not = fmt18call (pnf ())
226let pycallable_check = fmt18call (pnf ())
227(* 19 *)
228let pyobject_compare = fmt19call (pnf ())
229let pyobject_hasattr = fmt19call (pnf ())
230(* 20 *)
231let pyobject_richcomparebool = fmt20call (pnf ())
232(* 21 *)
233let pyobject_setattrstring = fmt21call (pnf ())
234(* 22 *)
235let pyobject_hasattrstring = fmt22call (pnf ())
236(* 23 *)
237let pynumber_coerce = fmt23call (pnf ())
238let pynumber_coerceex = fmt23call (pnf ())
239(* 24 *)
240let pyobject_setattr = fmt24call (pnf ())
241(* 25 *)
242let pyobject_hash = fmt25call (pnf ())
243(* Strings *)
244(* 18 *)
245let pystring_size = fmt18call (pnf ())
246(* 26 *)
247let pystring_asstring = fmt26call (pnf ())
248(* 27 *)
249let pystring_concat = fmt27call (pnf ())
250let pystring_concatanddel = fmt27call (pnf ())
251(* 28 *)
252let pystring_fromstring = fmt28call (pnf ())
253(* 17 *)
254let pystring_format = fmt17call (pnf ())
255
256(* Dictionaries *)
257(* 29 *)
258let pydict_new = fmt29call (pnf ())
259(* 17 *)
260let pydict_getitem = fmt17call (pnf ())
261(* 24 *)
262let pydict_setitem = fmt24call (pnf ())
263(* 19 *)
264let pydict_delitem = fmt19call (pnf ())
265(* 30 *)
266let pydict_clear = fmt30call (pnf ())
267(* 31 *)
268let pydict_next = fmt31call (pnf ())
269(* 14 *)
270let pydict_keys = fmt14call (pnf ())
271let pydict_values = fmt14call (pnf ())
272let pydict_items = fmt14call (pnf ())
273let pydict_copy = fmt14call (pnf ())
274(* 18 *)
275let pydict_size = fmt18call (pnf ())
276(* 16 *)
277let pydict_getitemstring = fmt16call (pnf ())
278(* 22 *)
279let pydict_delitemstring = fmt22call (pnf ())
280(* 21 *)
281let pydict_setitemstring = fmt21call (pnf ())
282
283(* Integer *)
284(* 34 *)
285let pyint_fromlong = fmt34call (pnf ())
286(* 25 *)
287let pyint_aslong = fmt25call (pnf ())
288(* 35 *)
289let pyint_getmax = fmt35call (pnf ())
ae4735db 290
34e49164
C
291(* Float *)
292(* 36 *)
293let pyfloat_fromdouble = fmt36call (pnf ())
294(* 37 *)
295let pyfloat_asdouble = fmt37call (pnf ())
296
297(* Modules *)
298(* 28 *)
299let pymodule_new = fmt28call (pnf ())
300(* 14 *)
301let pymodule_getdict = fmt14call (pnf ())
302(* 26 *)
303let pymodule_getname = fmt26call (pnf ())
304let pymodule_getfilename = fmt26call (pnf ())
305
306(* 39 *)
307let pytuple_new = fmt39call (pnf ())
308(* 18 *)
309let pytuple_size = fmt18call (pnf ())
310let pytuple_check = fmt18call (pnf ())
311(* 40 *)
312let pytuple_getitem = fmt40call (pnf ())
313(* 41 *)
314let pytuple_setitem = fmt41call (pnf ())
315(* 13 *)
316let pytuple_getslice = fmt13call (pnf ())
317
318(* 42 *)
319let pyslice_new = fmt42call (pnf ())
320(* 43 *)
321let pyslice_getindices = fmt43call (pnf ())
322(* 44 *)
323let pyrange_new = fmt44call (pnf ())
324
325(* Error handling definitions *)
326
327(* 30 *)
328let pyerr_setnone = fmt30call (pnf ())
329(* 45 *)
330let pyerr_setobject = fmt45call (pnf ())
331(* 46 *)
332let pyerr_setstring = fmt46call (pnf ())
333(* 29 *)
334let pyerr_occurred = fmt29call (pnf ())
335(* 1 *)
336let pyerr_clear = fmt1call (pnf ())
337(* 47 *)
338let pyerr_fetch = fmt47call (pnf ())
339(* 48 *)
340let pyerr_restore = fmt48call (pnf ())
341
342(* Error testing and normalization *)
343(* 19 *)
344let pyerr_givenexceptionmatches = fmt19call (pnf ())
345(* 18 *)
346let pyerr_exceptionmatches = fmt18call (pnf ())
347(* 47 *)
348let pyerr_normalizeexception = fmt47call (pnf ())
349
350(* Classes *)
351(* 42 *)
352let pyclass_new = fmt42call (pnf ())
353(* 42 *)
354let pyinstance_new = fmt42call (pnf ())
355
356(* 17 *)
357let pyinstance_newraw = fmt17call (pnf ())
358(* 42 *)
359let pymethod_new = fmt42call (pnf ())
360(* 14 *)
361let pymethod_function = fmt14call (pnf ())
362let pymethod_self = fmt14call (pnf ())
363let pymethod_class = fmt14call (pnf ())
364
365(* Module *)
366(* 28 *)
367let pymodule_new = fmt28call (pnf ())
368(* 14 *)
369let pymodule_getdict = fmt14call (pnf ())
370(* 26 *)
371let pymodule_getname = fmt26call (pnf ())
372let pymodule_getfilename = fmt26call (pnf ())
373(* 35 *)
374let pyimport_getmagicnumber = fmt35call (pnf ())
375(* 49 *)
376let pyimport_execcodemodule = fmt49call (pnf ())
377(* 50 *)
378let pyimport_execcodemoduleex = fmt50call (pnf ())
379(* 29 *)
380let pyimport_getmoduledict = fmt29call (pnf ())
381(* 28 *)
382let pyimport_addmodule = fmt28call (pnf ())
383let pyimport_importmodule = fmt28call (pnf ())
0708f913 384(* - disabled, see comment in pycaml_ml.c. - RWMJ
34e49164
C
385(* 51 *)
386let pyimport_importmoduleex = fmt51call (pnf ())
0708f913 387*)
34e49164
C
388(* 28 *)
389let pyimport_import = fmt28call (pnf ())
390(* 14 *)
391let pyimport_reloadmodule = fmt14call (pnf ())
392(* 1 *)
393let pyimport_cleanup = fmt1call (pnf ())
394(* 5 *)
395let pyimport_importfrozenmodule = fmt5call (pnf ())
ae4735db 396
34e49164
C
397(* Interface to random parts in ceval.c *)
398(* 42 *)
399let pyeval_callobjectwithkeywords = fmt42call (pnf ())
400(* 17 *)
413ffc02
C
401(* dropped in Python 2.7
402let pyeval_callobject = fmt17call (pnf ()) *)
34e49164
C
403
404(* 29 *)
405let pyeval_getbuiltins = fmt29call (pnf ())
406let pyeval_getglobals = fmt29call (pnf ())
407let pyeval_getlocals = fmt29call (pnf ())
408let pyeval_getframe = fmt29call (pnf ())
409(* 4 *)
410let pyeval_getrestricted = fmt4call (pnf ())
411
412(* Abstract layer *)
413(* 14 *)
414let pyobject_type = fmt14call (pnf ())
415(* 18 *)
416let pyobject_size = fmt18call (pnf ())
417(* 17 *)
418let pyobject_getitem = fmt17call (pnf ())
419(* 24 *)
420let pyobject_setitem = fmt24call (pnf ())
421(* 17 *)
422let pyobject_delitem = fmt17call (pnf ())
423(* 52 *)
424let pyobject_ascharbuffer = fmt52call (pnf ())
425let pyobject_asreadbuffer = fmt52call (pnf ())
426let pyobject_aswritebuffer = fmt52call (pnf ())
427(* 18 *)
428let pynumber_check = fmt18call (pnf ())
429(* 17 *)
430let pynumber_add = fmt17call (pnf ())
431let pynumber_subtract = fmt17call (pnf ())
432let pynumber_multiply = fmt17call (pnf ())
433let pynumber_divide = fmt17call (pnf ())
434let pynumber_remainder = fmt17call (pnf ())
435let pynumber_divmod = fmt17call (pnf ())
436(* 42 *)
437let pynumber_power = fmt42call (pnf ())
438(* 14 *)
439let pynumber_negative = fmt14call (pnf ())
440let pynumber_positive = fmt14call (pnf ())
441let pynumber_absolute = fmt14call (pnf ())
442let pynumber_invert = fmt14call (pnf ())
443(* 17 *)
444let pynumber_lshift = fmt17call (pnf ())
445let pynumber_rshift = fmt17call (pnf ())
446let pynumber_and = fmt17call (pnf ())
447let pynumber_xor = fmt17call (pnf ())
448let pynumber_or = fmt17call (pnf ())
449(* 14 *)
450let pynumber_int = fmt14call (pnf ())
451let pynumber_long = fmt14call (pnf ())
452let pynumber_float = fmt14call (pnf ())
453(* 17 *)
454let pynumber_inplaceadd = fmt17call (pnf ())
455let pynumber_inplacesubtract = fmt17call (pnf ())
456let pynumber_inplacemultiply = fmt17call (pnf ())
457let pynumber_inplacedivide = fmt17call (pnf ())
458let pynumber_inplaceremainder = fmt17call (pnf ())
459let pynumber_inplacelshift = fmt17call (pnf ())
460let pynumber_inplacershift = fmt17call (pnf ())
461let pynumber_inplaceand = fmt17call (pnf ())
462let pynumber_inplacexor = fmt17call (pnf ())
463let pynumber_inplaceor = fmt17call (pnf ())
464(* 42 *)
465let pynumber_inplacepower = fmt42call (pnf ())
466(* 18 *)
467let pysequence_check = fmt18call (pnf ())
468let pysequence_size = fmt18call (pnf ())
469let pysequence_length = fmt18call (pnf ())
470(* 17 *)
471let pysequence_concat = fmt17call (pnf ())
472(* 40 *)
473let pysequence_repeat = fmt40call (pnf ())
474let pysequence_getitem = fmt40call (pnf ())
475(* 13 *)
476let pysequence_getslice = fmt13call (pnf ())
477(* 41 *)
478let pysequence_setitem = fmt41call (pnf ())
479(* 20 *)
480let pysequence_delitem = fmt20call (pnf ())
481(* 53 *)
482let pysequence_setslice = fmt53call (pnf ())
483(* 54 *)
484let pysequence_delslice = fmt54call (pnf ())
485(* 14 *)
486let pysequence_tuple = fmt14call (pnf ())
487let pysequence_list = fmt14call (pnf ())
488(* 16 *)
489let pysequence_fast = fmt16call (pnf ())
490(* 19 *)
491let pysequence_count = fmt19call (pnf ())
492let pysequence_contains = fmt19call (pnf ())
493let pysequence_in = fmt19call (pnf ())
494let pysequence_index = fmt19call (pnf ())
495(* 17 *)
496let pysequence_inplaceconcat = fmt17call (pnf ())
497(* 22 *)
498let pysequence_inplacerepeat = fmt22call (pnf ())
499(* 18 *)
500let pymapping_check = fmt18call (pnf ())
501let pymapping_size = fmt18call (pnf ())
502let pymapping_length = fmt18call (pnf ())
503(* 16 *)
504let pymapping_haskeystring = fmt16call (pnf ())
505(* 19 *)
506let pymapping_haskey = fmt19call (pnf ())
507(* 16 *)
508let pymapping_getitemstring = fmt16call (pnf ())
509(* 41 *)
510let pymapping_setitemstring = fmt41call (pnf ())
511
512external pynull : unit -> pyobject = "pynull"
513
514external pynone : unit -> pyobject = "pynone"
515external pytrue : unit -> pyobject = "pytrue"
516external pyfalse : unit -> pyobject = "pyfalse"
517
518external pytuple_fromarray : pyobject array -> pyobject = "pytuple_fromarray"
ae4735db
C
519let pytuple_fromsingle elt = pytuple_fromarray [| elt |]
520let pytuple_empty = pytuple_fromarray [| |]
521external pytuple2 : (pyobject * pyobject) -> pyobject =
34e49164
C
522 "pytuple_fromarray"
523external pytuple3 : (pyobject * pyobject * pyobject) -> pyobject =
524 "pytuple_fromarray"
525external pytuple4 : (pyobject * pyobject * pyobject * pyobject) ->
526 pyobject = "pytuple_fromarray"
527external pytuple5 : (pyobject * pyobject * pyobject * pyobject * pyobject) ->
528 pyobject = "pytuple_fromarray"
485bce71
C
529external pytuple6 : (pyobject * pyobject * pyobject * pyobject * pyobject * pyobject) ->
530 pyobject = "pytuple_fromarray"
34e49164
C
531
532let pyint_fromint i = pyint_fromlong (Int64.of_int i)
533let pyint_asint obj = Int64.to_int (pyint_aslong obj)
534
535external pytuple_toarray : pyobject -> pyobject array = "pytuple_toarray"
536
537external pywrap_closure : (pyobject -> pyobject) -> pyobject = "pywrap_closure"
538external pycaml_setargs : string -> unit = "pycaml_setargs"
539
540external pymodule_initmodule : string -> pymodule_func array = "pymodule_initmodule"
541
542external pywrap_value : 'a -> pyobject = "pywrapvalue" ;;
543
544external pyunwrap_value : pyobject -> 'a = "pyunwrapvalue" ;;
545
546let _ = py_initialize () ;;