Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by mhx (4226) on 2004.08.20 2:23 (#33536)

    Thanks to jplindstrom for pointing me at Win32::API which already handles structs; I think I can modify that code to work on other platforms. What's a little sizeof between friends?

    What I don't like about the way Win32::API handles structs is that it forces you to write the spec for each struct manually.

    You probably also want to have a look at Convert::Binary::C [cpan.org], which allows for directly parsing C header files and using that information to pack/unpack binary data. It comes with a fully integrated C preprocessor, isn't limited to structs (handles unions, arrays, typedefs as well, and all of them recursively), and is highly configurable. It also has methods like sizeof or offsetof, and over 100k of POD. (end of ad... ;-)

    I had something similar to P5NCI on my mind, probably based on libffi, and I think it's definitely useful. Nice work!