Hi everyone. I'm quite new at Cython, but I'm impressed how fast I've produced some usable code, it's a great project.
I'm trying to wrap a C library for regular expressions. It's called Oniguruma. You might wonder why would I like to reinvent the wheel when Python's re module is reasonably fast and easy to use. Well, my goal is to support oniguruma regexes since Textmate's syntax definitions are not Python's re compatible. Textmate has a lot of plugins, or bundles as they call them. Most of these bundles are Open Source, but there's no Open Source editor which supports them. Our aim is to create text editor which supports these bundles, and a key element is to be able to use Oniguruma regexes. I've followed the tutorial, and I've translated most of the .h strcut definitions. I want to wrap these structs in python objects [0], I've read cdefs objects, but I'm not sure if cython will automatically convert a C struct pointer, returned by a C function, into a Python object, with some custom methods. Just in case there's anybody interested in the project, here's the repo [1]. In particular the code I'm working on is this [2] based on this .h file [3]. Thanks Nahuel [0] http://docs.cython.org/src/tutorial/cdef_classes.html [1] https://github.com/D3f0/prymatex [2] https://github.com/D3f0/prymatex/blob/master/src/prymatex/lib/oniguruma/pyonig.pyx [3] https://github.com/D3f0/prymatex/blob/master/src/prymatex/lib/oniguruma/includes/oniguruma.h _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
