How do I specify the structure type returned from a C library?
Konovalov, Vadim (Vadim)** CTR **
vkonovalov at alcatel-lucent.com
Thu Jan 22 16:50:40 UTC 2009
Hi,
I read docs but still can not get it.
The function returns a pointer to a struct, which I successfully declare, given
description of \docs\pmc\struct.pod
Then I read docs further.
that is from \docs\pdds\draft\pdd06_pasm.pod
=item p
PMC thingie. A generic pointer, taken from or stuck into a PMC's data pointer.
If this is a return type, parrot will create a new UnManagedStruct PMC type,
which is just a generic "pointer so some damn thing or other" PMC type which
Parrot does I<no> management of.
which in sync with \docs\pdds\draft\pdd16_native_call.pod:
=item p
PMC thingie. A generic pointer, taken from or stuck into a PMC's data
pointer. If this is a return type, parrot will create a new UnManagedStruct
PMC type, which is just a generic "pointer to some damn thing or other" PMC
type which Parrot does I<no> management of.
However I still can not tie things together.
I get a return from function.
But how do I specify that it is an UnManagedStruct of my type?
I failed to tie my returned pointer to a structire of given geometry.
I tried
setprop obj_struct, "_struct", returned_obj
and tried different combinations - I get different errors, "Missing struct initializer" or something like that,
I am lost.
When the return type from C library is string - then my application works just fine!
But not for struct.
Will appreciate any pointers on the subject.
By the way, are there "union" support, yet?
Thanks in advance,
and
best regards,
Vadim.
More information about the parrot-dev
mailing list