[Cython] C data type and a C function() sharing the same name

Marin Atanasov Nikolov dnaeon at gmail.com
Sat Jun 1 15:29:17 CEST 2013


Hello,

Working on creating Cython wrappers for a C library I came across a strange
problem.

I have in the C library a struct like this:

 struct my_jobs;

I also have this function, which returns the next job in the queue:

 int my_jobs(struct my_jobs *jobs);

Translating this into Cython and putting this in the .pxd file it looks
like this:

  cdef struct my_jobs
  int my_jobs(my_jobs *jobs)

During build I'm having issues because it seems that the function my_jobs()
is translated in a way that it should return a "int struct my_jobs".

The real problem I see is that I cannot have a data type and a function
sharing the same name.

How can I overcome this issue? Suppose that I wrote the C API I could
change that, but how would you really  solve this if you cannot touch
what's in upstream?

Any ways to solve this?

Thanks and regards,
Marin

-- 
Marin Atanasov Nikolov

dnaeon AT gmail DOT com
http://www.unix-heaven.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20130601/5bee220d/attachment.html>


More information about the cython-devel mailing list