> "Richard L. Hamilton" wrote:
> > 
> > [...]
> > > Hence, I totally agree with...
> [snip]
> > >From my point of view, function-call-like APIs that deal with binary
> > data, preferably available in both C and perl (the latter for those for
> > whom everything has to be some sort of script), are preferable to
> > new _text_ pseudo files that then need to be parsed from text back to
> > something machine readable, which for particularly _human_ readable
> > formats, may not be both efficient and unambiguous.
> > (along those lines, it would be handy if there were a ksh93 extension
> > that could map C data structures to ksh93 nested variables (using
> > the API for the memory model of the ksh93 binary), not unlike what can
> > be done for perl like that)
> 
> Does "perl" have any special support for mapping C structures to
> variables (e.g. some kind of compiler/script - "in" C structure type,
> "out" perl code) ? ksh93 has an API which allows shell variables to use
> native C variables&&datatypes as storage... but I am not sure whether
> this is what you mean...

Perl has a mechanism (called XSUB) to write glue code between C and Perl. It 
is definitely not the nicest part of the language. Using this mechanism you 
can export C data structures as Perl objects, but this is, by no means, 
automatic.

- akolb


Reply via email to