Barcode-DataMatrix-0.10/000755 000767 000024 00000000000 13202654204 016176 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/.travis.yml000644 000767 000024 00000000377 12641076772 020334 0ustar00mstratmanstaff000000 000000 sudo: false language: perl perl: - "5.22" - "5.20" - "5.18" - "5.16" - "5.14" - "5.12" - "5.10" install: - cpanm Module::Install::Repository Module::Install::AuthorTests - PERL_MM_USE_DEFAULT=1 cpanm --installdeps . Barcode-DataMatrix-0.10/Changes000644 000767 000024 00000003123 13202654122 017467 0ustar00mstratmanstaff000000 000000 Revision history for Barcode-DataMatrix 0.10 Tue Nov 14 14:55:30 CST 2017 - Fixed POD problems. Thanks Xavier Guimard via https://github.com/mstratman/Barcode-DataMatrix/pull/30 0.09 Wed May 18 09:35:43 CDT 2016 - Added `size` attribute. Thanks Stuart Henderson via https://github.com/mstratman/Barcode-DataMatrix/pull/29 0.08 Thu Mar 24 15:23:34 CDT 2016 - Removed type dependencies 0.07 Fri Jan 1 13:20:21 CST 2016 - Added missing 'use warnings' pragmas - Removed commented-out code - Removed now unnecessary "no critic" statement - Removed unused constants and duplication - Ignore Devel::Cover's cover_db dir - Update outdated URLs to new locations 0.06 Wed Dec 30 19:00:10 CST 2015 - Switched from Any::Moose to Moo - Documentation added to the engine - Many things cleaned up (see git history) 0.05 Thu Apr 16 09:56:07 CDT 2015 - Updated the various enums to use an array reference rather than an array to avoid deprecation warnings when using Moose 2.1200 or newer 0.04 Thu Jun 21 09:01:05 CDT 2012 - Use Module::Install::Repository because metacpan doesn't display the repository correctly as set by GithubMeta. - Do not auto_include(), and do not include Test::More. 0.03 Mon Jul 4 01:41:08 CDT 2011 - Move author tests to xt to avoid failed tests. 0.02 Sun Jul 3 02:28:24 CDT 2011 - Fixed SEE ALSO link 0.01 Sun Jul 3 - First version, released on an unsuspecting world. Barcode-DataMatrix-0.10/inc/000755 000767 000024 00000000000 13202654204 016747 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/lib/000755 000767 000024 00000000000 13202654204 016744 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/LICENSE000644 000767 000024 00000014001 12641070511 017176 0ustar00mstratmanstaff000000 000000 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. Barcode-DataMatrix-0.10/Makefile.PL000644 000767 000024 00000000513 12675047477 020174 0ustar00mstratmanstaff000000 000000 use inc::Module::Install; name 'Barcode-DataMatrix'; all_from 'lib/Barcode/DataMatrix.pm'; author q{Mark A. Stratman }; license 'perl'; perl_version '5.006'; requires 'Moo' => '0'; tests 't/*.t'; author_tests 'xt'; test_requires 'Test::More'; auto_set_repository; auto_install; WriteAll; Barcode-DataMatrix-0.10/MANIFEST000644 000767 000024 00000001334 13202654202 017326 0ustar00mstratmanstaff000000 000000 .travis.yml Changes inc/Module/AutoInstall.pm inc/Module/Install.pm inc/Module/Install/AuthorTests.pm inc/Module/Install/AutoInstall.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Include.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Repository.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/Barcode/DataMatrix.pm lib/Barcode/DataMatrix/CharDataFiller.pm lib/Barcode/DataMatrix/Constants.pm lib/Barcode/DataMatrix/Engine.pm lib/Barcode/DataMatrix/Reed.pm LICENSE Makefile.PL MANIFEST This list of files META.json META.yml README.md t/00-load.t t/01-encoding.t t/boilerplate.t xt/manifest.t xt/pod-coverage.t xt/pod.t Barcode-DataMatrix-0.10/META.json000644 000767 000024 00000002361 12675044256 017636 0ustar00mstratmanstaff000000 000000 { "abstract" : "Generate data for Data Matrix barcodes", "author" : [ "Mons Anderson C<< >> (GD::Barcode::DataMatrix at L, from which this distribution originates), Mark A. Stratman " ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 7.06, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Barcode-DataMatrix", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "6.59", "Test::More" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Moo" : "0", "Type::Tiny" : "0", "Type::Utils" : "0", "Types::Standard" : "0", "perl" : "5.006" } } }, "release_status" : "stable", "version" : "0.06", "x_serialization_backend" : "JSON::PP version 2.27203" } Barcode-DataMatrix-0.10/META.yml000644 000767 000024 00000001436 13202654175 017462 0ustar00mstratmanstaff000000 000000 --- abstract: 'Generate data for Data Matrix barcodes' author: - 'Mons Anderson C<< >> (GD::Barcode::DataMatrix at L, from which this distribution originates)' - 'Mark A. Stratman ' build_requires: ExtUtils::MakeMaker: 6.59 Test::More: 0 configure_requires: ExtUtils::MakeMaker: 6.59 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.06' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Barcode-DataMatrix no_index: directory: - inc - t - xt requires: Moo: 0 perl: 5.6.0 resources: license: http://dev.perl.org/licenses/ repository: git://github.com/mstratman/Barcode-DataMatrix.git version: 0.10 Barcode-DataMatrix-0.10/README.md000644 000767 000024 00000003375 12641551177 017500 0ustar00mstratmanstaff000000 000000 # Barcode::DataMatrix - Generate data for Data Matrix barcodes This class is used to generate data for Data Matrix barcodes. It is primarily useful as a data source for barcode modules that do rendering, such as `HTML::Barcode::DataMatrix`. You can easily make a version that renders an image, PDF, or anything else. use Barcode::DataMatrix; my $data = Barcode::DataMatrix->new->barcode('MONKEY'); for my $row (@$data) { print for map { $_ ? "#" : ' ' } @$row; print "\n"; } ## Installation The simplest way to install `Barcode::DataMatrix` is via `cpanm`: $ cpanm Barcode::DataMatrix One can also install from source by first cloning the repository: $ git clone git@github.com:mstratman/Barcode-DataMatrix.git then installing the build dependencies: $ cpanm Module::Install::Repository Module::Install::AuthorTests followed by the usual build and test steps: $ perl Makefile.PL $ make $ make test If all went well, you can now install the distribution by running: $ make install ## Documentation Detailed documentation about this distribution can be found in `lib/Barcode/DataMatrix.pm` or be shown by simply running $ perldoc lib/Barcode/DataMatrix.pm ## Authors - Mons Anderson, (author of `GD::Barcode::DataMatrix`, from which this distribution originates) - Mark A. Stratman, - Paul Cochrane, https://github.com/paultcochrane ## License and Copyright Copyright 2015 the Authors listed above. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. Barcode-DataMatrix-0.10/t/000755 000767 000024 00000000000 13202654204 016441 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/xt/000755 000767 000024 00000000000 13202654204 016631 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/xt/manifest.t000644 000767 000024 00000000420 12513766744 020641 0ustar00mstratmanstaff000000 000000 #!perl -T use strict; use warnings; use Test::More; unless ( $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } eval "use Test::CheckManifest 0.9"; plan skip_all => "Test::CheckManifest 0.9 required" if $@; ok_manifest(); Barcode-DataMatrix-0.10/xt/pod-coverage.t000644 000767 000024 00000001267 12641076517 021412 0ustar00mstratmanstaff000000 000000 use strict; use warnings; use Test::More; unless ( $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; plan tests => 1; pod_coverage_ok( "Barcode::DataMatrix" ); Barcode-DataMatrix-0.10/xt/pod.t000644 000767 000024 00000000524 12641076517 017614 0ustar00mstratmanstaff000000 000000 #!perl -T use strict; use warnings; use Test::More; unless ( $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Ensure a recent version of Test::Pod my $min_tp = 1.22; eval "use Test::Pod $min_tp"; plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; all_pod_files_ok(); Barcode-DataMatrix-0.10/t/00-load.t000644 000767 000024 00000000333 12641076517 017774 0ustar00mstratmanstaff000000 000000 #!perl -T use strict; use warnings; use Test::More tests => 1; BEGIN { use_ok( 'Barcode::DataMatrix' ) || print "Bail out!\n"; } diag( "Testing Barcode::DataMatrix $Barcode::DataMatrix::VERSION, Perl $], $^X" ); Barcode-DataMatrix-0.10/t/01-encoding.t000644 000767 000024 00000106345 12641076517 020656 0ustar00mstratmanstaff000000 000000 use strict; use warnings; use Test::More; BEGIN { use_ok( 'Barcode::DataMatrix' ) } my $expected = render_expected(); for my $encoding (qw(ASCII C40 TEXT BASE256 NONE AUTO)) { my $code = new_ok('Barcode::DataMatrix' => [encoding_mode => $encoding]); my $output = $code->barcode('MONKEY'); is_deeply($output, $expected->{$encoding}->{short}, 'barcode() ' . $encoding . ' output matches for short example'); $output = $code->barcode('MONKEY'x30); is_deeply($output, $expected->{$encoding}->{long}, 'barcode() ' . $encoding . ' output matches for long example'); } done_testing; sub render_expected { return {"TEXT" => {"short" => [[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0],[1,0,0,0,1,1,0,1,1,0,0,1,1,1,1,1],[1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,0],[1,1,1,0,0,1,1,1,0,1,1,0,0,0,1,1],[1,1,0,0,1,1,1,0,1,0,0,0,1,0,0,0],[1,1,0,0,1,1,0,0,1,1,1,0,0,1,1,1],[1,0,1,1,0,0,0,0,0,0,1,0,1,1,0,0],[1,1,1,1,1,0,0,1,0,0,1,1,0,1,1,1],[1,1,1,1,1,1,0,0,1,0,1,1,0,0,0,0],[1,1,0,1,1,0,0,1,1,0,0,0,1,1,1,1],[1,1,0,1,0,1,0,1,1,1,0,1,1,0,0,0],[1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1],[1,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0],[1,0,0,0,0,1,0,1,0,1,0,1,1,1,0,1],[1,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]],"long" => [[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1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1,0,1,0,1,1,1,1,1,0,0,1,1,0,0,1,0,0,1,1,1,1,0,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,0,1,0,1,1,0,0,0,1],[1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,0,1,1,0,0,1,0,0,0,1,0,0,1,0],[1,1,0,0,0,1,0,0,0,1,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,0,1,0,1,1],[1,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,1,0],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]}}; } Barcode-DataMatrix-0.10/t/boilerplate.t000644 000767 000024 00000002474 12641070511 021136 0ustar00mstratmanstaff000000 000000 #!perl -T use 5.006; use strict; use warnings; use Test::More tests => 3; sub not_in_file_ok { my ($filename, %regex) = @_; open( my $fh, '<', $filename ) or die "couldn't open $filename for reading: $!"; my %violated; while (my $line = <$fh>) { while (my ($desc, $regex) = each %regex) { if ($line =~ $regex) { push @{$violated{$desc}||=[]}, $.; } } } if (%violated) { fail("$filename contains boilerplate text"); diag "$_ appears on lines @{$violated{$_}}" for keys %violated; } else { pass("$filename contains no boilerplate text"); } } sub module_boilerplate_ok { my ($module) = @_; not_in_file_ok($module => 'the great new $MODULENAME' => qr/ - The great new /, 'boilerplate description' => qr/Quick summary of what the module/, 'stub function definition' => qr/function[12]/, ); } TODO: { local $TODO = "Need to replace the boilerplate text"; not_in_file_ok("README.md" => "The README is used..." => qr/The README is used/, "'version information here'" => qr/to provide version information/, ); not_in_file_ok(Changes => "placeholder date/time" => qr(Date/time) ); module_boilerplate_ok('lib/Barcode/DataMatrix.pm'); } Barcode-DataMatrix-0.10/lib/Barcode/000755 000767 000024 00000000000 13202654204 020303 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix/000755 000767 000024 00000000000 13202654204 022341 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix.pm000644 000767 000024 00000010412 13202654130 022673 0ustar00mstratmanstaff000000 000000 package Barcode::DataMatrix; use Moo; use Barcode::DataMatrix::Engine (); our $VERSION = '0.10'; has 'encoding_mode' => ( is => 'ro', isa => sub { my $type = shift; for (qw(ASCII C40 TEXT BASE256 NONE AUTO)) { return 1 if $type eq $_ } return 0; }, default => 'AUTO', documentation => 'The encoding mode for the data matrix. Can be one of: ASCII C40 TEXT BASE256 NONE AUTO', ); has 'size' => ( is => 'ro', isa => sub { my $type = shift; return 1 if defined Barcode::DataMatrix::Engine::stringToFormat $type; return 0; }, default => 'AUTO', documentation => 'The module size for the data matrix. Can be one of: 10x10 12x12 14x14 16x16 18x18 20x20 22x22 24x24 26x26 32x32 36x36 40x40 44x44 48x48 52x52 64x64 72x72 80x80 88x88 96x96 104x104 120x120 132x132 144x144 8x18 8x32 12x26 12x36 16x36 16x48 AUTO', ); has 'process_tilde' => ( is => 'ro', default => 0, documentation => 'Boolean. Set to true to indicate the tilde character "~" is being used to recognize special characters.', ); =head1 NAME Barcode::DataMatrix - Generate data for Data Matrix barcodes =head1 SYNOPSIS use Barcode::DataMatrix; my $data = Barcode::DataMatrix->new->barcode('MONKEY'); for my $row (@$data) { print for map { $_ ? "#" : ' ' } @$row; print "\n"; } =cut =head1 DESCRIPTION This class is used to generate data for Data Matrix barcodes. It is primarily useful as a data source for barcode modules that do rendering, such as L. You can easily make a version that renders an image, PDF, or anything else. =head1 METHODS =head2 new (%attributes) Instantiate a new Barcode::DataMatrix object. The C<%attributes> hash can take any of the other L listed below. =cut =head2 barcode ($text) Generate barcode data representing the C<$text> string. This returns an array ref of rows in the data matrix, each containing array refs of cells within that row. The cells are true and false values that represent filled or empty squares. This can throw an exception if it's unable to generate the barcode data. =cut sub barcode { my ($self, $text) = @_; my $engine = Barcode::DataMatrix::Engine->new( $text, $self->encoding_mode, $self->size, $self->process_tilde, ); my $rows = $engine->{rows}; my $cols = $engine->{cols}; my $bitmap = $engine->{bitmap}; my $rv = []; for my $r (0 .. $rows - 1) { my $row = []; for my $c (0 .. $cols - 1) { push @$row, ($bitmap->[$c]->[$r] ? 1 : 0); } push @$rv, $row; } return $rv; } =head1 ATTRIBUTES =head2 encoding_mode The encoding mode for the data matrix. Can be one of: C (default), C, C, C, C, or C. =head2 size The module size for the data matrix. Can be one of: C (default), C<10x10>, C<12x12>, C<14x14>, C<16x16>, C<18x18>, C<20x20>, C<22x22>, C<24x24>, C<26x26>, C<32x32>, C<36x36>, C<40x40>, C<44x44>, C<48x48>, C<52x52>, C<64x64>, C<72x72>, C<80x80>, C<88x88>, C<96x96>, C<104x104>, C<120x120>, C<132x132>, C<144x144>, C<8x18>, C<8x32>, C<12x26>, C<12x36>, C<16x36>, C<16x48>. =head2 process_tilde Boolean. Set to true to indicate the tilde character "~" is being used to recognize special characters. See this page for more information: L =cut =head1 AUTHORS Mons Anderson C<< >> (GD::Barcode::DataMatrix at L, from which this distribution originates) Mark A. Stratman, C<< >> Paul Cochrane, L =head1 SOURCE REPOSITORY L =head1 SEE ALSO =over 4 =item L =item L =item L =back =head1 LICENSE AND COPYRIGHT Copyright 2015 the AUTHORs listed above. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. =cut 1; # End of Barcode::DataMatrix Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix/CharDataFiller.pm000644 000767 000024 00000011316 13202654036 025511 0ustar00mstratmanstaff000000 000000 package Barcode::DataMatrix::CharDataFiller; use strict; use warnings; =head1 NAME Barcode::DataMatrix::CharDataFiller - Handle filling character data within the data matrix array. =head1 DESCRIPTION The documentation for the methods in this class has been adapted from the comments in L. =head2 new Construct a C object. =cut sub new { my $self = bless {}, shift; @$self{qw( ncol nrow array )} = @_; $self->fill(); return $self; } =head2 module (i, j, k, l) Places "chr+bit" with the appropriate wrapping within the array. =cut sub module { my ($self,$i,$j,$k,$l) = @_; if($i < 0) { $i += $self->{nrow}; $j += 4 - ($self->{nrow} + 4) % 8; } if($j < 0) { $j += $self->{ncol}; $i += 4 - ($self->{ncol} + 4) % 8; } $self->{array}->[$i * $self->{ncol} + $j] = 10 * $k + $l; return; } =head2 utah (i, j, k) Places the 8 bits of a utah-shaped symbol character. =cut sub utah { my ($self,$i,$j,$k) = @_; $self->module($i - 2, $j - 2, $k, 1); $self->module($i - 2, $j - 1, $k, 2); $self->module($i - 1, $j - 2, $k, 3); $self->module($i - 1, $j - 1, $k, 4); $self->module($i - 1, $j, $k, 5); $self->module($i, $j - 2, $k, 6); $self->module($i, $j - 1, $k, 7); $self->module($i, $j, $k, 8); return; } =head2 corner1 (i) Places 8 bits of the first of the four special corner cases. =cut sub corner1 { my ($self,$i) = @_; my ($ncol,$nrow) = @$self{qw( ncol nrow )}; $self->module($nrow - 1, 0, $i, 1); $self->module($nrow - 1, 1, $i, 2); $self->module($nrow - 1, 2, $i, 3); $self->module(0, $ncol - 2, $i, 4); $self->module(0, $ncol - 1, $i, 5); $self->module(1, $ncol - 1, $i, 6); $self->module(2, $ncol - 1, $i, 7); $self->module(3, $ncol - 1, $i, 8); return; } =head2 corner2 (i) Places 8 bits of the second of the four special corner cases. =cut sub corner2 { #(int i) my ($self,$i) = @_; my ($ncol,$nrow) = @$self{qw( ncol nrow )}; $self->module($nrow - 3, 0, $i, 1); $self->module($nrow - 2, 0, $i, 2); $self->module($nrow - 1, 0, $i, 3); $self->module(0, $ncol - 4, $i, 4); $self->module(0, $ncol - 3, $i, 5); $self->module(0, $ncol - 2, $i, 6); $self->module(0, $ncol - 1, $i, 7); $self->module(1, $ncol - 1, $i, 8); return; } =head2 corner3 (i) Places 8 bits of the third of the four special corner cases. =cut sub corner3 { #(int i) my ($self,$i) = @_; my ($ncol,$nrow) = @$self{qw( ncol nrow )}; $self->module($nrow - 3, 0, $i, 1); $self->module($nrow - 2, 0, $i, 2); $self->module($nrow - 1, 0, $i, 3); $self->module(0, $ncol - 2, $i, 4); $self->module(0, $ncol - 1, $i, 5); $self->module(1, $ncol - 1, $i, 6); $self->module(2, $ncol - 1, $i, 7); $self->module(3, $ncol - 1, $i, 8); return; } =head2 corner4 (i) Places 8 bits of the fourth of the four special corner cases. =cut sub corner4 { #(int i) my ($self,$i) = @_; my ($ncol,$nrow) = @$self{qw( ncol nrow )}; $self->module($nrow - 1, 0, $i, 1); $self->module($nrow - 1, $ncol - 1, $i, 2); $self->module(0, $ncol - 3, $i, 3); $self->module(0, $ncol - 2, $i, 4); $self->module(0, $ncol - 1, $i, 5); $self->module(1, $ncol - 3, $i, 6); $self->module(1, $ncol - 2, $i, 7); $self->module(1, $ncol - 1, $i, 8); return; } =head2 fill Fills an nrow x ncol array with appropriate values. =cut sub fill { # (int ncol; int nrow; int array;) : void my $self = shift; my ($ncol,$nrow,$array) = @$self{qw( ncol nrow array )}; my $i = 1; my $j = 4; my $k = 0; for(my $l = 0; $l < $nrow; $l++) { for(my $i1 = 0; $i1 < $ncol; $i1++) { $array->[$l * $ncol + $i1] = 0; } } do { $self->corner1($i++) if $j == $nrow && $k == 0; $self->corner2($i++) if $j == $nrow - 2 && $k == 0 && $ncol % 4 != 0; $self->corner3($i++) if $j == $nrow - 2 && $k == 0 && $ncol % 8 == 4; $self->corner4($i++) if $j == $nrow + 4 && $k == 2 && $ncol % 8 == 0; do { $self->utah($j, $k, $i++) if $j < $nrow && $k >= 0 && $array->[$j * $ncol + $k] == 0; $j -= 2; $k += 2; } while($j >= 0 && $k < $ncol); $j++; $k += 3; do { $self->utah($j, $k, $i++) if $j >= 0 && $k < $ncol && $array->[$j * $ncol + $k] == 0; $j += 2; $k -= 2; } while($j < $nrow && $k >= 0); $j += 3; $k++; } while($j < $nrow || $k < $ncol); $array->[$nrow * $ncol - 1] = $array->[($nrow - 1) * $ncol - 2] = 1 if($array->[$nrow * $ncol - 1] == 0); return; } 1; Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix/Constants.pm000644 000767 000024 00000023522 13202654036 024662 0ustar00mstratmanstaff000000 000000 package Barcode::DataMatrix::Constants; =head1 NAME Barcode::DataMatrix::Constants - Constants associated with the Reed-Solomon error correction encoding used for data matrices. =head1 DESCRIPTION See L for more information. =cut use strict; use warnings; =head2 GFI Exponent values used in the multiplication step of the Reed-Solomon encoding algorithm. =cut our @GFI = ( 1, 2, 4, 8, 16, 32, 64, 128, 45, 90, 180, 69, 138, 57, 114, 228, 229, 231, 227, 235, 251, 219, 155, 27, 54, 108, 216, 157, 23, 46, 92, 184, 93, 186, 89, 178, 73, 146, 9, 18, 36, 72, 144, 13, 26, 52, 104, 208, 141, 55, 110, 220, 149, 7, 14, 28, 56, 112, 224, 237, 247, 195, 171, 123, 246, 193, 175, 115, 230, 225, 239, 243, 203, 187, 91, 182, 65, 130, 41, 82, 164, 101, 202, 185, 95, 190, 81, 162, 105, 210, 137, 63, 126, 252, 213, 135, 35, 70, 140, 53, 106, 212, 133, 39, 78, 156, 21, 42, 84, 168, 125, 250, 217, 159, 19, 38, 76, 152, 29, 58, 116, 232, 253, 215, 131, 43, 86, 172, 117, 234, 249, 223, 147, 11, 22, 44, 88, 176, 77, 154, 25, 50, 100, 200, 189, 87, 174, 113, 226, 233, 255, 211, 139, 59, 118, 236, 245, 199, 163, 107, 214, 129, 47, 94, 188, 85, 170, 121, 242, 201, 191, 83, 166, 97, 194, 169, 127, 254, 209, 143, 51, 102, 204, 181, 71, 142, 49, 98, 196, 165, 103, 206, 177, 79, 158, 17, 34, 68, 136, 61, 122, 244, 197, 167, 99, 198, 161, 111, 222, 145, 15, 30, 60, 120, 240, 205, 183, 67, 134, 33, 66, 132, 37, 74, 148, 5, 10, 20, 40, 80, 160, 109, 218, 153, 31, 62, 124, 248, 221, 151, 3, 6, 12, 24, 48, 96, 192, 173, 119, 238, 241, 207, 179, 75, 150 ); =head2 GFL Log values used in the multiplication step of the Reed-Solomon encoding algorithm. =cut our @GFL = ( 0, 0, 1, 240, 2, 225, 241, 53, 3, 38, 226, 133, 242, 43, 54, 210, 4, 195, 39, 114, 227, 106, 134, 28, 243, 140, 44, 23, 55, 118, 211, 234, 5, 219, 196, 96, 40, 222, 115, 103, 228, 78, 107, 125, 135, 8, 29, 162, 244, 186, 141, 180, 45, 99, 24, 49, 56, 13, 119, 153, 212, 199, 235, 91, 6, 76, 220, 217, 197, 11, 97, 184, 41, 36, 223, 253, 116, 138, 104, 193, 229, 86, 79, 171, 108, 165, 126, 145, 136, 34, 9, 74, 30, 32, 163, 84, 245, 173, 187, 204, 142, 81, 181, 190, 46, 88, 100, 159, 25, 231, 50, 207, 57, 147, 14, 67, 120, 128, 154, 248, 213, 167, 200, 63, 236, 110, 92, 176, 7, 161, 77, 124, 221, 102, 218, 95, 198, 90, 12, 152, 98, 48, 185, 179, 42, 209, 37, 132, 224, 52, 254, 239, 117, 233, 139, 22, 105, 27, 194, 113, 230, 206, 87, 158, 80, 189, 172, 203, 109, 175, 166, 62, 127, 247, 146, 66, 137, 192, 35, 252, 10, 183, 75, 216, 31, 83, 33, 73, 164, 144, 85, 170, 246, 65, 174, 61, 188, 202, 205, 157, 143, 169, 82, 72, 182, 215, 191, 251, 47, 178, 89, 151, 101, 94, 160, 123, 26, 112, 232, 21, 51, 238, 208, 131, 58, 69, 148, 18, 15, 16, 68, 17, 121, 149, 129, 19, 155, 59, 249, 70, 214, 250, 168, 71, 201, 156, 64, 60, 237, 130, 111, 20, 93, 122, 177, 150 ); =head2 POLY Coefficients of the Reed-Solomon coeeficients. The keys of the C hash correspond to the order of the respective polynomial. =cut our %POLY = ( 5 => [62, 111, 15, 48, 228], 7 => [254, 92, 240, 134, 144, 68, 23], 10 => [61, 110, 255, 116, 248, 223, 166, 185, 24, 28], 11 => [120, 97, 60, 245, 39, 168, 194, 12, 205, 138, 175], 12 => [242, 100, 178, 97, 213, 142, 42, 61, 91, 158, 153, 41], 14 => [185, 83, 186, 18, 45, 138, 119, 157, 9, 95, 252, 192, 97, 156], 18 => [188, 90, 48, 225, 254, 94, 129, 109, 213, 241, 61, 66, 75, 188, 39, 100, 195, 83], 20 => [172, 186, 174, 27, 82, 108, 79, 253, 145, 153, 160, 188, 2, 168, 71, 233, 9, 244, 195, 15], 24 => [193, 50, 96, 184, 181, 12, 124, 254, 172, 5, 21, 155, 223, 251, 197, 155, 21, 176, 39, 109, 205, 88, 190, 52], 28 => [255, 93, 168, 233, 151, 120, 136, 141, 213, 110, 138, 17, 121, 249, 34, 75, 53, 170, 151, 37, 174, 103, 96, 71, 97, 43, 231, 211], 36 => [112, 81, 98, 225, 25, 59, 184, 175, 44, 115, 119, 95, 137, 101, 33, 68, 4, 2, 18, 229, 182, 80, 251, 220, 179, 84, 120, 102, 181, 162, 250, 130, 218, 242, 127, 245], 42 => [5, 9, 5, 226, 177, 150, 50, 69, 202, 248, 101, 54, 57, 253, 1, 21, 121, 57, 111, 214, 105, 167, 9, 100, 95, 175, 8, 242, 133, 245, 2, 122, 105, 247, 153, 22, 38, 19, 31, 137, 193, 77], 48 => [19, 225, 253, 92, 213, 69, 175, 160, 147, 187, 87, 176, 44, 82, 240, 186, 138, 66, 100, 120, 88, 131, 205, 170, 90, 37, 23, 118, 147, 16, 106, 191, 87, 237, 188, 205, 231, 238, 133, 238, 22, 117, 32, 96, 223, 172, 132, 245], 56 => [46, 143, 53, 233, 107, 203, 43, 155, 28, 247, 67, 127, 245, 137, 13, 164, 207, 62, 117, 201, 150, 22, 238, 144, 232, 29, 203, 117, 234, 218, 146, 228, 54, 132, 200, 38, 223, 36, 159, 150, 235, 215, 192, 230, 170, 175, 29, 100, 208, 220, 17, 12, 238, 223, 9, 175], 62 => [204, 11, 47, 86, 124, 224, 166, 94, 7, 232, 107, 4, 170, 176, 31, 163, 17, 188, 130, 40, 10, 87, 63, 51, 218, 27, 6, 147, 44, 161, 71, 114, 64, 175, 221, 185, 106, 250, 190, 197, 63, 245, 230, 134, 112, 185, 37, 196, 108, 143, 189, 201, 188, 202, 118, 39, 210, 144, 50, 169, 93, 242], 68 => [186, 82, 103, 96, 63, 132, 153, 108, 54, 64, 189, 211, 232, 49, 25, 172, 52, 59, 241, 181, 239, 223, 136, 231, 210, 96, 232, 220, 25, 179, 167, 202, 185, 153, 139, 66, 236, 227, 160, 15, 213, 93, 122, 68, 177, 158, 197, 234, 180, 248, 136, 213, 127, 73, 36, 154, 244, 147, 33, 89, 56, 159, 149, 251, 89, 173, 228, 220], ); our @FORMATS = ( [10, 10, 8, 8, 1, 8, 8, 3, 5, 3, 5, 1], [12, 12, 10, 10, 1, 10, 10, 5, 7, 5, 7, 1], [14, 14, 12, 12, 1, 12, 12, 8, 10, 8, 10, 1], [16, 16, 14, 14, 1, 14, 14, 12, 12, 12, 12, 1], [18, 18, 16, 16, 1, 16, 16, 18, 14, 18, 14, 1], [20, 20, 18, 18, 1, 18, 18, 22, 18, 22, 18, 1], [22, 22, 20, 20, 1, 20, 20, 30, 20, 30, 20, 1], [24, 24, 22, 22, 1, 22, 22, 36, 24, 36, 24, 1], [26, 26, 24, 24, 1, 24, 24, 44, 28, 44, 28, 1], [32, 32, 14, 14, 4, 28, 28, 62, 36, 62, 36, 1], [36, 36, 16, 16, 4, 32, 32, 86, 42, 86, 42, 1], [40, 40, 18, 18, 4, 36, 36, 114, 48, 114, 48, 1], [44, 44, 20, 20, 4, 40, 40, 144, 56, 144, 56, 1], [48, 48, 22, 22, 4, 44, 44, 174, 68, 174, 68, 1], [52, 52, 24, 24, 4, 48, 48, 204, 84, 102, 42, 2], [64, 64, 14, 14, 16, 56, 56, 280, 112, 140, 56, 2], [72, 72, 16, 16, 16, 64, 64, 368, 144, 92, 36, 4], [80, 80, 18, 18, 16, 72, 72, 456, 192, 114, 48, 4], [88, 88, 20, 20, 16, 80, 80, 576, 224, 144, 56, 4], [96, 96, 22, 22, 16, 88, 88, 696, 272, 174, 68, 4], [104, 104, 24, 24, 16, 96, 96, 816, 336, 136, 56, 6], [120, 120, 18, 18, 36, 108, 108, 1050, 496, 175, 68, 6], [132, 132, 20, 20, 36, 120, 120, 1304, 496, 163, 62, 8], [144, 144, 22, 22, 36, 132, 132, 1558, 620, 156, 62, 10], [8, 18, 6, 16, 1, 6, 16, 5, 7, 5, 7, 1], [8, 32, 6, 14, 2, 6, 28, 10, 11, 10, 11, 1], [12, 26, 10, 24, 1, 10, 24, 16, 14, 16, 14, 1], [12, 36, 10, 16, 2, 10, 32, 22, 18, 22, 18, 1], [16, 36, 14, 16, 2, 14, 32, 32, 24, 32, 24, 1], [16, 48, 14, 22, 2, 14, 44, 49, 28, 49, 28, 1], ); our @C1 = ( [0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [0, 8], [0, 9], [0, 10], [0, 11], [0, 12], [0, 13], [0, 14], [0, 15], [0, 16], [0, 17], [0, 18], [0, 19], [0, 20], [0, 21], [0, 22], [0, 23], [0, 24], [0, 25], [0, 26], [0, 27], [0, 28], [0, 29], [0, 30], [0, 31], [3], [1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [1, 10], [1, 11], [1, 12], [1, 13], [1, 14], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [1, 15], [1, 16], [1, 17], [1, 18], [1, 19], [1, 20], [1, 21], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [31], [32], [33], [34], [35], [36], [37], [38], [39], [1, 22], [1, 23], [1, 24], [1, 25], [1, 26], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [2, 7], [2, 8], [2, 9], [2, 10], [2, 11], [2, 12], [2, 13], [2, 14], [2, 15], [2, 16], [2, 17], [2, 18], [2, 19], [2, 20], [2, 21], [2, 22], [2, 23], [2, 24], [2, 25], [2, 26], [2, 27], [2, 28], [2, 29], [2, 30], [2, 31], [1, 30, 0, 0], [1, 30, 0, 1], [1, 30, 0, 2], [1, 30, 0, 3], [1, 30, 0, 4], [1, 30, 0, 5], [1, 30, 0, 6], [1, 30, 0, 7], [1, 30, 0, 8], [1, 30, 0, 9], [1, 30, 0, 10], [1, 30, 0, 11], [1, 30, 0, 12], [1, 30, 0, 13], [1, 30, 0, 14], [1, 30, 0, 15], [1, 30, 0, 16], [1, 30, 0, 17], [1, 30, 0, 18], [1, 30, 0, 19], [1, 30, 0, 20], [1, 30, 0, 21], [1, 30, 0, 22], [1, 30, 0, 23], [1, 30, 0, 24], [1, 30, 0, 25], [1, 30, 0, 26], [1, 30, 0, 27], [1, 30, 0, 28], [1, 30, 0, 29], [1, 30, 0, 30], [1, 30, 0, 31], [1, 30, 3], [1, 30, 1, 0], [1, 30, 1, 1], [1, 30, 1, 2], [1, 30, 1, 3], [1, 30, 1, 4], [1, 30, 1, 5], [1, 30, 1, 6], [1, 30, 1, 7], [1, 30, 1, 8], [1, 30, 1, 9], [1, 30, 1, 10], [1, 30, 1, 11], [1, 30, 1, 12], [1, 30, 1, 13], [1, 30, 1, 14], [1, 30, 4], [1, 30, 5], [1, 30, 6], [1, 30, 7], [1, 30, 8], [1, 30, 9], [1, 30, 10], [1, 30, 11], [1, 30, 12], [1, 30, 13], [1, 30, 1, 15], [1, 30, 1, 16], [1, 30, 1, 17], [1, 30, 1, 18], [1, 30, 1, 19], [1, 30, 1, 20], [1, 30, 1, 21], [1, 30, 14], [1, 30, 15], [1, 30, 16], [1, 30, 17], [1, 30, 18], [1, 30, 19], [1, 30, 20], [1, 30, 21], [1, 30, 22], [1, 30, 23], [1, 30, 24], [1, 30, 25], [1, 30, 26], [1, 30, 27], [1, 30, 28], [1, 30, 29], [1, 30, 30], [1, 30, 31], [1, 30, 32], [1, 30, 33], [1, 30, 34], [1, 30, 35], [1, 30, 36], [1, 30, 37], [1, 30, 38], [1, 30, 39], [1, 30, 1, 22], [1, 30, 1, 23], [1, 30, 1, 24], [1, 30, 1, 25], [1, 30, 1, 26], [1, 30, 2, 0], [1, 30, 2, 1], [1, 30, 2, 2], [1, 30, 2, 3], [1, 30, 2, 4], [1, 30, 2, 5], [1, 30, 2, 6], [1, 30, 2, 7], [1, 30, 2, 8], [1, 30, 2, 9], [1, 30, 2, 10], [1, 30, 2, 11], [1, 30, 2, 12], [1, 30, 2, 13], [1, 30, 2, 14], [1, 30, 2, 15], [1, 30, 2, 16], [1, 30, 2, 17], [1, 30, 2, 18], [1, 30, 2, 19], [1, 30, 2, 20], [1, 30, 2, 21], [1, 30, 2, 22], [1, 30, 2, 23], [1, 30, 2, 24], [1, 30, 2, 25], [1, 30, 2, 26], [1, 30, 2, 27], [1, 30, 2, 28], [1, 30, 2, 29], [1, 30, 2, 30], [1, 30, 2, 31], ); 1; Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix/Engine.pm000644 000767 000024 00000062265 13202654036 024122 0ustar00mstratmanstaff000000 000000 package Barcode::DataMatrix::Engine; =head1 NAME Barcode::DataMatrix::Engine - The engine which generates the data matrix bitmap. =cut use strict; use warnings; no warnings qw(uninitialized); use Barcode::DataMatrix::Reed; use Barcode::DataMatrix::Constants (); use Barcode::DataMatrix::CharDataFiller (); use Data::Dumper;$Data::Dumper::Useqq = 1; =head2 DEBUG Turn on/off general debugging information. =cut use constant DEBUG => 0; our %DEBUG = ( ENC => 0, EAUTO => 0, CALC => 0, TRACE => 0, B256 => 0 ); our (@FORMATS,@C1); *FORMATS = \@Barcode::DataMatrix::Constants::FORMATS; *C1 = \@Barcode::DataMatrix::Constants::C1; =head2 E_ASCII Represent the ASCII encoding type. =cut sub E_ASCII { 0 } =head2 E_C40 Represent the C40 encoding type. (upper case alphanumeric) =cut sub E_C40 { 1 } =head2 E_TEXT Represent the TEXT encoding type. (lower case alphanumeric) =cut sub E_TEXT { 2 } =head2 E_BASE256 Represent the BASE256 encoding type. =cut sub E_BASE256 { 3 } =head2 E_NONE Represent the when there is no encoding type. =cut sub E_NONE { 4 } =head2 E_AUTO Represent the when the encoding type is automatically set. =cut sub E_AUTO { 5 } our $N = 255; =head2 Types Return a list of encoding types. =cut sub Types { return qw( ASCII C40 TEXT BASE256 NONE AUTO ); } =head2 stringToType (type_name) Return the integer representing the type from the type name. =cut sub stringToType { my $m = 'E_'.shift; return eval { __PACKAGE__->$m(); }; } =head2 typeToString (type_integer) Return the type name from the integer representing the type. =cut sub typeToString { my $i = shift; for (Types) { return $_ if stringToType($_) == $i and defined $i; } return 'UNK'; } our @encName = map { typeToString $_ } 0..5; =head2 stringToFormat (format_string) Convert a "width x height" format string into an internal format specification. =cut sub stringToFormat { my $sz = shift; return unless $sz; return if $sz eq 'AUTO'; my ($w,$h) = map { +int } split /\s*x\s*/,$sz,2; my $r; for my $i (0..$#FORMATS) { $r = $i,last if $FORMATS[$i][0] == $w and $FORMATS[$i][1] == $h; } die "Format not supported ($sz)\n" unless defined $r; return $r; } =head2 setType (type_name) Set the encoding type from the given type name. =cut sub setType { my $self = shift; my $type = shift; my $t = stringToType($type); warn "setType $type => $t\n" if $DEBUG{ENC}; $t = E_ASCII unless defined $t; $self->{encoding} = $self->{currentEncoding} = $t; warn "Have type $t (".typeToString($t).")\n" if $DEBUG{ENC}; return; } =head2 new Construct a C object. =cut sub new { my $self = bless{},shift; $self->init(); warn "[CA] new(@_)\n" if $DEBUG{TRACE}; $self->{orig} = $self->{code} = shift; # text $self->setType(shift); # type of encoding $self->{preferredFormat} = stringToFormat(shift) || -1; # type of format $self->{as} = [ ]; # additional streams $self->ProcessTilde if (shift); # process tilde return unless ( my $l = length($self->{code}) ); # no data to encode $self->{ac} = [ split //,$self->{code} ]; # create an char array $self->{ai} = [ map { +ord } @{ $self->{ac} } ]; # create an int array $self->CreateBitmap(); return $self; } =head2 init Initialize some of the basic C data. =cut sub init { my $self = shift; my %p = ( processTilde => 0,#0 encoding => E_ASCII, preferredFormat => -1, currentEncoding => E_ASCII, C49rest => 0, ); for (keys %p){ $self->{$_} = $p{$_}; } } =head2 ProcessTilde Handle special or control characters, which are prefixed by a tilde C<~> when encoding. =cut sub ProcessTilde { my $self = shift; my $s = $self->{code}; my $as = $self->{as}; for ($s) { s{~d(\d{3})}{ chr($1) }ge; s{~d.{3}}{}g; for my $i (0,1,4,5) { s{^(.{$i})~1}{ $as->[$-[0]+$i]=''; $1."\350"}ge; } s{~1}{\035}g; s{~2(.{3})}{ $as->[$-[0]] = $1; "\351".$2 }e; s{^~3}{ $as->[0] = ''; "\352" }e; s{^~5}{ $as->[0] = ''; "\354" }e; s{^~6}{ $as->[0] = ''; "\355" }e; s{~7(.{6})}{do{ my $d = int $1; #warn "There is $d got from $1\n"; if ($d < 127) { $d = chr($d+1); } elsif($d < 16383) { $d = chr( ( $d - 127 ) / 254 + 128 ). chr( ( $d - 127 ) % 254 + 1 ); } else{ $d = chr( int( ( $d - 16383 ) / 64516 + 192 ) ). chr( int( ( $d - 16383 ) / 254 ) % 254 + 1 ). chr( int( ( $d - 16383 ) % 254 + 1 ) ); } $as->[$-[0]] = $d; warn "PT affect as[$-[0]] = ".join('+', map ord, split //, $d) if $DEBUG{TRACE}; "\361" }}ge; s{~(.)}{$1 eq '~' ? '~' : $1}ge; warn "[C9] ProcessTilde($self->{code}) => ".Dumper($_) if $DEBUG{TRACE}; return $self->{code} = $_; } } =head2 CalcReed (ai, err) Return the message as a Reed-Solomon encoded array. =cut sub CalcReed { # (int ai[], int i, int j) : void my ($ai,$err) = @_; my $rv = Barcode::DataMatrix::Reed::encode($ai,$err); @$ai = @$rv; return $ai; } =head2 A253 (i, j) Return padding codewords via the 253-state algorithm. For more information see L. The relevant text for this algorithm is reproduced here. If the symbol is not full, pad Cs are required. After the last data C, the 254 C indicates the end of the datas or the return to ASCII method. First padding C is 129 and next padding Cs are computed with the 253-state algorithm. =head3 The 253-state algorithm Let C

