package Fcntl;
+=head1 NAME
+
+Fcntl - load the C Fcntl.h defines
+
+=head1 SYNOPSIS
+
+ use Fcntl;
+
+=head1 DESCRIPTION
+
+This module is just a translation of the C F<fnctl.h> file.
+Unlike the old mechanism of requiring a translated F<fnctl.ph>
+file, this uses the B<h2xs> program (see the Perl source distribution)
+and your native C compiler. This means that it has a
+far more likely chance of getting the numbers right.
+
+=head1 NOTE
+
+Only C<#define> symbols get translated; you must still correctly
+pack up your own arguments to pass as args for locking functions, etc.
+
+=cut
+
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+
require Exporter;
-require AutoLoader;
+use AutoLoader;
require DynaLoader;
-@ISA = (Exporter, DynaLoader);
+@ISA = qw(Exporter DynaLoader);
+$VERSION = "1.00";
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@EXPORT =
);
sub AUTOLOAD {
- if (@_ > 1) {
- $AutoLoader::AUTOLOAD = $AUTOLOAD;
- goto &AutoLoader::AUTOLOAD;
- }
- local($constname);
+ my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
- $val = constant($constname, @_ ? $_[0] : 0);
+ my $val = constant($constname, @_ ? $_[0] : 0);
if ($! != 0) {
if ($! =~ /Invalid/) {
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD;
}
else {
- ($pack,$file,$line) = caller;
+ my ($pack,$file,$line) = caller;
die "Your vendor has not defined Fcntl macro $constname, used at $file line $line.
";
}
goto &$AUTOLOAD;
}
-bootstrap Fcntl;
+bootstrap Fcntl $VERSION;
# Preloaded methods go here. Autoload methods go after __END__, and are
# processed by the autosplit program.