Re: Need help with C extension module

2005-09-13 Thread Ken Seehart
chris wrote: > This is my first attempt at undertaking a C extension module. I want > to wrap an existing C library so I can call the functions from Python. > There are only two functions I'm interested in calling. I did mess > with Pyrex a bit and Swig, to no avail, so I turned to doing it by >

Re: Need help with C extension module

2005-09-08 Thread chris
Ok, I found further examples on the Internet and got something working (it seems), but I have a question about the memory management. The example I found did not include any of the PyMem_... functions. Here's roughly what I have working: cdef extern from "my.h": cdef struct inputs: char

Re: Need help with C extension module

2005-09-07 Thread chris
Many thanks Robert. That will be a good starting point. -Chris http://auslunch.com/ http://fetidcascade.com/ http://strombergers.com/python/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with C extension module

2005-09-07 Thread Robert Kern
chris wrote: > Any tips on what the pyrex should look like for my example? # Untested and off the top of my head; please read the Pyrex # documentation and correct my mistakes before using any of this! # Notably, I'm pretty sure the __init__ and __dealloc__ bits are # slightly wrong. cdef extern

Re: Need help with C extension module

2005-09-07 Thread chris
Any tips on what the pyrex should look like for my example? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with C extension module

2005-09-07 Thread Robert Kern
chris wrote: > This is my first attempt at undertaking a C extension module. I want > to wrap an existing C library so I can call the functions from Python. > There are only two functions I'm interested in calling. I did mess > with Pyrex a bit and Swig, to no avail, so I turned to doing it by >