be the number of data Cs from the beginning of the data, C a pseudo random number and C the required pad C. R = ((149 * P) MOD 253) + 1 CW = (129 + R) MOD 254 =cut sub A253 # C8 (int i, int j) : int { my ($i,$j) = @_; my $l = $i + (149 * $j) % 253 + 1; return $l <= 254 ? $l : $l - 254; } =head2 CreateBitmap Generate and return the bitmap representing the message. =cut sub CreateBitmap #CB (int ai[], String as[]) : int[][] { my $self = shift; my ($ai,$as) = @$self{qw(ai as)}; warn "[CB] CreateBitmap(ai[" .join(',',@$ai).'], as[' . scalar(@$as) . "])\n" if $DEBUG{TRACE}; my $ai1 = []; my $i = 0; $self->{currentEncoding} = $self->{encoding} if $self->{encoding} != E_AUTO; for ($self->{encoding}){ warn "[CB] Select method for $self->{encoding}, ".typeToString($self->{encoding})."\n" if $DEBUG{ENC}; $_ == E_AUTO && do { $i = $self->DetectEncoding($ai1); last;}; $_ == E_ASCII && do { $i = $self->EncodeASCII(scalar(@$ai), $ai, $ai1, $as); last;}; $_ == E_C40 && do { $i = $self->EncodeC40TEXT(scalar(@$ai), [0], $ai, $ai1, 0, 1, 0); last;}; $_ == E_TEXT && do { $i = $self->EncodeC40TEXT(scalar(@$ai), [0], $ai, $ai1, 1, 1, 0); last;}; $_ == E_BASE256 && do { $i = $self->EncodeBASE256(scalar(@$ai), [0], $ai, [0], $ai1, 0, $as); last;}; $_ == E_NONE && do { $ai1 = [ @$ai ]; $i = @$ai; last }; } warn "[CB] selected (ai1[" .join(',',@$ai1).'], as[' . scalar(@$as) . "])\n" if $DEBUG{TRACE}; DEBUG and print "Use Encoding: " .typeToString($self->{currentEncoding}). "(".typeToString($self->{encoding}).")\n"; warn "[CB]: enc res: ".typeToString($self->{encoding}).", " .typeToString($self->{currentEncoding}). "\n" if $DEBUG{ENC}; my $k = 0; if($self->{preferredFormat} != -1) { $k = $self->{preferredFormat}; $k = 0 if $i > $FORMATS[$k][7]; } for(; $i > $FORMATS[$k][7] && $k < 30; $k++) { next if $self->{currentEncoding} != E_C40 && $self->{currentEncoding} != E_TEXT; if($self->{C49rest} == 1 && $ai1->[$i - 2] == 254 && $FORMATS[$k][7] == $i - 1) { $ai1->[$i - 2] = $ai1->[$i - 1]; $ai1->[$i - 1] = 0; $i--; last; } next if($self->{C49rest} != 0 || $ai1->[$i - 1] != 254 || $FORMATS[$k][7] != $i - 1); $ai1->[$i - 1] = 0; $i--; last; } return if $k == 30; my $l = $k; @$self{qw( rows cols datarows datacols regions maprows mapcols totaldata totalerr reeddata reederr reedblocks )} = @{$FORMATS[$l]}[0..11]; DEBUG and print "Format: $self->{rows}x$self->{cols}; Data: $self->{totaldata}; i=$i; blocks = $self->{reedblocks}\n"; $ai1->[$i - 1] = 129 if ( ($self->{currentEncoding} == E_C40 || $self->{currentEncoding} == E_TEXT ) and $self->{C49rest} == 0 && $i == $self->{totaldata} && $ai1->[$i - 1] == 254 ); my $flag = 1; warn "Calc begin from $i..$self->{totaldata} ai1=[@{$ai1}]\n" if $DEBUG{CALC}; for(my $i1 = $i; $i1 < $self->{totaldata}; $i1++) { $ai1->[$i1] = $flag ? 129 : A253(129, $i1 + 1); $flag = 0; } return $self->{bitmap} = $self->GenData($self->ecc($l,$ai1)); } =head2 ecc (format, ai) Return the ECC200 (DataMatrix) array, formatted for the appropriate matrix size. =cut sub ecc { my $self = shift; my $format = shift; my $ai = shift; my ($data,$err,$blocks) = @{$FORMATS[$format]}[9..11]; $blocks--;$data--; warn "ECC: ai=[@{$ai}], blocks=$blocks\n" if $DEBUG{CALC}; my @blocks = map {[]} 0..$blocks; my $block = 0; for (@$ai) { push @{$blocks[$block++]}, $_; $block = 0 if $block > $blocks; } warn "Calc blocks=".Dumper \@blocks if $DEBUG{CALC}; for (0..$#blocks) { $#{ $blocks[$_] } = $data; # correct padding if($self->{rows} == 144 and $_ > 7) { $#{$blocks[$_]} -= 1; } CalcReed($blocks[$_], $err); } warn "Calc reed=\n". join "\n", map { '['.join(',',@$_).']' } @blocks if $DEBUG{CALC}; my @rv; for my $n (0..$data+$err) { for my $b (0..$#blocks) { if ( $n < @{$blocks[$b]} ) { # 144 fix push @rv, $blocks[$b][$n]; } } } return \@rv; } =head2 isIDigit (character_code) Return true if the character code represents a digit. =cut sub isIDigit { # C1 my $i = shift; return ( $i >= 48 && $i <= 57 ) ? 1 : 0; } =head2 isILower (character_code) Return true if the character code represents a lower case letter. =cut sub isILower { my $i = shift; return ( $i >= ord('a') && $i <= ord('z') ) ? 1 : 0; } =head2 isIUpper (character_code) Return true if the character code represents an upper case letter. =cut sub isIUpper { my $i = shift; return ( $i >= ord('A') && $i <= ord('Z') ) ? 1 : 0; } =head2 DetectEncoding Detect the encoding type. =cut sub DetectEncoding() #C4 (int i, int ai[], int ai1[], String as[]) : int { my $self = shift; warn "[C4] DetectEncoding(@_)\n" if $DEBUG{TRACE}; my $ai = $self->{ai}; my $i = scalar (@$ai); my $as = $self->{as}; my $ai1 = shift; my $ai2 = [ ]; my $ai3 = [ ]; my $flag = 0; my $j1 = 0; my $k1 = E_ASCII; my $ai4 = [ 0 ]; my $l2 = E_ASCII; my $as1 = [ ]; my $iterator = 0; $self->{currentEncoding} = E_ASCII; warn("DetectENC: starting from ".$encName[$self->{currentEncoding}]."\n") if $DEBUG{EAUTO}; while($iterator < $i) { # while iterator less than length of data warn("DetectENC: at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; while($self->{currentEncoding} == E_ASCII and $iterator < $i) { warn("DetectENC: while at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; my $flag1 = 0; if( $iterator + 1 < $i and isIDigit($ai->[$iterator]) and isIDigit($ai->[$iterator + 1]) ){ warn("DetectENC: 2dig $ai->[$iterator]+$ai->[$iterator+1] at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; $ai1->[$j1++] = 254 if($l2 != E_ASCII); $ai2->[0] = $ai->[$iterator]; $ai2->[1] = $ai->[$iterator + 1]; my $j = $self->EncodeASCII(2, $ai2, $ai3, $as1); splice(@$ai1,$j1,$j, @$ai3[0 .. $j-1 ]); $j1 += $j; $iterator++; $iterator++; $flag1 = 1; $l2 = E_ASCII; } if(!$flag1) { warn("DetectENC: !dig !flag1 at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; my $l1 = $self->SelectEncoding( $iterator ); if( $l1 != E_ASCII) { warn("DetectENC: $encName[$self->{currentEncoding}] => $encName[$l1]\n") if $DEBUG{EAUTO}; $l2 = $self->{currentEncoding}; $self->{currentEncoding} = $l1; } } if(!$flag1 and $self->{currentEncoding} == E_ASCII){ $ai1->[$j1++] = 254 if($l2 != E_ASCII); $ai2->[0] = $ai->[$iterator]; $as1->[0] = $as->[$iterator]; my $k = $self->EncodeASCII(1, $ai2, $ai3, $as1); $as1->[0] = undef; splice(@$ai1,$j1,$k, @$ai3[0 .. $k-1 ]); $j1 += $k; $iterator++; $l2 = E_ASCII; } } warn("DetectENC: after while at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; my $i2; for(; $self->{currentEncoding} == E_C40 and $iterator < $i; $self->{currentEncoding} = $i2) { $ai4->[0] = $iterator; my $l = $self->EncodeC40TEXT($i, $ai4, $ai, $ai3, 0, $l2 != E_C40, 1); $iterator = $ai4->[0]; splice(@$ai1,$j1,$l, @$ai3[0 .. $l-1 ]); $j1 += $l; $i2 = $self->SelectEncoding($iterator); $l2 = $self->{currentEncoding}; } warn("DetectENC: after C40 at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; my $j2; for(; $self->{currentEncoding} == E_TEXT and $iterator < $i; $self->{currentEncoding} = $j2) { $ai4->[0] = $iterator; my $i1 = $self->EncodeC40TEXT($i, $ai4, $ai, $ai3, 1, $l2 != E_TEXT, 1); $iterator = $ai4->[0]; splice(@$ai1,$j1,$i1, @$ai3[0 .. $i1-1 ]); $j1 += $i1; $j2 = $self->SelectEncoding($iterator); $l2 = $self->{currentEncoding}; } warn("DetectENC: after TEXT at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; if($self->{currentEncoding} == E_BASE256) { $ai4->[0] = $iterator; $j1 = $self->EncodeBASE256($i, $ai4, $ai, [$j1], $ai1, 1); $iterator = $ai4->[0]; my $k2 = $self->SelectEncoding($iterator); $l2 = $self->{currentEncoding}; $self->{currentEncoding} = $k2; } warn("DetectENC: after B256 at $iterator ce=$encName[$self->{currentEncoding}] k1=$encName[$k1] l2=$encName[$l2]\n") if $DEBUG{EAUTO}; } return $j1; } =head2 EncodeASCII (i, ai, ai1, as) Encode the message as ASCII. =cut sub EncodeASCII { #CE (int i; int ai[], int ai1[], String as[]) : int my $self = shift; warn "[CE] EncodeASCII(@_)\n" if $DEBUG{TRACE}; my ($i,$ai,$ai1,$as) = @_; warn "[CE] ai:{".join(" ",grep{+defined}@$ai)."}; ai1:{".join(" ",grep{+defined}@$ai1)."}; as:{".join(" ",grep{+defined}@$as)."}\n" if $DEBUG{ENC}; my $j = 0; my $flag = 0; for(my $k = 0; $k < $i; $k++) { my $flag1 = 0; if( $k < $i - 1 and isIDigit($ai->[$k]) and isIDigit($ai->[$k+1]) ) { my $l = ($ai->[$k] - 48) * 10 + ($ai->[$k + 1] - 48); $ai1->[$j++] = 130 + $l; $k++; $flag1 = 1; } if(!$flag1 and defined $as->[$k]) { if( $ai->[$k] == 234 or $ai->[$k] == 237 or $ai->[$k] == 236 or $ai->[$k] == 232 ) { $ai1->[$j++] = $ai->[$k]; $flag1 = 1; } if($ai->[$k] == 233 || $ai->[$k] == 241) { $ai1->[$j++] = $ai->[$k]; for(my $i1 = 0; $i1 < length $as->[$k]; $i1++){ $ai1->[$j++] = ord substr($as->[$k],$i1,1); } $flag1 = 1; } } if(!$flag1){ if($ai->[$k] < 128) { $ai1->[$j++] = $ai->[$k] + 1; } else { $ai1->[$j++] = 235; $ai1->[$j++] = ($ai->[$k] - 128) + 1; } } } warn "[CE] end $j ai1:{".join(" ",@$ai1)."};\n" if $DEBUG{ENC}; return $j; } =head2 SelectEncoding (j, ai, i) Select a new encoding type for the message. =cut sub SelectEncoding #C3 (int ai[], int i, int j, String as[]) : int # DefineEncoding?? #iterator, ai, encoding { #(iterator[,ai[,encoding]]) #(ai,i: encoding,j: iterator,as) my $self = shift; warn "[C3] SelectEncoding(@_)\n" if $DEBUG{TRACE}; my $j = shift; my $ai = shift; $ai = $self->{ai} unless defined $ai; my $i = shift || $self->{currentEncoding}; $i = $self->{currentEncoding} unless defined $i; my $as = $self->{as}; my $d = 0.0; my $d2 = 1.0; my $d3 = 1.0; my $d4 = 1.25; my $k = $j; if($i != E_ASCII) { $d = 1.0; $d2 = 2.0; $d3 = 2.0; $d4 = 2.25; } $d2 = 0.0 if $i == E_C40; $d3 = 0.0 if $i == E_TEXT; $d4 = 0.0 if $i == E_BASE256; for(; $j < @$ai; $j++) { warn "SelectEncoding: have as[$j]: $as->[$j]\n" if defined $as->[$j] and $DEBUG{EAUTO}; my $c = $ai->[$j]; return E_ASCII if defined $as->[$j]; if ( isIDigit($c) ) { $d += 0.5 } elsif ( $c > 127 ) { $d = int( $d + 0.5 ) + 2; } else { $d = int( $d + 0.5 ) + 1; } if ( @{ $C1[$c] } == 1 ) { $d2 += 0.66000000000000003; } elsif ( $c > 127 ) { $d2 += 2.6600000000000001; } else { $d2 += 1.3300000000000001; } my $c1 = $c; if( isIUpper($c) ) { $c1 = ord lc chr $c; } if( isILower($c) ) { $c1 = ord uc chr $c; } if ( @{ $C1[$c1] } == 1) { $d3 += 0.66000000000000003; } elsif ( $c1 > 127 ) { $d3 += 2.6600000000000001; } else { $d3 += 1.3300000000000001; } $d4++; if($j - $k >= 4) { return E_ASCII if $d + 1.0 <= $d2 and $d + 1.0 <= $d3 and $d + 1.0 <= $d4; return E_BASE256 if $d4 + 1.0 <= $d; return E_BASE256 if $d4 + 1.0 < $d3 and $d4 + 1.0 < $d2; return E_TEXT if $d3 + 1.0 < $d and $d3 + 1.0 < $d2 and $d3 + 1.0 < $d4; return E_C40 if $d2 + 1.0 < $d and $d2 + 1.0 < $d3 and $d2 + 1.0 < $d4; } } $d = int( $d + 0.5 ); $d2 = int( $d2 + 0.5 ); $d3 = int( $d3 + 0.5 ); $d4 = int( $d4 + 0.5 ); return E_ASCII if $d <= $d2 and $d <= $d3 and $d <= $d4; return E_TEXT if $d3 < $d and $d3 < $d2 and $d3 < $d4; return E_BASE256 if $d4 < $d and $d4 < $d3 and $d4 < $d2; return E_C40; } =head2 EncodeC40TEXT (i, ai, ai1, ai2, flag, flag1, flag2) Encode the message as C40/TEXT. =cut sub EncodeC40TEXT { # C6 #(int i, int ai[], int ai1[], int ai2[], boolean flag, boolean flag1, boolean flag2) : int my $self = shift; my ($i,$ai,$ai1,$ai2,$flag,$flag1,$flag2) = @_; my $j = my $k = 0; my $ai3 = [ 0, 0, 0 ]; my $flag3 = 0; my $as = [ ]; if($flag1) { $ai2->[$j++] = $flag ? 239 : 230; } for(my $j1 = $ai->[0]; $j1 < $i; $j1++) { my $l = $ai1->[$j1]; if($flag) { my $s = chr($l); $s = uc($s) if($l >= 97 && $l <= 122); $s = lc($s) if($l >= 65 && $l <= 90); $l = ord(substr($s,0,1)); } my $ai4 = $C1[$l]; for my $l1 (0 .. $#$ai4) { $ai3->[$k++] = $ai4->[$l1]; if($k == 3) { my $i2 = $ai3->[0] * 1600 + $ai3->[1] * 40 + $ai3->[2] + 1; $ai2->[$j++] = int $i2 / 256; $ai2->[$j++] = $i2 % 256; $k = 0; } } if($flag2 && $k == 0) { $self->{C49rest} = $k; $ai->[0] = $j1 + 1; $ai2->[$j++] = 254 if($ai->[0] == $i); return $j; } } $ai->[0] = $i; if($k > 0) { if($k == 1) { $ai2->[$j++] = 254; $ai2->[$j++] = $ai1->[$i - 1] + 1; return $j; } if($k == 2) { $ai3->[2] = 0; my $k1 = $ai3->[0] * 1600 + $ai3->[1] * 40 + $ai3->[2] + 1; $ai2->[$j++] = int $k1 / 256; $ai2->[$j++] = $k1 % 256; $ai2->[$j++] = 254; $self->{C49rest} = $k; return $j; } } else { $ai2->[$j++] = 254; } $self->{C49rest} = $k; return $j; } =head2 state255 (V, P) The 255-state algorithm. Used when encoding strings with the BASE256 type. This information originally from L. Let C

