~ubuntu-branches/ubuntu/trusty/pyrex/trusty-proposed

« back to all changes in this revision

Viewing changes to Demos/callback/cheese.pyx

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-01-03 20:56:08 UTC
  • mto: (2.1.3 dapper) (4.1.1 lenny) (1.1.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060103205608-4i29xv9avi33du20
Tags: upstream-0.9.3.1
ImportĀ upstreamĀ versionĀ 0.9.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
#   Pyrex wrapper for the cheesefinder API
3
 
#
4
 
 
5
 
cdef extern from "cheesefinder.h":
6
 
        ctypedef void (*cheesefunc)(char *name, void *user_data)
7
 
        void find_cheeses(cheesefunc user_func, void *user_data)
8
 
 
9
 
def find(f):
10
 
        find_cheeses(callback, <void*>f)
11
 
        
12
 
cdef void callback(char *name, void *f):
13
 
        (<object>f)(name)