How do I create a pointer-to-pointer type in Jython without getting a "pointer only supported for scalar types" error?

Viewed 30

I am trying to call external functions inside of a DLL from a Jython script using ctypes.

The prototype is declared as:

extern cl_error_t funcname(const char **varname)

That's why I tried to create the following type:

import ctypes
c_char_pp = ctypes.POINTER(ctypes.c_char_p)

But when I run the code, I get the following error:

java -jar C:\jython2.7.2\jython.jar example.py
Traceback (most recent call last):
  File "example.py", line 3, in <module>
    c_char_pp = ctypes.POINTER(ctypes.c_char_p)
  File "C:\jython2.7.2\Lib\ctypes\__init__.py", line 167, in POINTER
    dict = { '_jffi_type': jffi.Type.Pointer(ctype) }
TypeError: pointer only supported for scalar types

The same code in CPython works fine. Are there any tricks to help solve the problem? Thank you.

0 Answers
Related