Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

C structures ?

by carcassonne (Pilgrim)
on Dec 13, 2005 at 17:35 UTC ( #516365=perlquestion: print w/replies, xml ) Need Help??
carcassonne has asked for the wisdom of the Perl Monks concerning the following question:

Folks,

Is there a way (or many !) to use the definition of structures in C header files in a Perl program ? The idea is to use already-defined structures from a previous project while saving - if possible - time re-writing them from scratch in Perl.

Thanks.

Replies are listed 'Best First'.
Re: C structures ?
by derby (Abbot) on Dec 13, 2005 at 18:49 UTC

    Why stop at the structures? If you have a decent library to go with the structures, use it also. <blatant_xp_grasp>Check out my Inline::C tutorial that uses the c services lib</blatant_xp_grasp>.

    -derby
Re: C structures ?
by CountOrlok (Friar) on Dec 13, 2005 at 17:51 UTC
    Maybe h2ph is the answer to your prayers. (man h2ph)
    -imran
Re: C structures ?
by samtregar (Abbot) on Dec 13, 2005 at 19:24 UTC
    While Inline::C may help you'll probably have to write some interface code if you have large and/or complex structures. SWIG may be a better tool for this job since it has lots of automated interface generation built-in and can handle just about any legal C structure. I used it when I was working on Coagula and it was a real champ.

    -sam

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://516365]
Approved by friedo
help
Chatterbox?
[thezip]: G'day monks!
[thezip]: There's a word I'm looking for, which describes the (lack of) repeatability of an instruction. Specifically, when a command is run the first time, it succeeds, but then every subsequent execution of the same command results in an identical result...
[thezip]: What is the name of this property?
[marto]: /mewaves
[marto]: /mefails
[thezip]: Duh... I found it. Idempotentcy

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2018-07-18 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (395 votes). Check out past polls.

    Notices?