| Current Path : /opt/alt/python37/share/doc/alt-python37-Cython/Demos/callback/ |
| Current File : //opt/alt/python37/share/doc/alt-python37-Cython/Demos/callback/cheese.pyx |
#
# Cython wrapper for the cheesefinder API
#
cdef extern from "cheesefinder.h":
ctypedef void (*cheesefunc)(char *name, void *user_data)
void find_cheeses(cheesefunc user_func, void *user_data)
def find(f):
find_cheeses(callback, <void*>f)
cdef void callback(char *name, void *f):
(<object>f)(name.decode('utf-8'))