[PyQt] Wrapping a C library with SIP: suggestions/wishlist

Miguel Lobo mlobol at gmail.com
Sun Apr 8 12:35:47 BST 2007


Hi,

I'm using SIP 4.5.2 to wrap a C library and I've noticed the following:

* SIP does not recognise C prototypes without parameters i.e. "void
myfunction(void);"; you have to replace "(void)" by "()".  It would be nice
if SIP supported this syntax (which I believe is valid in C++ too).

* SIP does not allow opaque structs i.e. "struct mystruct;".  To make this
work I've had to do the following:

struct mystruct /Abstract/ {
%TypeHeaderCode

%End
};

Again, it would be nice if the C syntax was supported.

Secondly, just as an idea, I think it would be useful to have some simple
way of specifying read-only global variables and struct members e.g:

const float x = 0.2f;
struct mystruct {
  void *const mymember;
};

This can of course be already achieved using SIP directives and CPython
calls, but it would be nice if there was a clearer, shorter way of doing it.

I'm fairly new to SIP so there might be some point I've missed; if so,
please feel free to point it out.

Thanks,
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070408/c83b8749/attachment.html


More information about the PyQt mailing list