logo       

Re: Preventing a user to refer to non-existent struct members: msg#00107

programming.swig

Subject: Re: Preventing a user to refer to non-existent struct members

If you send a small example of what is needed, we can try to add it to
the system as a feature (or global option) to force the C-structure
to be a "closed one",

So, please send what is needed to "close" the following structure

struct Foo {
int bar;
};


and also, a good name for the feature, "close structure" is not good.

Marcelo


Robert Lupton wrote:

I've found that a fruitful source of bugs is setting (at the python level)
non-existent elements in C-level structs.

I can avoid this (in python 2.3 at least) by setting __slots__ in the
class definition to the C-level members (i.e. .__swig_getmethods__.keys()).

Unfortunately, I don't see how I can do this without post-processing the
swig-generated interface.py file. Is there a trick known to the
cognoscenti? Or is there a better way of doing this?

R

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig


_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise