* Roland Mainz <roland.mainz at nrubsig.org> [2007-07-19 17:01]:
> Alexander Kolbasov wrote:
> > > "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.
> 
> Do you have any URLs which describe the XSUB stuff ?

  There's probably a good online introduction, but the basics are
  already on your system

  $ which perldoc
  /usr/perl5/bin/perldoc
  $ perldoc perlxs
  $ perldoc perlxstut
  $ perldoc perlapi
  $ perldoc perlguts
 
  - Stephen

-- 
sch at sun.com  http://blogs.sun.com/sch/

Reply via email to