Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/python3
from cffi import FFI
f = FFI()
@f.callback("int(int)")
def pytest(a):
return a*a
f.cdef("""
void test(void);
int (*pytest)(int);
""")
l = f.verify('''
#include <stdio.h>
static int (*pytest)(int);
void test(){
printf("Alice ma %d lalek.\\n", pytest(3));
}
''')
l.pytest = pytest
l.test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.