1package CUPS; 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 CUPS ':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 CUPS_DATE_ANY 23 CUPS_VERSION 24 HTTP_MAX_BUFFER 25 HTTP_MAX_HOST 26 HTTP_MAX_URI 27 HTTP_MAX_VALUE 28 IPP_MAX_NAME 29 IPP_MAX_VALUES 30 IPP_PORT 31 PPD_MAX_LINE 32 PPD_MAX_NAME 33 PPD_MAX_TEXT 34 PPD_VERSION 35) ] ); 36 37our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); 38 39our @EXPORT = qw( 40 CUPS_DATE_ANY 41 CUPS_VERSION 42 HTTP_MAX_BUFFER 43 HTTP_MAX_HOST 44 HTTP_MAX_URI 45 HTTP_MAX_VALUE 46 IPP_MAX_NAME 47 IPP_MAX_VALUES 48 IPP_PORT 49 PPD_MAX_LINE 50 PPD_MAX_NAME 51 PPD_MAX_TEXT 52 PPD_VERSION 53); 54our $VERSION = '1.2'; 55 56sub AUTOLOAD { 57 # This AUTOLOAD is used to 'autoload' constants from the constant() 58 # XS function. If a constant is not found then control is passed 59 # to the AUTOLOAD in AutoLoader. 60 61 my $constname; 62 our $AUTOLOAD; 63 ($constname = $AUTOLOAD) =~ s/.*:://; 64 croak "& not defined" if $constname eq 'constant'; 65 my $val = constant($constname, @_ ? $_[0] : 0); 66 if ($! != 0) { 67 if ($! =~ /Invalid/ || $!{EINVAL}) { 68 $AutoLoader::AUTOLOAD = $AUTOLOAD; 69 goto &AutoLoader::AUTOLOAD; 70 } 71 else { 72 croak "Your vendor has not defined CUPS macro $constname"; 73 } 74 } 75 { 76 no strict 'refs'; 77 # Fixed between 5.005_53 and 5.005_61 78 if ($] >= 5.00561) { 79 *$AUTOLOAD = sub () { $val }; 80 } 81 else { 82 *$AUTOLOAD = sub { $val }; 83 } 84 } 85 goto &$AUTOLOAD; 86} 87 88bootstrap CUPS $VERSION; 89 90# Preloaded methods go here. 91 92# Autoload methods go after =cut, and are processed by the autosplit program. 93 941; 95__END__ 96# Below is stub documentation for your module. You better edit it! 97 98=head1 NAME 99 100CUPS - Perl extension for blah blah blah 101 102=head1 SYNOPSIS 103 104 use CUPS; 105 blah blah blah 106 107=head1 DESCRIPTION 108 109Stub documentation for CUPS, created by h2xs. It looks like the 110author of the extension was negligent enough to leave the stub 111unedited. 112 113Blah blah blah. 114 115=head2 EXPORT 116 117None by default. 118 119=head2 Exportable constants 120 121 CUPS_DATE_ANY 122 CUPS_VERSION 123 HTTP_MAX_BUFFER 124 HTTP_MAX_HOST 125 HTTP_MAX_URI 126 HTTP_MAX_VALUE 127 IPP_MAX_NAME 128 IPP_MAX_VALUES 129 IPP_PORT 130 PPD_MAX_LINE 131 PPD_MAX_NAME 132 PPD_MAX_TEXT 133 PPD_VERSION 134 135 136=head1 AUTHOR 137 138A. U. Thor, E<lt>a.u.thor@a.galaxy.far.far.awayE<gt> 139 140=head1 SEE ALSO 141 142L<perl>. 143 144=cut 145