diff options
Diffstat (limited to 'scripting/perl')
-rw-r--r-- | scripting/perl/CUPS.pm | 144 | ||||
-rw-r--r-- | scripting/perl/CUPS.xs | 270 | ||||
-rw-r--r-- | scripting/perl/Makefile.PL | 17 | ||||
-rw-r--r-- | scripting/perl/README | 35 | ||||
-rw-r--r-- | scripting/perl/test.pl | 17 |
5 files changed, 0 insertions, 483 deletions
diff --git a/scripting/perl/CUPS.pm b/scripting/perl/CUPS.pm deleted file mode 100644 index 5f2ed5f1..00000000 --- a/scripting/perl/CUPS.pm +++ /dev/null @@ -1,144 +0,0 @@ -package CUPS; - -use 5.006; -use strict; -use warnings; -use Carp; - -require Exporter; -require DynaLoader; -use AutoLoader; - -our @ISA = qw(Exporter DynaLoader); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. - -# This allows declaration use CUPS ':all'; -# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK -# will save memory. -our %EXPORT_TAGS = ( 'all' => [ qw( - CUPS_DATE_ANY - CUPS_VERSION - HTTP_MAX_BUFFER - HTTP_MAX_HOST - HTTP_MAX_URI - HTTP_MAX_VALUE - IPP_MAX_NAME - IPP_MAX_VALUES - IPP_PORT - PPD_MAX_LINE - PPD_MAX_NAME - PPD_MAX_TEXT - PPD_VERSION -) ] ); - -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); - -our @EXPORT = qw( - CUPS_DATE_ANY - CUPS_VERSION - HTTP_MAX_BUFFER - HTTP_MAX_HOST - HTTP_MAX_URI - HTTP_MAX_VALUE - IPP_MAX_NAME - IPP_MAX_VALUES - IPP_PORT - PPD_MAX_LINE - PPD_MAX_NAME - PPD_MAX_TEXT - PPD_VERSION -); -our $VERSION = '1.2'; - -sub AUTOLOAD { - # This AUTOLOAD is used to 'autoload' constants from the constant() - # XS function. If a constant is not found then control is passed - # to the AUTOLOAD in AutoLoader. - - my $constname; - our $AUTOLOAD; - ($constname = $AUTOLOAD) =~ s/.*:://; - croak "& not defined" if $constname eq 'constant'; - my $val = constant($constname, @_ ? $_[0] : 0); - if ($! != 0) { - if ($! =~ /Invalid/ || $!{EINVAL}) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } - else { - croak "Your vendor has not defined CUPS macro $constname"; - } - } - { - no strict 'refs'; - # Fixed between 5.005_53 and 5.005_61 - if ($] >= 5.00561) { - *$AUTOLOAD = sub () { $val }; - } - else { - *$AUTOLOAD = sub { $val }; - } - } - goto &$AUTOLOAD; -} - -bootstrap CUPS $VERSION; - -# Preloaded methods go here. - -# Autoload methods go after =cut, and are processed by the autosplit program. - -1; -__END__ -# Below is stub documentation for your module. You better edit it! - -=head1 NAME - -CUPS - Perl extension for blah blah blah - -=head1 SYNOPSIS - - use CUPS; - blah blah blah - -=head1 DESCRIPTION - -Stub documentation for CUPS, created by h2xs. It looks like the -author of the extension was negligent enough to leave the stub -unedited. - -Blah blah blah. - -=head2 EXPORT - -None by default. - -=head2 Exportable constants - - CUPS_DATE_ANY - CUPS_VERSION - HTTP_MAX_BUFFER - HTTP_MAX_HOST - HTTP_MAX_URI - HTTP_MAX_VALUE - IPP_MAX_NAME - IPP_MAX_VALUES - IPP_PORT - PPD_MAX_LINE - PPD_MAX_NAME - PPD_MAX_TEXT - PPD_VERSION - - -=head1 AUTHOR - -A. U. Thor, E<lt>a.u.thor@a.galaxy.far.far.awayE<gt> - -=head1 SEE ALSO - -L<perl>. - -=cut diff --git a/scripting/perl/CUPS.xs b/scripting/perl/CUPS.xs deleted file mode 100644 index efaf6dc7..00000000 --- a/scripting/perl/CUPS.xs +++ /dev/null @@ -1,270 +0,0 @@ -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#include <cups/cups.h> -#include <cups/http.h> -#include <cups/ipp.h> -#include <cups/language.h> -#include <cups/ppd.h> - -static int -not_here(char *s) -{ - croak("%s not implemented on this architecture", s); - return -1; -} - -static double -constant_PPD_M(char *name, int len, int arg) -{ - if (5 + 3 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[5 + 3]) { - case 'L': - if (strEQ(name + 5, "AX_LINE")) { /* PPD_M removed */ -#ifdef PPD_MAX_LINE - return PPD_MAX_LINE; -#else - goto not_there; -#endif - } - case 'N': - if (strEQ(name + 5, "AX_NAME")) { /* PPD_M removed */ -#ifdef PPD_MAX_NAME - return PPD_MAX_NAME; -#else - goto not_there; -#endif - } - case 'T': - if (strEQ(name + 5, "AX_TEXT")) { /* PPD_M removed */ -#ifdef PPD_MAX_TEXT - return PPD_MAX_TEXT; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant_P(char *name, int len, int arg) -{ - if (1 + 3 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[1 + 3]) { - case 'M': - if (!strnEQ(name + 1,"PD_", 3)) - break; - return constant_PPD_M(name, len, arg); - case 'V': - if (strEQ(name + 1, "PD_VERSION")) { /* P removed */ -#ifdef PPD_VERSION - return PPD_VERSION; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant_H(char *name, int len, int arg) -{ - if (1 + 8 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[1 + 8]) { - case 'B': - if (strEQ(name + 1, "TTP_MAX_BUFFER")) { /* H removed */ -#ifdef HTTP_MAX_BUFFER - return HTTP_MAX_BUFFER; -#else - goto not_there; -#endif - } - case 'H': - if (strEQ(name + 1, "TTP_MAX_HOST")) { /* H removed */ -#ifdef HTTP_MAX_HOST - return HTTP_MAX_HOST; -#else - goto not_there; -#endif - } - case 'U': - if (strEQ(name + 1, "TTP_MAX_URI")) { /* H removed */ -#ifdef HTTP_MAX_URI - return HTTP_MAX_URI; -#else - goto not_there; -#endif - } - case 'V': - if (strEQ(name + 1, "TTP_MAX_VALUE")) { /* H removed */ -#ifdef HTTP_MAX_VALUE - return HTTP_MAX_VALUE; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant_IPP_M(char *name, int len, int arg) -{ - if (5 + 3 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[5 + 3]) { - case 'N': - if (strEQ(name + 5, "AX_NAME")) { /* IPP_M removed */ -#ifdef IPP_MAX_NAME - return IPP_MAX_NAME; -#else - goto not_there; -#endif - } - case 'V': - if (strEQ(name + 5, "AX_VALUES")) { /* IPP_M removed */ -#ifdef IPP_MAX_VALUES - return IPP_MAX_VALUES; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant_I(char *name, int len, int arg) -{ - if (1 + 3 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[1 + 3]) { - case 'M': - if (!strnEQ(name + 1,"PP_", 3)) - break; - return constant_IPP_M(name, len, arg); - case 'P': - if (strEQ(name + 1, "PP_PORT")) { /* I removed */ -#ifdef IPP_PORT - return IPP_PORT; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant_C(char *name, int len, int arg) -{ - if (1 + 4 >= len ) { - errno = EINVAL; - return 0; - } - switch (name[1 + 4]) { - case 'D': - if (strEQ(name + 1, "UPS_DATE_ANY")) { /* C removed */ -#ifdef CUPS_DATE_ANY - return CUPS_DATE_ANY; -#else - goto not_there; -#endif - } - case 'V': - if (strEQ(name + 1, "UPS_VERSION")) { /* C removed */ -#ifdef CUPS_VERSION - return CUPS_VERSION; -#else - goto not_there; -#endif - } - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - -static double -constant(char *name, int len, int arg) -{ - errno = 0; - switch (name[0 + 0]) { - case 'C': - return constant_C(name, len, arg); - case 'H': - return constant_H(name, len, arg); - case 'I': - return constant_I(name, len, arg); - case 'P': - return constant_P(name, len, arg); - } - errno = EINVAL; - return 0; - -not_there: - errno = ENOENT; - return 0; -} - - -MODULE = CUPS PACKAGE = CUPS - - -double -constant(sv,arg) - PREINIT: - STRLEN len; - INPUT: - SV * sv - char * s = SvPV(sv, len); - int arg - CODE: - RETVAL = constant(s,len,arg); - OUTPUT: - RETVAL - diff --git a/scripting/perl/Makefile.PL b/scripting/perl/Makefile.PL deleted file mode 100644 index f5e4bdd2..00000000 --- a/scripting/perl/Makefile.PL +++ /dev/null @@ -1,17 +0,0 @@ -use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile( - 'NAME' => 'CUPS', - 'VERSION_FROM' => 'CUPS.pm', # finds $VERSION - 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 - ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT_FROM => 'CUPS.pm', # retrieve abstract from module - AUTHOR => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : ()), - 'LIBS' => ['-lcups '], # e.g., '-lm' - 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' - # Insert -I. if you add *.h files later: - 'INC' => '', # e.g., '-I/usr/include/other' - # Un-comment this if you add C files to link with later: - # 'OBJECT' => '$(O_FILES)', # link all the C files too -); diff --git a/scripting/perl/README b/scripting/perl/README deleted file mode 100644 index 1605c779..00000000 --- a/scripting/perl/README +++ /dev/null @@ -1,35 +0,0 @@ -CUPS version 1.2 -================ - -The README is used to introduce the module and provide instructions on -how to install the module, any machine dependencies it may have (for -example C compilers and installed libraries) and any other information -that should be provided before the module is installed. - -A README file is required for CPAN modules since CPAN extracts the -README file from a module distribution so that people browsing the -archive can use it get an idea of the modules uses. It is usually a -good idea to provide version information here so that people can -decide whether fixes for the module are worth downloading. - -INSTALLATION - -To install this module type the following: - - perl Makefile.PL - make - make test - make install - -DEPENDENCIES - -This module requires these other modules and libraries: - - blah blah blah - -COPYRIGHT AND LICENCE - -Put the correct copyright and licence information here. - -Copyright (C) 2002 A. U. Thor blah blah blah - diff --git a/scripting/perl/test.pl b/scripting/perl/test.pl deleted file mode 100644 index acf31916..00000000 --- a/scripting/perl/test.pl +++ /dev/null @@ -1,17 +0,0 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' - -######################### - -# change 'tests => 1' to 'tests => last_test_to_print'; - -use Test; -BEGIN { plan tests => 1 }; -use CUPS; -ok(1); # If we made it this far, we're ok. - -######################### - -# Insert your test code below, the Test module is use()ed here so read -# its man page ( perldoc Test ) for help writing this test script. - |