We had a python function that return a string value. The function will callback in C code. The below is an example of the code:
@ffi.callback("char *(char *, char *)") def strconcat(x, y): x1 = ffi.string(x) y1 = ffi.string(y) print x1 + y1 return x1 + y1 The error messages are: Trying to convert the result back to C: TypeError: initializer for ctype 'char *' must be a cdata pointer, not str How could we convert the return python string value to C char*?
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev