diff options
Diffstat (limited to 'debian/pyrex/pyrex-0.9.9/Demos/callback')
8 files changed, 0 insertions, 83 deletions
diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile b/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile deleted file mode 100644 index 890bc808..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -all: - python Setup.py build_ext --inplace - -test: all - python run_cheese.py - -clean: - @echo Cleaning Demos/callback - @rm -f cheese.c *.o *.so *~ core - @rm -rf build diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile.nodistutils b/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile.nodistutils deleted file mode 100644 index 012c1a86..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/Makefile.nodistutils +++ /dev/null @@ -1,19 +0,0 @@ -PYHOME = $(HOME)/pkg/python/version -PYINCLUDE = \ - -I$(PYHOME)/include/python2.2 \ - -I$(PYHOME)/$(ARCH)/include/python2.2 - -%.c: %.pyx - ../../bin/pyrexc $< - -%.o: %.c - gcc -c -fPIC $(PYINCLUDE) $< - -%.so: %.o - gcc -shared $< -lm -o $@ - -all: cheese.so - -clean: - @echo Cleaning Demos/callback - @rm -f *.c *.o *.so *~ core core.* diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/README.txt b/debian/pyrex/pyrex-0.9.9/Demos/callback/README.txt deleted file mode 100644 index fa3b871c..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/README.txt +++ /dev/null @@ -1 +0,0 @@ -This example demonstrates how you can wrap a C API
that has a callback interface, so that you can
pass Python functions to it as callbacks.
The files cheesefinder.h and cheesefinder.c
represent the C library to be wrapped.
The file cheese.pyx is the Pyrex module
which wraps it.
The file run_cheese.py demonstrates how to
call the wrapper.
\ No newline at end of file diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/Setup.py b/debian/pyrex/pyrex-0.9.9/Demos/callback/Setup.py deleted file mode 100644 index 5e48206a..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/Setup.py +++ /dev/null @@ -1,11 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -from Pyrex.Distutils import build_ext - -setup( - name = 'callback', - ext_modules=[ - Extension("cheese", ["cheese.pyx", "cheesefinder.c"]), - ], - cmdclass = {'build_ext': build_ext} -) diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx b/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx deleted file mode 100644 index db0fc082..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheese.pyx +++ /dev/null @@ -1,13 +0,0 @@ -# -# 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) diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.c b/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.c deleted file mode 100644 index ab41853b..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * An example of a C API that provides a callback mechanism. - */ - -#include "cheesefinder.h" - -static char *cheeses[] = { - "cheddar", - "camembert", - "that runny one", - 0 -}; - -void find_cheeses(cheesefunc user_func, void *user_data) { - char **p = cheeses; - while (*p) { - user_func(*p, user_data); - ++p; - } -} - diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.h b/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.h deleted file mode 100644 index 3c31bdc0..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/cheesefinder.h +++ /dev/null @@ -1 +0,0 @@ -typedef void (*cheesefunc)(char *name, void *user_data);
void find_cheeses(cheesefunc user_func, void *user_data);
\ No newline at end of file diff --git a/debian/pyrex/pyrex-0.9.9/Demos/callback/run_cheese.py b/debian/pyrex/pyrex-0.9.9/Demos/callback/run_cheese.py deleted file mode 100644 index 65fd431b..00000000 --- a/debian/pyrex/pyrex-0.9.9/Demos/callback/run_cheese.py +++ /dev/null @@ -1,7 +0,0 @@ -import cheese - -def report_cheese(name): - print "Found cheese:", name - -cheese.find(report_cheese) - |
