summaryrefslogtreecommitdiffstats
path: root/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx')
-rw-r--r--debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx13
1 files changed, 13 insertions, 0 deletions
diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx b/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx
new file mode 100644
index 00000000..db0fc082
--- /dev/null
+++ b/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx
@@ -0,0 +1,13 @@
+#
+# Pyrex 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)