Great.
It did work. :)
On Thu, May 21, 2015 at 11:12 AM, Yicong Huang wrote:
> With PyPy "pypy_execute_source_ptr()", we could pass a C function pointer
> to python code.
> The funtion pointer was initilized in C code.
> Could PyPy use this function pointer callback to C code?
>
With PyPy "pypy_execute_source_ptr()", we could pass a C function pointer
to python code.
The funtion pointer was initilized in C code.
Could PyPy use this function pointer callback to C code?
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.pyt
On May 20, 2015 1:39:57 AM CDT, Armin Rigo wrote:
>Hi Ryan,
>
>On 19 May 2015 at 20:09, Ryan Gonzalez wrote:
>> Why not return a pointer to a double? Like (UNTESTED!):
>>
>> d = ffi.new('double*')
>> d[0] = 9.0
>> return d
>
>This doesn't work! You can't return a ffi.new() pointer, because the
Hi Yicong, hi Amaury,
On 20 May 2015 at 12:27, Amaury Forgeot d'Arc wrote:
> Haha, but there is a bug in cffi I think.
Thanks for the bug report. Fixed in 2dfaf4b4f0aa.
Armin
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailm
Haha, but there is a bug in cffi I think.
I just filed
https://bitbucket.org/cffi/cffi/issue/193/forward-declaration-of-struct-does-not
with a simpler test case.
2015-05-20 12:03 GMT+02:00 Yicong Huang :
> Oh, great thanks for you help!
> Finally, I found out the real issue.
> The whold code is
Oh, great thanks for you help!
Finally, I found out the real issue.
The whold code is this:
@ffi.callback("struct api_ret*(char *)")
def udf_api(arg0):
return None
ffi.cdef('''
struct API {
struct api_ret* (*pyudf)(char* str);
};
''')
ffi.cdef('''
struct api_ret {
char *ret1;
2015-05-20 11:44 GMT+02:00 Yicong Huang :
> Hi,
>
> The below is the code we met troubles;
>
> ffi.cdef('''
> struct API {
> struct api_ret* (*pyudf)(char* str);
> };
> ''')
>
> ffi.cdef('''
> struct api_ret {
> char *ret1;
> char *ret2;
> char *ret3;
> };
> ''')
>
> re
Hi,
The below is the code we met troubles;
ffi.cdef('''
struct API {
struct api_ret* (*pyudf)(char* str);
};
''')
ffi.cdef('''
struct api_ret {
char *ret1;
char *ret2;
char *ret3;
};
''')
result = ffi.new('struct api_ret*')
At first, we defined struct API with a fun
2015-05-20 9:54 GMT+02:00 Yicong Huang :
> Yes, C could *not* have a function that returns either a double or NULL.
> But python could.
> In addition, python could have a function paramter that is either int or
> None.
>
> The problem is we might get a python function, and we would like to call
>
Yes, C could *not* have a function that returns either a double or NULL.
But python could.
In addition, python could have a function paramter that is either int or
None.
The problem is we might get a python function, and we would like to call
this python function in C.
We're not sure whether this
10 matches
Mail list logo