Dear Tassilo! Thank you for your answer, but that is slightly not what I was asking for. Sorry if my first post was not enough clear.
If, as you said, you store a pointer to the C struct somewhere in an SV, the raw memory address becomes available at the perl level. The perl programmer may simply change this value and your C code will not notice it. This just opens a door at perl level to all headaches known to C pointers. So my question was is this avoidable. From your answer that this approach is a common practice I may conclude that it is up to perl programmer to respect the privacy of such data. -- Yours sincerely, Vadim. On Mon, 1 Mar 2004, Tassilo von Parseval wrote: > ... > > The typemap file is just a sort of text template that is processed by > xsubpp. The idea is always the same. You take the address of a C > structure and store it somewhere in an SV, for instance the IV slot. > This happens through ordinary C typecasts. > > Tassilo >