Casey West > Sys-Headers-0.01 > Sys::Headers

Download:
Sys-Headers-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Sys::Headers - Perl interface to system headers.

SYNOPSIS ^

 # Update your header repository
 use Sys::Headers;
 Sys::Headers::convert_headers(
   includedirs => [ qw[
                       /usr/include
                       /usr/local/include
                       /usr/local/apache/include
                  ] ],
   headers     => [ qw[
                       /home/cwest/include/cwest.h
                  ] ],
 );

 # Use headers in your program
 use Sys::Headers qw[paths sys/fcntl];
 my $null = _PATH_DEVNULL;
 my $tmp  = _PATH_TMP;

 open( FILE, "$tmp/file" ) || die $!;
 open( NULL, $null,      ) || die $!;
 
 flock FILE, O_SHLOCK;
 flock NULL, O_EXLOCK;
 
 print NULL $_ while <FILE>;
 
 close NULL;
 close FILE;

DESCRIPTION ^

This is alpha code.

This is alpha code.

This is alpha code.

This module will use h2ph to convert your systems header files into Perl header files. It should be stated that h2ph isn't very good at this, it has some bugs. However, if you can handle a few warnings every now and again, and you need access to information contained in the header files, use this module.

First you need to build a repository of Perl header files. This requires having write access to the place where Sys::Headers is installed. This limitation will most likley change.

Once you've done that, you can use these headers at compile time by listing the ones you want in similar fashion to #include from C.

EXPORT

It will export constants based on which header files you choose to use.

AUTHOR ^

Casey West, <casey@geeknest.com<gt>

COPYRIGHT ^

Copyright (c) 2002 Casey West. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

perl.

syntax highlighting: