source: MondoRescue/trunk/mindi/Mindi/DiskSize/DiskSize.pm@ 1

Last change on this file since 1 was 1, checked in by bcornec, 19 years ago

Initial import from latest mondo-2.04_cvs_20050503/mindi-1.04_cvs_20050503 on http://www.mondorescue.org

File size: 1.6 KB
Line 
1package Mindi::DiskSize;
2
3use 5.006;
4use strict;
5use warnings;
6use Carp;
7
8require Exporter;
9require DynaLoader;
10use AutoLoader;
11
12our @ISA = qw(Exporter DynaLoader);
13
14# Items to export into callers namespace by default. Note: do not export
15# names by default without a very good reason. Use EXPORT_OK instead.
16# Do not simply export all your public functions/methods/constants.
17
18# This allows declaration use Mindi::DiskSize ':all';
19# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
20# will save memory.
21our %EXPORT_TAGS = ( 'all' => [ qw(
22 get_size_of_disk
23) ] );
24
25our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
26
27our @EXPORT = qw(
28
29);
30our $VERSION = '1.00';
31
32sub AUTOLOAD {
33 # This AUTOLOAD is used to 'autoload' constants from the constant()
34 # XS function. If a constant is not found then control is passed
35 # to the AUTOLOAD in AutoLoader.
36
37 my $constname;
38 our $AUTOLOAD;
39 ($constname = $AUTOLOAD) =~ s/.*:://;
40 croak "& not defined" if $constname eq 'constant';
41 my $val = constant($constname, @_ ? $_[0] : 0);
42 if ($! != 0) {
43 if ($! =~ /Invalid/ || $!{EINVAL}) {
44 $AutoLoader::AUTOLOAD = $AUTOLOAD;
45 goto &AutoLoader::AUTOLOAD;
46 }
47 else {
48 croak "Your vendor has not defined Mindi::DiskSize macro $constname";
49 }
50 }
51 {
52 no strict 'refs';
53 # Fixed between 5.005_53 and 5.005_61
54 if ($] >= 5.00561) {
55 *$AUTOLOAD = sub () { $val };
56 }
57 else {
58 *$AUTOLOAD = sub { $val };
59 }
60 }
61 goto &$AUTOLOAD;
62}
63
64bootstrap Mindi::DiskSize $VERSION;
65
66# Preloaded methods go here.
67
68# Autoload methods go after =cut, and are processed by the autosplit program.
69
701;
71__END__
72
Note: See TracBrowser for help on using the repository browser.