-
Notifications
You must be signed in to change notification settings - Fork 17
Utility functions and macros
There are a number of useful utility functions and macros, mostly in JyNI.c, this page aims to document them so that future developers don't have to hunt for them or re-write them.
Arguably the most useful functions in JyNI are JyNI_JythonPyObject_FromPyObject(PyObject* ob)
and JyNI_PyObject_FromJythonPyObject(jobject ob)
. These functions convert between the Jython jobject
representing the object and the C PyObject*
representing the object. For this to work, there needs to be an entry in the builtin types map, and the object needs to have been initialised properly.
JyNI_PyObject_Call(jobject callable, PyObject* args, PyObject* kw)
not only converts args
and kw
to jobject
s but also converts them to Jython's calling convention and makes a proper call to the callable Jython PyObject
.