the number of data Cs from the beginning of datas (C = code word). Let C be a pseudo random number, C the base 256 C value and C the required C. R = ((149 * P) MOD 255) + 1 CW = (V + R) MOD 256 =cut sub state255 # (int V, int P) : int { my ($V,$P) = @_; return ( $V + (149 * $P) % 255 + 1 ) % 256; } =head2 hexary (src) Return a string representation of the input hexadecimal number. =cut sub hexary { join(" ",map{ sprintf '%02x',$_} @{ shift() } ) } =head2 EncodeBASE256 (i, hint, src, stat, res, flag) Encode the message as BASE256. =cut sub EncodeBASE256 { my $self = shift; my ($i,$hint,$src,$stat,$res,$flag) = @_; my $j = 0; my $xv = []; my $l = $stat->[0]; my $flag1 = 0; my $j1 = 0; warn "AI1{".hexary($src)."}\n" if $DEBUG{B256}; warn "AI4{".hexary($xv)."}\n" if $DEBUG{B256}; for( $j1 = $hint->[0]; $j1 < $i; $j1++){ $xv->[$j++] = $src->[$j1]; last if $flag and $self->SelectEncoding($j1 + 1,$src,E_BASE256) != E_BASE256; } warn "AI1{".hexary($src)."}\n" if $DEBUG{B256}; warn "AI4{".hexary($xv)."}\n" if $DEBUG{B256}; $hint->[0] = $j1; $res->[$l++] = 231; if($j < 250) { $res->[$l++] = state255($j, $l + 1); } else { $res->[$l++] = state255(249 + ($i - $i % 250) / 250, $l + 1); $res->[$l++] = state255($i % 250, $l + 1); } $res->[$l++] = state255($xv->[$_], $l + 1) for 0..$j-1; $stat->[0] = $l; return $l; } =head2 GenData (ai) Generate and return the data for the DataMatrix bitmap from the input array. =cut sub GenData { # CC (int ai[]) : int[][] my $self = shift; my ($ai) = @_; warn "[CC] GenData: ".join(",",@$ai)." [$self->{rows} x $self->{cols} : $self->{regions} : $self->{datacols}x$self->{datarows}]\n" if $DEBUG{TRACE}; my $ai1 = [ map { [ (undef) x $self->{rows} ] } 1..$self->{cols} ]; # reverse cols/rows here, for correct access ->[][] my $i = my $j = 0; # Draw border if($self->{regions} == 2) { FillBorder($ai1, $i, $j, $self->{datacols} + 2, $self->{datarows} + 2); FillBorder($ai1, $i + $self->{datacols} + 2, $j, $self->{datacols} + 2, $self->{datarows} + 2); } else { my $k = int(sqrt($self->{regions})); for(my $l = 0; $l < $k; $l++){ for(my $i1 = 0; $i1 < $k; $i1++) { FillBorder($ai1, $i + $l * ($self->{datacols} + 2), $j + $i1 * ($self->{datarows} + 2), $self->{datacols} + 2, $self->{datarows} + 2); } } } # End draw border my $ai2 = [ (undef) x ( ($self->{mapcols} + 10) * $self->{maprows} ) ]; warn "[" . join (" ", grep { +defined } @$ai2)."]\n" if $DEBUG{CALC}; FillCharData($self->{mapcols},$self->{maprows},$ai2); warn "[" . join (" ", grep { +defined } @$ai2)."]\n" if $DEBUG{CALC}; warn "--------------\n" if $DEBUG{CALC}; warn "[" . join (" ", grep { +defined } @$ai)."]\n" if $DEBUG{CALC}; my $j1 = 1; my $flag = 0; my $flag1 = 0; for(my $i2 = 0; $i2 < $self->{maprows}; $i2++) { my $j2 = 1; for(my $k2 = 0; $k2 < $self->{mapcols}; $k2++) { my $l1 = $k2 + $j2; my $k1 = $i2 + $j1; if($ai2->[$i2 * $self->{mapcols} + $k2] > 9) { my $l2 = int ( $ai2->[$i2 * $self->{mapcols} + $k2] / 10 ); my $i3 = $ai2->[$i2 * $self->{mapcols} + $k2] % 10; my $j3 = $ai->[$l2 - 1] & 1 << 8 - $i3; $ai1->[$l1][$k1] = $j3; } else { $ai1->[$l1][$k1] = $ai2->[$i2 * $self->{mapcols} + $k2]; } if($k2 > 0 && ($k2 + 1) % $self->{datacols} == 0) { $j2 += 2; } } if($i2 > 0 && ($i2 + 1) % $self->{datarows} == 0) { $j1 += 2; } } return $ai1; } =head2 FillBorder (ai, i, j, k, l) Fill the border of the ECC200 data matrix bitmap. =cut sub FillBorder { # CD (int ai[][], int i, int j, int k, int l) : void my ($ai,$i,$j,$k,$l) = @_; my $i1 = 0; for(my $k1 = 0; $k1 < $k; $k1++) { $i1 = ($k1 % 2 == 0) ? 1 : 0; $ai->[$i + $k1][$j + $l - 1] = 1; $ai->[$i + $k1][$j] = $i1; } $i1 = 0; for(my $l1 = 0; $l1 < $l; $l1++) { my $j1 = (($l1 + 1) % 2 == 0) ? 1 : 0; $ai->[$i][$j + $l1] = 1; $ai->[$i + $k - 1][$j + $l1] = $j1; } } =head2 FillCharData (ncol, nrow, array) Fill the data matrix with the character data in the given message array. =cut sub FillCharData { # (int ncol; int nrow; int array;) : void my ($ncol,$nrow,$array) = @_; Barcode::DataMatrix::CharDataFiller->new($ncol,$nrow,$array); return; } 1; Barcode-DataMatrix-0.10/lib/Barcode/DataMatrix/Reed.pm000644 000767 000024 00000003467 13202654036 023573 0ustar00mstratmanstaff000000 000000 package Barcode::DataMatrix::Reed; =head1 NAME Barcode::DataMatrix::Reed - Renamed version of Algorithm::DataMatrix::Reed =head1 DESCRIPTION This is just a renamed version of Algorithm::DataMatrix::Reed by Mons Anderson from http://code.google.com/p/perl-ex/ For a rough explanation of the structure of this code, see L. Note that the link is not the basis of the implementation (this is unknown), however it helps explain how Reed-Solomon encoding is implemented and hence how the code below works. =cut use strict; use warnings; use Carp; =head2 DEBUG Control whether or not debugging output is printed. =cut sub DEBUG { 0 } =head2 mult (x, y) Multiply two Galois field element values and return the result. =cut sub mult { my ($x, $y) = @_; return 0 unless $x * $y; return $Barcode::DataMatrix::Constants::GFI[($Barcode::DataMatrix::Constants::GFL[$x] + $Barcode::DataMatrix::Constants::GFL[$y]) % 255]; } =head2 encode (ai, j) Encode the message array and return it. =cut sub encode { my ($ai,$j) = @_; my $i = @$ai; for (0..$#$ai) { ( $ai->[$_] & 0xFF ) != $ai->[$_] and warn("number $ai->[$_] at index $_ is not a byte size"), $ai->[$_] = $ai->[$_] & 0xFF; } warn "CalcReed: ai [@$ai], $j\n" if DEBUG; my $p = exists $Barcode::DataMatrix::Constants::POLY{$j} ? $Barcode::DataMatrix::Constants::POLY{$j} : $Barcode::DataMatrix::Constants::POLY{68}; warn "CalcReed: poly [@$p]\n" if DEBUG; @$ai[ $i .. $i + $j - 1 ] = (0) x $j; for my $l(0 .. $i - 1) { my $word0 = ($ai->[$i] ^ $ai->[$l]); for my $i1 (0 .. $j - 2) { $ai->[$i + $i1] = ( $ai->[$i + $i1 + 1] ^ mult($word0, $p->[$i1]) ); } $ai->[$i+$j-1] = mult($word0, $p->[$j - 1]); } warn "CalcReed: result [@$ai]\n" if DEBUG; return $ai; } 1; Barcode-DataMatrix-0.10/inc/Module/000755 000767 000024 00000000000 13202654204 020174 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/inc/Module/AutoInstall.pm000644 000767 000024 00000062311 13202654174 023002 0ustar00mstratmanstaff000000 000000 #line 1 package Module::AutoInstall; use strict; use Cwd (); use File::Spec (); use ExtUtils::MakeMaker (); use vars qw{$VERSION}; BEGIN { $VERSION = '1.18'; } # special map on pre-defined feature sets my %FeatureMap = ( '' => 'Core Features', # XXX: deprecated '-core' => 'Core Features', ); # various lexical flags my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS ); my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps, $UpgradeDeps ); my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps, $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps, $PostambleActionsListAllDeps, $PostambleUsed, $NoTest); # See if it's a testing or non-interactive session _accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); _init(); sub _accept_default { $AcceptDefault = shift; } sub _installdeps_target { $InstallDepsTarget = shift; } sub missing_modules { return @Missing; } sub do_install { __PACKAGE__->install( [ $Config ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) : () ], @Missing, ); } # initialize various flags, and/or perform install sub _init { foreach my $arg ( @ARGV, split( /[\s\t]+/, $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || '' ) ) { if ( $arg =~ /^--config=(.*)$/ ) { $Config = [ split( ',', $1 ) ]; } elsif ( $arg =~ /^--installdeps=(.*)$/ ) { __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) { $UpgradeDeps = 1; __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--default(?:deps)?$/ ) { $AcceptDefault = 1; } elsif ( $arg =~ /^--check(?:deps)?$/ ) { $CheckOnly = 1; } elsif ( $arg =~ /^--skip(?:deps)?$/ ) { $SkipInstall = 1; } elsif ( $arg =~ /^--test(?:only)?$/ ) { $TestOnly = 1; } elsif ( $arg =~ /^--all(?:deps)?$/ ) { $AllDeps = 1; } } } # overrides MakeMaker's prompt() to automatically accept the default choice sub _prompt { goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault; my ( $prompt, $default ) = @_; my $y = ( $default =~ /^[Yy]/ ); print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] '; print "$default\n"; return $default; } # the workhorse sub import { my $class = shift; my @args = @_ or return; my $core_all; print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; my $cwd = Cwd::getcwd(); $Config = []; my $maxlen = length( ( sort { length($b) <=> length($a) } grep { /^[^\-]/ } map { ref($_) ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} ) : '' } map { +{@args}->{$_} } grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} } )[0] ); # We want to know if we're under CPAN early to avoid prompting, but # if we aren't going to try and install anything anyway then skip the # check entirely since we don't want to have to load (and configure) # an old CPAN just for a cosmetic message $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget; while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) { my ( @required, @tests, @skiptests ); my $default = 1; my $conflict = 0; if ( $feature =~ m/^-(\w+)$/ ) { my $option = lc($1); # check for a newer version of myself _update_to( $modules, @_ ) and return if $option eq 'version'; # sets CPAN configuration options $Config = $modules if $option eq 'config'; # promote every features to core status $core_all = ( $modules =~ /^all$/i ) and next if $option eq 'core'; next unless $option eq 'core'; } print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n"; $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { my $option = lc($1); $default = $arg if ( $option eq 'default' ); $conflict = $arg if ( $option eq 'conflict' ); @tests = @{$arg} if ( $option eq 'tests' ); @skiptests = @{$arg} if ( $option eq 'skiptests' ); next; } printf( "- %-${maxlen}s ...", $mod ); if ( $arg and $arg =~ /^\D/ ) { unshift @$modules, $arg; $arg = 0; } # XXX: check for conflicts and uninstalls(!) them. my $cur = _version_of($mod); if (_version_cmp ($cur, $arg) >= 0) { print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n"; push @Existing, $mod => $arg; $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { if (not defined $cur) # indeed missing { print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n"; } else { # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above print "too old. ($cur < $arg)\n"; } push @required, $mod => $arg; } } next unless @required; my $mandatory = ( $feature eq '-core' or $core_all ); if ( !$SkipInstall and ( $CheckOnly or ($mandatory and $UnderCPAN) or $AllDeps or $InstallDepsTarget or _prompt( qq{==> Auto-install the } . ( @required / 2 ) . ( $mandatory ? ' mandatory' : ' optional' ) . qq{ module(s) from CPAN?}, $default ? 'y' : 'n', ) =~ /^[Yy]/ ) ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } elsif ( !$SkipInstall and $default and $mandatory and _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', ) =~ /^[Nn]/ ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { $DisabledTests{$_} = 1 for map { glob($_) } @tests; } } if ( @Missing and not( $CheckOnly or $UnderCPAN) ) { require Config; my $make = $Config::Config{make}; if ($InstallDepsTarget) { print "*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n"; } else { print "*** Dependencies will be installed the next time you type '$make'.\n"; } # make an educated guess of whether we'll need root permission. print " (You may need to do that as the 'root' user.)\n" if eval '$>'; } print "*** $class configuration finished.\n"; chdir $cwd; # import to main:: no strict 'refs'; *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main'; return (@Existing, @Missing); } sub _running_under { my $thing = shift; print <<"END_MESSAGE"; *** Since we're running under ${thing}, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } # Check to see if we are currently running under CPAN.pm and/or CPANPLUS; # if we are, then we simply let it taking care of our dependencies sub _check_lock { return unless @Missing or @_; if ($ENV{PERL5_CPANM_IS_RUNNING}) { return _running_under('cpanminus'); } my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING}; if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) { return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS'); } require CPAN; if ($CPAN::VERSION > '1.89') { if ($cpan_env) { return _running_under('CPAN'); } return; # CPAN.pm new enough, don't need to check further } # last ditch attempt, this -will- configure CPAN, very sorry _load_cpan(1); # force initialize even though it's already loaded # Find the CPAN lock-file my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" ); return unless -f $lock; # Check the lock local *LOCK; return unless open(LOCK, $lock); if ( ( $^O eq 'MSWin32' ? _under_cpan() : == getppid() ) and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore' ) { print <<'END_MESSAGE'; *** Since we're running under CPAN, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } close LOCK; return; } sub install { my $class = shift; my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); my ( @modules, @installed, @modules_to_upgrade ); while (my ($pkg, $ver) = splice(@_, 0, 2)) { # grep out those already installed if (_version_cmp(_version_of($pkg), $ver) >= 0) { push @installed, $pkg; if ($UpgradeDeps) { push @modules_to_upgrade, $pkg, $ver; } } else { push @modules, $pkg, $ver; } } if ($UpgradeDeps) { push @modules, @modules_to_upgrade; @installed = (); @modules_to_upgrade = (); } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell print "*** Installing dependencies...\n"; return unless _connected_to('cpan.org'); my %args = @config; my %failed; local *FAILED; if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) { while () { chomp; $failed{$_}++ } close FAILED; my @newmod; while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) { push @newmod, ( $k => $v ) unless $failed{$k}; } @modules = @newmod; } if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) { _install_cpanplus( \@modules, \@config ); } else { _install_cpan( \@modules, \@config ); } print "*** $class installation finished.\n"; # see if we have successfully installed them while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { push @installed, $pkg; } elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) { print FAILED "$pkg\n"; } } close FAILED if $args{do_once}; return @installed; } sub _install_cpanplus { my @modules = @{ +shift }; my @config = _cpanplus_config( @{ +shift } ); my $installed = 0; require CPANPLUS::Backend; my $cp = CPANPLUS::Backend->new; my $conf = $cp->configure_object; return unless $conf->can('conf') # 0.05x+ with "sudo" support or _can_write($conf->_get_build('base')); # 0.04x # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $conf->get_conf('makeflags') || ''; if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) { # 0.03+ uses a hashref here $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST}; } else { # 0.02 and below uses a scalar $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); } $conf->set_conf( makeflags => $makeflags ); $conf->set_conf( prereqs => 1 ); while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) { $conf->set_conf( $key, $val ); } my $modtree = $cp->module_tree; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { print "*** Installing $pkg...\n"; MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; my $success; my $obj = $modtree->{$pkg}; if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = $cp->install( modules => [ $obj->{module} ] ); if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation cancelled.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _cpanplus_config { my @config = (); while ( @_ ) { my ($key, $value) = (shift(), shift()); if ( $key eq 'prerequisites_policy' ) { if ( $value eq 'follow' ) { $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL(); } elsif ( $value eq 'ask' ) { $value = CPANPLUS::Internals::Constants::PREREQ_ASK(); } elsif ( $value eq 'ignore' ) { $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE(); } else { die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n"; } push @config, 'prereqs', $value; } elsif ( $key eq 'force' ) { push @config, $key, $value; } elsif ( $key eq 'notest' ) { push @config, 'skiptest', $value; } else { die "*** Cannot convert option $key to CPANPLUS version.\n"; } } return @config; } sub _install_cpan { my @modules = @{ +shift }; my @config = @{ +shift }; my $installed = 0; my %args; _load_cpan(); require Config; if (CPAN->VERSION < 1.80) { # no "sudo" support, probe for writableness return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) ) and _can_write( $Config::Config{sitelib} ); } # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $CPAN::Config->{make_install_arg} || ''; $CPAN::Config->{make_install_arg} = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); # don't show start-up info $CPAN::Config->{inhibit_startup_message} = 1; # set additional options while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { die "Your version of CPAN is too old to support the 'notest' pragma"; } local $CPAN::Config->{prerequisites_policy} = 'follow'; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; print "*** Installing $pkg...\n"; my $obj = CPAN::Shell->expand( Module => $pkg ); my $success = 0; if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = do { if ($args{force}) { CPAN::Shell->force( install => $pkg ) } elsif ($args{notest}) { CPAN::Shell->notest( install => $pkg ) } else { CPAN::Shell->install($pkg) } }; $rv ||= eval { $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, ) ->{install} if $CPAN::META; }; if ( $rv eq 'YES' ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation failed.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _has_cpanplus { return ( $HasCPANPLUS = ( $INC{'CPANPLUS/Config.pm'} or _load('CPANPLUS::Shell::Default') ) ); } # make guesses on whether we're under the CPAN installation directory sub _under_cpan { require Cwd; require File::Spec; my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); } sub _update_to { my $class = __PACKAGE__; my $ver = shift; return if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade if ( _prompt( "==> A newer version of $class ($ver) is required. Install?", 'y' ) =~ /^[Nn]/ ) { die "*** Please install $class $ver manually.\n"; } print << "."; *** Trying to fetch it from CPAN... . # install ourselves _load($class) and return $class->import(@_) if $class->install( [], $class, $ver ); print << '.'; exit 1; *** Cannot bootstrap myself. :-( Installation terminated. . } # check if we're connected to some host, using inet_aton sub _connected_to { my $site = shift; return ( ( _load('Socket') and Socket::inet_aton($site) ) or _prompt( qq( *** Your host cannot resolve the domain name '$site', which probably means the Internet connections are unavailable. ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/ ); } # check if a directory is writable; may create it on demand sub _can_write { my $path = shift; mkdir( $path, 0755 ) unless -e $path; return 1 if -w $path; print << "."; *** You are not allowed to write to the directory '$path'; the installation may fail due to insufficient permissions. . if ( eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt( qq( ==> Should we try to re-execute the autoinstall process with 'sudo'?), ((-t STDIN) ? 'y' : 'n') ) =~ /^[Yy]/ ) { # try to bootstrap ourselves from sudo print << "."; *** Trying to re-execute the autoinstall process with 'sudo'... . my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; return unless system( 'sudo', $^X, $0, "--config=$config", "--installdeps=$missing" ); print << "."; *** The 'sudo' command exited with error! Resuming... . } return _prompt( qq( ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/; } # load a module and return the version it reports sub _load { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; local $@; return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 ); } # report version without loading a module sub _version_of { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; foreach my $dir ( @INC ) { next if ref $dir; my $path = File::Spec->catfile($dir, $file); next unless -e $path; require ExtUtils::MM_Unix; return ExtUtils::MM_Unix->parse_version($path); } return undef; } # Load CPAN.pm and it's configuration sub _load_cpan { return if $CPAN::VERSION and $CPAN::Config and not @_; require CPAN; # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to # CPAN::HandleConfig->load. CPAN reports that the redirection # is deprecated in a warning printed at the user. # CPAN-1.81 expects CPAN::HandleConfig->load, does not have # $CPAN::HandleConfig::VERSION but cannot handle # CPAN::Config->load # Which "versions expect CPAN::Config->load? if ( $CPAN::HandleConfig::VERSION || CPAN::HandleConfig->can('load') ) { # Newer versions of CPAN have a HandleConfig module CPAN::HandleConfig->load; } else { # Older versions had the load method in Config directly CPAN::Config->load; } } # compare two versions, either use Sort::Versions or plain comparison # return values same as <=> sub _version_cmp { my ( $cur, $min ) = @_; return -1 unless defined $cur; # if 0 keep comparing return 1 unless $min; $cur =~ s/\s+$//; # check for version numbers that are not in decimal format if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) { if ( ( $version::VERSION or defined( _load('version') )) and version->can('new') ) { # use version.pm if it is installed. return version->new($cur) <=> version->new($min); } elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) ) { # use Sort::Versions as the sorting algorithm for a.b.c versions return Sort::Versions::versioncmp( $cur, $min ); } warn "Cannot reliably compare non-decimal formatted versions.\n" . "Please install version.pm or Sort::Versions.\n"; } # plain comparison local $^W = 0; # shuts off 'not numeric' bugs return $cur <=> $min; } # nothing; this usage is deprecated. sub main::PREREQ_PM { return {}; } sub _make_args { my %args = @_; $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing } if $UnderCPAN or $TestOnly; if ( $args{EXE_FILES} and -e 'MANIFEST' ) { require ExtUtils::Manifest; my $manifest = ExtUtils::Manifest::maniread('MANIFEST'); $args{EXE_FILES} = [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ]; } $args{test}{TESTS} ||= 't/*.t'; $args{test}{TESTS} = join( ' ', grep { !exists( $DisabledTests{$_} ) } map { glob($_) } split( /\s+/, $args{test}{TESTS} ) ); my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; $PostambleActions = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); my $deps_list = join( ',', @Missing, @Existing ); $PostambleActionsUpgradeDeps = "\$(PERL) $0 --config=$config --upgradedeps=$deps_list"; my $config_notest = join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}), 'notest', 1 ) if $Config; $PostambleActionsNoTest = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); $PostambleActionsUpgradeDepsNoTest = "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list"; $PostambleActionsListDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing); my @all = (@Missing, @Existing); $PostambleActionsListAllDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all); return %args; } # a wrapper to ExtUtils::MakeMaker::WriteMakefile sub Write { require Carp; Carp::croak "WriteMakefile: Need even number of args" if @_ % 2; if ($CheckOnly) { print << "."; *** Makefile not written in check-only mode. . return; } my %args = _make_args(@_); no strict 'refs'; $PostambleUsed = 0; local *MY::postamble = \&postamble unless defined &MY::postamble; ExtUtils::MakeMaker::WriteMakefile(%args); print << "." unless $PostambleUsed; *** WARNING: Makefile written with customized MY::postamble() without including contents from Module::AutoInstall::postamble() -- auto installation features disabled. Please contact the author. . return 1; } sub postamble { $PostambleUsed = 1; my $fragment; $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget; config :: installdeps \t\$(NOECHO) \$(NOOP) AUTO_INSTALL $fragment .= <<"END_MAKE"; checkdeps :: \t\$(PERL) $0 --checkdeps installdeps :: \t$PostambleActions installdeps_notest :: \t$PostambleActionsNoTest upgradedeps :: \t$PostambleActionsUpgradeDeps upgradedeps_notest :: \t$PostambleActionsUpgradeDepsNoTest listdeps :: \t$PostambleActionsListDeps listalldeps :: \t$PostambleActionsListAllDeps END_MAKE return $fragment; } 1; __END__ #line 1197 Barcode-DataMatrix-0.10/inc/Module/Install/000755 000767 000024 00000000000 13202654204 021602 5ustar00mstratmanstaff000000 000000 Barcode-DataMatrix-0.10/inc/Module/Install.pm000644 000767 000024 00000027145 13202654174 022157 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.18'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS'; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( {no_chdir => 1, wanted => sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($File::Find::name); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }}, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. Barcode-DataMatrix-0.10/inc/Module/Install/AuthorTests.pm000644 000767 000024 00000002215 13202654174 024433 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::AuthorTests; use 5.005; use strict; use Module::Install::Base; use Carp (); #line 16 use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.002'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } #line 42 sub author_tests { my ($self, @dirs) = @_; _add_author_tests($self, \@dirs, 0); } #line 56 sub recursive_author_tests { my ($self, @dirs) = @_; _add_author_tests($self, \@dirs, 1); } sub _wanted { my $href = shift; sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 } } sub _add_author_tests { my ($self, $dirs, $recurse) = @_; return unless $Module::Install::AUTHOR; my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t'; # XXX: pick a default, later -- rjbs, 2008-02-24 my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests"; @dirs = grep { -d } @dirs; if ($recurse) { require File::Find; my %test_dir; File::Find::find(_wanted(\%test_dir), @dirs); $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir ); } else { $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs ); } } #line 107 1; Barcode-DataMatrix-0.10/inc/Module/Install/AutoInstall.pm000644 000767 000024 00000004162 13202654174 024410 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::AutoInstall; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub AutoInstall { $_[0] } sub run { my $self = shift; $self->auto_install_now(@_); } sub write { my $self = shift; $self->auto_install(@_); } sub auto_install { my $self = shift; return if $self->{done}++; # Flatten array of arrays into a single array my @core = map @$_, map @$_, grep ref, $self->build_requires, $self->requires; my @config = @_; # We'll need Module::AutoInstall $self->include('Module::AutoInstall'); require Module::AutoInstall; my @features_require = Module::AutoInstall->import( (@config ? (-config => \@config) : ()), (@core ? (-core => \@core) : ()), $self->features, ); my %seen; my @requires = map @$_, map @$_, grep ref, $self->requires; while (my ($mod, $ver) = splice(@requires, 0, 2)) { $seen{$mod}{$ver}++; } my @build_requires = map @$_, map @$_, grep ref, $self->build_requires; while (my ($mod, $ver) = splice(@build_requires, 0, 2)) { $seen{$mod}{$ver}++; } my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires; while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) { $seen{$mod}{$ver}++; } my @deduped; while (my ($mod, $ver) = splice(@features_require, 0, 2)) { push @deduped, $mod => $ver unless $seen{$mod}{$ver}++; } $self->requires(@deduped); $self->makemaker_args( Module::AutoInstall::_make_args() ); my $class = ref($self); $self->postamble( "# --- $class section:\n" . Module::AutoInstall::postamble() ); } sub installdeps_target { my ($self, @args) = @_; $self->include('Module::AutoInstall'); require Module::AutoInstall; Module::AutoInstall::_installdeps_target(1); $self->auto_install(@args); } sub auto_install_now { my $self = shift; $self->auto_install(@_); Module::AutoInstall::do_install(); } 1; Barcode-DataMatrix-0.10/inc/Module/Install/Base.pm000644 000767 000024 00000002147 13202654174 023024 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.18'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 Barcode-DataMatrix-0.10/inc/Module/Install/Can.pm000644 000767 000024 00000006405 13202654174 022654 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; if ($^O eq 'VMS') { require ExtUtils::CBuilder; my $builder = ExtUtils::CBuilder->new( quiet => 1, ); return $builder->have_compiler; } my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 245 Barcode-DataMatrix-0.10/inc/Module/Install/Fetch.pm000644 000767 000024 00000004627 13202654174 023210 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; Barcode-DataMatrix-0.10/inc/Module/Install/Include.pm000644 000767 000024 00000001015 13202654174 023526 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Include; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub include { shift()->admin->include(@_); } sub include_deps { shift()->admin->include_deps(@_); } sub auto_include { shift()->admin->auto_include(@_); } sub auto_include_deps { shift()->admin->auto_include_deps(@_); } sub auto_include_dependent_dists { shift()->admin->auto_include_dependent_dists(@_); } 1; Barcode-DataMatrix-0.10/inc/Module/Install/Makefile.pm000644 000767 000024 00000027437 13202654174 023700 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 Barcode-DataMatrix-0.10/inc/Module/Install/Metadata.pm000644 000767 000024 00000043302 13202654174 023670 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; Barcode-DataMatrix-0.10/inc/Module/Install/Repository.pm000644 000767 000024 00000004256 13202654174 024334 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Repository; use strict; use 5.005; use vars qw($VERSION); $VERSION = '0.06'; use base qw(Module::Install::Base); sub _execute { my ($command) = @_; `$command`; } sub auto_set_repository { my $self = shift; return unless $Module::Install::AUTHOR; my $repo = _find_repo(\&_execute); if ($repo) { $self->repository($repo); } else { warn "Cannot determine repository URL\n"; } } sub _find_repo { my ($execute) = @_; if (-e ".git") { # TODO support remote besides 'origin'? if ($execute->('git remote show -n origin') =~ /URL: (.*)$/m) { # XXX Make it public clone URL, but this only works with github my $git_url = $1; $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; return $git_url; } elsif ($execute->('git svn info') =~ /URL: (.*)$/m) { return $1; } } elsif (-e ".svn") { if (`svn info` =~ /URL: (.*)$/m) { return $1; } } elsif (-e "_darcs") { # defaultrepo is better, but that is more likely to be ssh, not http if (my $query_repo = `darcs query repo`) { if ($query_repo =~ m!Default Remote: (http://.+)!) { return $1; } } open my $handle, '<', '_darcs/prefs/repos' or return; while (<$handle>) { chomp; return $_ if m!^http://!; } } elsif (-e ".hg") { if ($execute->('hg paths') =~ /default = (.*)$/m) { my $mercurial_url = $1; $mercurial_url =~ s!^ssh://hg\@(bitbucket\.org/)!https://$1!; return $mercurial_url; } } elsif (-e "$ENV{HOME}/.svk") { # Is there an explicit way to check if it's an svk checkout? my $svk_info = `svk info` or return; SVK_INFO: { if ($svk_info =~ /Mirrored From: (.*), Rev\./) { return $1; } if ($svk_info =~ m!Merged From: (/mirror/.*), Rev\.!) { $svk_info = `svk info /$1` or return; redo SVK_INFO; } } return; } } 1; __END__ =encoding utf-8 #line 128 Barcode-DataMatrix-0.10/inc/Module/Install/Win32.pm000644 000767 000024 00000003403 13202654174 023050 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; Barcode-DataMatrix-0.10/inc/Module/Install/WriteAll.pm000644 000767 000024 00000002376 13202654174 023701 0ustar00mstratmanstaff000000 000000 #line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.18'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1;