[Cython] Gsoc project

Philip Herron redbrain at gcc.gnu.org
Thu Mar 29 04:58:21 CEST 2012

Hey all

I am implemented a very crude and simplistic and very badly programmed
version of a pxd generator i think i understand what were after now
but i would appreciate if you look over what i did to make sure i have
grasped the basic idea for now:

So if i have:

#include "test.h"

int add (int x, int y)
  return x + y;

#ifndef __TEST_H__
#define __TEST_H__

extern int add (int, int);

struct foobar {
  int a;
  unsigned char * b;

#endif //__TEST_H_

We run gcc -fplugin=./python.so -fplugin-arg-python-script=walk.py test.c

And i output out.pxd:

cdef extern from "test.h":
	int add (int, int)

	ctypedef struct foobar:
		int a
		unsigned char * b

So far in a very crude way it understands structs and functions but
nothing else i can see how it could all work but i see now why you see
it could be a very small project David's plugin system has mostly
everything done for you but i would like to add to his plugin for some
tree access code etc...

Adding a config file for telling the plugin to not care about certain
things would be a nice addition. It seems interesting the clang idea,
it could be interesting porting this to other front-ends of gcc like

-------------- next part --------------
A non-text attachment was scrubbed...
Name: walk.py
Type: text/x-python
Size: 2180 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20120329/cdeb9453/attachment.py>

More information about the cython-devel mailing list