]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Removed PHP and Perl APIs
authorTill Kamppeter <till.kamppeter@gmail.com>
Sun, 4 Sep 2022 13:22:57 +0000 (15:22 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sun, 4 Sep 2022 13:22:57 +0000 (15:22 +0200)
The included PHP and Perl APIs did not get actually maintained and
especially never used by anyone. They still were on the API level of
CUPS 1.2. And the Perl part was not even supported by the build system
(only the scripting/perl/ directory in EXTRA_DIST to get it into the
source tarball).

Therefore we do not take it over into cups-filters 2.x and drop it
here.

Makefile.am
configure.ac
scripting/perl/CUPS.pm [deleted file]
scripting/perl/CUPS.xs [deleted file]
scripting/perl/Makefile.PL [deleted file]
scripting/perl/README [deleted file]
scripting/perl/test.pl [deleted file]
scripting/php/README [deleted file]
scripting/php/phpcups.c [deleted file]
scripting/php/phpcups.h [deleted file]
scripting/php/phpcups.php [deleted file]

index c6d56f080c9f44b2f40f478619bf6d821dda779c..bb652a709cc14bca335c00e6d69f0f842ca7451e 100644 (file)
@@ -1282,26 +1282,6 @@ EXTRA_DIST += \
        $(genppdfiles) \
        $(gsppdfiles)
 
-# =========
-# Scripting
-# =========
-if WITH_PHP
-phpextensiondir = $(PHPDIR)
-phpextension_LTLIBRARIES = libphpcups.la
-endif
-
-libphpcups_la_SOURCES = \
-       scripting/php/phpcups.c \
-       scripting/php/phpcups.h
-libphpcups_la_LIBADD = $(CUPS_LIBS)
-libphpcups_la_CFLAGS = $(CUPS_CFLAGS)
-libphpcups_la_LDFLAGS = -no-undefined
-
-EXTRA_DIST += \
-       scripting/perl \
-       scripting/php/README \
-       scripting/php/phpcups.php
-
 distclean-local:
        rm -rf *.cache *~
 
index 60f274a0e4520ef857d719d5c084e67e5ff20f18..0fd6fe7bb095e06355d39c5f18c53e9fcec69e39 100644 (file)
@@ -846,34 +846,6 @@ AC_ARG_ENABLE([individual-cups-filters],
 AM_CONDITIONAL([ENABLE_INDIVIDUAL_CUPS_FILTERS],
 [test "x$enable_individual_cups_filters" != "xno"])
 
-# =============
-# Check for php
-# =============
-# NOTE: This stuff is broken, requires internal cups headers.
-AC_ARG_WITH([php],
-       [AS_HELP_STRING([--with-php], [Determine whether to build php cups extension.])],
-       [with_php="$withval"],
-       [with_php=no]
-)
-AC_ARG_WITH([php-config],
-       [AS_HELP_STRING([--with-php-config=path], [Specify path to php-config executable.])],
-       [with_php_config="$withval"],
-       [with_php_config=system]
-)
-AM_CONDITIONAL([WITH_PHP], [test "x$with_php" = "xyes"])
-AS_IF([test x"$with_php" = "xyes"], [
-       AS_IF([test "x$with_php_config" != "xsystem"], [
-               PHPCONFIG=$with_php_config
-       ], [
-               AC_PATH_TOOL(PHPCONFIG, [php-config])
-               AS_IF([test -z "$PHPCONFIG"], [
-                       AC_MSG_ERROR([Required php-config is missing. Please install PHP developer packages.])
-               ])
-       ])
-       PHPDIR="`$PHPCONFIG --extension-dir`"
-       AC_SUBST(PHPDIR)
-])
-
 # =========
 # Test ARGS
 # =========
@@ -1055,8 +1027,6 @@ Build configuration:
        Poppler's pdftops: ${enable_pdftops}
        pdftops-path:    ${with_pdftops_path}
        png:             ${with_png}
-       php:             ${with_php}
-       php-config:      ${with_php_config}
        pstops:          ${enable_pstops}
        rastertopwg:     ${enable_rastertopwg}
        shell:           ${with_shell}
diff --git a/scripting/perl/CUPS.pm b/scripting/perl/CUPS.pm
deleted file mode 100644 (file)
index 5f2ed5f..0000000
+++ /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 (file)
index efaf6dc..0000000
+++ /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 (file)
index f5e4bdd..0000000
+++ /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 (file)
index ddf8c22..0000000
+++ /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 LICENSE
-
-Put the correct copyright and license 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 (file)
index acf3191..0000000
+++ /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.
-
diff --git a/scripting/php/README b/scripting/php/README
deleted file mode 100644 (file)
index 4af74cc..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-README - 02/25/2006
--------------------
-
-INTRODUCTION
-
-    This directory contains a dynamically loadable CUPS extension
-    module for PHP 4 and 5.  The CUPS 1.2 module has been
-    substantially updated to provide an API more consistent with
-    the C API and is NOT compatible with the CUPS 1.1 module.
-
-
-COMPILING AND INSTALLING
-
-    Run "make" to compile the PHP CUPS extension:
-
-       make
-
-    To install it, type:
-
-       make install
-
-
-BUG REPORTS
-
-    Bug reports and enhancement requests can be submitted via the
-    form at:
-
-        https://bugs.linuxfoundation.org/
-
-    Use "OpenPrinting" as product and "cups-filters" as component.
-
-
-QUICK REFERENCE DOCUMENTATION
-
-    In lieu of actual documentation, the following definitions
-    can be used as a quick reference to the supported functions:
-
-
-    CUPS_CANCEL_JOB
-
-    Cancels a job on the named destination:
-
-        bool cups_cancel_job(string dest, int id)
-
-    The return value is TRUE on success and FALSE on failure.
-
-    Example:
-
-        if (!cups_cancel_job("myprinter", 123))
-         print("Unable to cancel job: " . cups_last_error_string() . "\n");
-
-
-    CUPS_GET_DESTS
-
-    Gets a list of available destinations:
-
-        array cups_get_dests()
-
-    The return value is an array of objects with the following
-    properties:
-
-        name        The name of the printer or class
-       instance    The instance of the printer or class
-       is_default  TRUE if the printer or class is the default destination
-       options     Associative array of options and their values
-
-    Example:
-
-        $dest = cups_get_dests();
-
-
-    CUPS_GET_JOBS
-
-    Gets a list of jobs:
-
-        array cups_get_jobs(string dest, bool myjobs, int completed)
-
-    The "dest" string can be blank for jobs on all destinations.
-    Pass TRUE for "myjobs" to only get jobs for the current user.
-    The "completed" argument can be 0 for pending jobs, 1 for
-    completed jobs, and -1 for all jobs.
-
-    The return value is an array of objects with the following
-    properties:
-
-        id                The job ID
-        dest              Printer or class name
-        title             Title/job name
-        user              User the submitted the job
-        format            Document format
-        state             Job state
-        size              Size in kilobytes
-        priority          Priority (1-100)
-        completed_time    Time the job was completed
-        creation_time     Time the job was created
-        processing_time   Time the job was processed
-
-    Example:
-
-        $jobs = cups_get_jobs("", FALSE, -1);
-
-
-    CUPS_LAST_ERROR
-    
-    Returns the IPP status code for the most recent request:
-
-        int cups_last_error()
-
-    Example:
-
-        $error = cups_last_error();
-
-
-    CUPS_LAST_ERROR_STRING
-    
-    Returns the IPP status-message string for the most recent request:
-
-        string cups_last_error_string()
-
-    Example:
-
-        $message = cups_last_error_string();
-
-
-    CUPS_PRINT_FILE
-
-    Prints a single file to a printer or class:
-
-        int cups_print_file(string dest, string filename, string title,
-                           array options)
-
-    The return value is the job ID or 0 if there was an error.
-
-    Example:
-
-        $options = array("name" => "value", "name2" => "value2");
-       $id      = cups_print_file("dest", "filename", "title", $options);
-
-
-    CUPS_PRINT_FILES
-
-    Prints one or more files to a printer or class:
-
-        int cups_print_files(string dest, array files, string title,
-                            array options);
-
-    The return value is the job ID or 0 if there was an error.
-
-    Example:
-
-        $files   = array("file1", "file2", "file3");
-        $options = array("name" => "value", "name2" => "value2");
-       $id      = cups_print_file("dest", $files, "title", $options);
-
diff --git a/scripting/php/phpcups.c b/scripting/php/phpcups.c
deleted file mode 100644 (file)
index c8fa57e..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- *   Printing utilities for CUPS.
- *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1997-2007 by Easy Software Products.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "COPYING"
- *   which should have been included with this file.
- *
- * Contents:
- *
- *   cups_convert_options()        - Convert a PHP options array to a CUPS options array.
- *   zm_startup_phpcups()          - Initialize the CUPS module.
- *   zif_cups_cancel_job()         - Cancel a job.
- *   zif_cups_get_dests()          - Get a list of printers and classes.
- *   zif_cups_get_jobs()           - Get a list of jobs.
- *   zif_cups_last_error()         - Return the last IPP status code.
- *   zif_cups_last_error_string()  - Return the last IPP status
- *   zif_cups_print_file()         - Print a single file.
- *   zif_cups_print_files()        - Print multiple files.
- */
-
-/*
- * Include necessary headers...
- */
-
-#include <cups/string-private.h>
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "phpcups.h"
-
-
-/*
- * PHP function list...
- */
-
-function_entry phpcups_functions[] =
-{
-  PHP_FE(cups_cancel_job, NULL)
-  PHP_FE(cups_get_dests, NULL)
-  PHP_FE(cups_get_jobs, NULL)
-  PHP_FE(cups_last_error, NULL)
-  PHP_FE(cups_last_error_string, NULL)
-  PHP_FE(cups_print_file, NULL)
-  PHP_FE(cups_print_files, NULL)
-  {NULL, NULL, NULL}
-};
-
-
-/*
- * PHP module info...
- */
-
-zend_module_entry phpcups_module_entry =
-{
-  STANDARD_MODULE_HEADER,
-  "phpcups",
-  phpcups_functions,
-  PHP_MINIT(phpcups),
-  NULL,
-  NULL,
-  NULL,
-  NULL,
-  CUPS_SVERSION,
-  STANDARD_MODULE_PROPERTIES
-};
-
-
-ZEND_GET_MODULE(phpcups)
-
-
-/*
- * 'cups_convert_options()' - Convert a PHP options array to a CUPS options array.
- */
-
-static int                             /* O - Number of options */
-cups_convert_options(
-    zval          *optionsobj,         /* I - Options array object */
-    cups_option_t **options)           /* O - Options */
-{
-  int          num_options;            /* Number of options */
-  HashTable    *ht;                    /* Option array hash table */
-  Bucket       *current;               /* Current element in array */
-  zval         *value;                 /* Current value in array */
-  char         temp[255];              /* String value for numbers */
-
-
-  ht          = Z_ARRVAL_P(optionsobj);
-  num_options = 0;
-
-  for (current = ht->pListHead; current; current = current->pListNext)
-  {
-    value = (zval *)current->pDataPtr;
-
-    switch (Z_TYPE_P(value))
-    {
-      case IS_LONG :
-          sprintf(temp, "%ld", Z_LVAL_P(value));
-          num_options = cupsAddOption(current->arKey, temp, num_options,
-                                     options);
-          break;
-
-      case IS_DOUBLE :
-          sprintf(temp, "%g", Z_DVAL_P(value));
-          num_options = cupsAddOption(current->arKey, temp, num_options,
-                                     options);
-          break;
-
-      case IS_BOOL :
-          num_options = cupsAddOption(current->arKey,
-                                     Z_BVAL_P(value) ? "true" : "false",
-                                     num_options, options);
-          break;
-
-      case IS_STRING :
-          num_options = cupsAddOption(current->arKey, Z_STRVAL_P(value),
-                                     num_options, options);
-          break;
-    }
-  }
-
-  return (num_options);
-}
-
-
-/*
- * 'zm_startup_phpcups()' - Initialize the CUPS module.
- */
-
-PHP_MINIT_FUNCTION(phpcups)
-{
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_LOCAL", CUPS_PRINTER_LOCAL, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_CLASS", CUPS_PRINTER_CLASS, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_REMOTE", CUPS_PRINTER_REMOTE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_BW", CUPS_PRINTER_BW, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_COLOR", CUPS_PRINTER_COLOR, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_DUPLEX", CUPS_PRINTER_DUPLEX, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_STAPLE", CUPS_PRINTER_STAPLE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_COPIES", CUPS_PRINTER_COPIES, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_COLLATE", CUPS_PRINTER_COLLATE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_PUNCH", CUPS_PRINTER_PUNCH, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_COVER", CUPS_PRINTER_COVER, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_BIND", CUPS_PRINTER_BIND, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_SORT", CUPS_PRINTER_SORT, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_SMALL", CUPS_PRINTER_SMALL, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_MEDIUM", CUPS_PRINTER_MEDIUM, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_LARGE", CUPS_PRINTER_LARGE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_VARIABLE", CUPS_PRINTER_VARIABLE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_IMPLICIT", CUPS_PRINTER_IMPLICIT, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_DEFAULT", CUPS_PRINTER_DEFAULT, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_FAX", CUPS_PRINTER_FAX, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_REJECTING", CUPS_PRINTER_REJECTING, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_DELETE", CUPS_PRINTER_DELETE, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_NOT_SHARED", CUPS_PRINTER_NOT_SHARED, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_AUTHENTICATED", CUPS_PRINTER_AUTHENTICATED, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_COMMANDS", CUPS_PRINTER_COMMANDS, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_DISCOVERED", CUPS_PRINTER_DISCOVERED, CONST_CS);
-  REGISTER_LONG_CONSTANT("CUPS_PRINTER_OPTIONS", CUPS_PRINTER_OPTIONS, CONST_CS);
-
-  REGISTER_LONG_CONSTANT("IPP_OK", IPP_OK, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_SUBST", IPP_OK_SUBST, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_CONFLICT", IPP_OK_CONFLICT, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_IGNORED_SUBSCRIPTIONS", IPP_OK_IGNORED_SUBSCRIPTIONS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_IGNORED_NOTIFICATIONS", IPP_OK_IGNORED_NOTIFICATIONS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_TOO_MANY_EVENTS", IPP_OK_TOO_MANY_EVENTS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_BUT_CANCEL_SUBSCRIPTION", IPP_OK_BUT_CANCEL_SUBSCRIPTION, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OK_EVENTS_COMPLETE", IPP_OK_EVENTS_COMPLETE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_REDIRECTION_OTHER_SITE", IPP_REDIRECTION_OTHER_SITE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_BAD_REQUEST", IPP_BAD_REQUEST, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_FORBIDDEN", IPP_FORBIDDEN, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_NOT_AUTHENTICATED", IPP_NOT_AUTHENTICATED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_NOT_AUTHORIZED", IPP_NOT_AUTHORIZED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_NOT_POSSIBLE", IPP_NOT_POSSIBLE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_TIMEOUT", IPP_TIMEOUT, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_NOT_FOUND", IPP_NOT_FOUND, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_GONE", IPP_GONE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_REQUEST_ENTITY", IPP_REQUEST_ENTITY, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_REQUEST_VALUE", IPP_REQUEST_VALUE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_DOCUMENT_FORMAT", IPP_DOCUMENT_FORMAT, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_ATTRIBUTES", IPP_ATTRIBUTES, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_URI_SCHEME", IPP_URI_SCHEME, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_CHARSET", IPP_CHARSET, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_CONFLICT", IPP_CONFLICT, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_COMPRESSION_NOT_SUPPORTED", IPP_COMPRESSION_NOT_SUPPORTED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_COMPRESSION_ERROR", IPP_COMPRESSION_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_DOCUMENT_FORMAT_ERROR", IPP_DOCUMENT_FORMAT_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_DOCUMENT_ACCESS_ERROR", IPP_DOCUMENT_ACCESS_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_ATTRIBUTES_NOT_SETTABLE", IPP_ATTRIBUTES_NOT_SETTABLE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_IGNORED_ALL_SUBSCRIPTIONS", IPP_IGNORED_ALL_SUBSCRIPTIONS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_TOO_MANY_SUBSCRIPTIONS", IPP_TOO_MANY_SUBSCRIPTIONS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_IGNORED_ALL_NOTIFICATIONS", IPP_IGNORED_ALL_NOTIFICATIONS, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_PRINT_SUPPORT_FILE_NOT_FOUND", IPP_PRINT_SUPPORT_FILE_NOT_FOUND, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_INTERNAL_ERROR", IPP_INTERNAL_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_OPERATION_NOT_SUPPORTED", IPP_OPERATION_NOT_SUPPORTED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_SERVICE_UNAVAILABLE", IPP_SERVICE_UNAVAILABLE, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_VERSION_NOT_SUPPORTED", IPP_VERSION_NOT_SUPPORTED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_DEVICE_ERROR", IPP_DEVICE_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_TEMPORARY_ERROR", IPP_TEMPORARY_ERROR, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_NOT_ACCEPTING", IPP_NOT_ACCEPTING, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_PRINTER_BUSY", IPP_PRINTER_BUSY, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_ERROR_JOB_CANCELLED", IPP_ERROR_JOB_CANCELLED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_MULTIPLE_JOBS_NOT_SUPPORTED", IPP_MULTIPLE_JOBS_NOT_SUPPORTED, CONST_CS);
-  REGISTER_LONG_CONSTANT("IPP_PRINTER_IS_DEACTIVATED", IPP_PRINTER_IS_DEACTIVATED, CONST_CS);
-
-  return (SUCCESS);
-}
-
-/*
- * 'zif_cups_cancel_job()' - Cancel a job.
- */
-
-PHP_FUNCTION(cups_cancel_job)
-{
-  char *dest;                          /* Destination */
-  int  dest_len,                       /* Length of destination */
-       id;                             /* Job ID */
-
-
-  if (ZEND_NUM_ARGS() != 2 ||
-      zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &dest, &dest_len, &id))
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  RETURN_LONG(cupsCancelJob(dest, id));
-}
-
-
-/*
- * 'zif_cups_get_dests()' - Get a list of printers and classes.
- */
-
-PHP_FUNCTION(cups_get_dests)
-{
-  int          i, j,                   /* Looping vars */
-               num_dests;              /* Number of destinations */
-  cups_dest_t  *dests,                 /* Destinations */
-               *dest;                  /* Current destination */
-  cups_option_t        *option;                /* Current option */
-  zval         *destobj,               /* Destination object */
-               *optionsobj;            /* Options object */
-
-
-  if (ZEND_NUM_ARGS() != 0)
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  if ((num_dests = cupsGetDests(&dests)) <= 0)
-  {
-    RETURN_NULL();
-  }
-
-  if (array_init(return_value) == SUCCESS)
-  {
-    for (i = 0, dest = dests; i < num_dests; i ++, dest ++)
-    {
-      MAKE_STD_ZVAL(destobj);
-
-      if (object_init(destobj) == SUCCESS)
-      {
-       /*
-        * Add properties to the destination for each of the cups_dest_t
-       * members...
-       */
-
-        add_property_string(destobj, "name", dest->name, 1);
-        add_property_string(destobj, "instance",
-                           dest->instance ? dest->instance : "", 1);
-        add_property_long(destobj, "is_default", dest->is_default);
-
-       /*
-        * Create an associative array for the options...
-       */
-
-        MAKE_STD_ZVAL(optionsobj);
-
-       if (array_init(optionsobj) == SUCCESS)
-       {
-         for (j = 0, option = dest->options;
-              j < dest->num_options;
-              j ++, option ++)
-           add_assoc_string(optionsobj, option->name, option->value, 1);
-
-         add_property_zval(destobj, "options", optionsobj);
-       }
-
-        add_index_zval(return_value, i, destobj);
-      }
-    }
-  }
-
-  cupsFreeDests(num_dests, dests);
-}
-
-
-/*
- * 'zif_cups_get_jobs()' - Get a list of jobs.
- */
-
-PHP_FUNCTION(cups_get_jobs)
-{
-  char         *dest;                  /* Destination */
-  int          dest_len,               /* Length of destination */
-               myjobs,                 /* Only show my jobs? */
-               completed;              /* Show completed jobs? */
-  int          i,                      /* Looping var */
-               num_jobs;               /* Number of jobs */
-  cups_job_t   *jobs,                  /* Jobs */
-               *job;                   /* Current job */
-  zval         *jobobj;                /* Job object */
-
-
-
-
-  if (ZEND_NUM_ARGS() != 3 ||
-      zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &dest, &dest_len, &myjobs, &completed))
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  if (!*dest)
-    dest = NULL;
-
-  if ((num_jobs = cupsGetJobs(&jobs, dest, myjobs, completed)) <= 0)
-  {
-    RETURN_NULL();
-  }
-
-  if (array_init(return_value) == SUCCESS)
-  {
-    for (i = 0, job = jobs; i < num_jobs; i ++, job ++)
-    {
-      MAKE_STD_ZVAL(jobobj);
-
-      if (object_init(jobobj) == SUCCESS)
-      {
-       /*
-        * Add properties to the job for each of the cups_job_t
-       * members...
-       */
-
-        add_property_long(jobobj, "id", job->id);
-        add_property_string(jobobj, "dest", job->dest, 1);
-        add_property_string(jobobj, "title", job->title, 1);
-        add_property_string(jobobj, "user", job->user, 1);
-        add_property_string(jobobj, "format", job->format, 1);
-        add_property_long(jobobj, "state", job->state);
-        add_property_long(jobobj, "size", job->size);
-        add_property_long(jobobj, "priority", job->priority);
-        add_property_long(jobobj, "completed_time", job->completed_time);
-        add_property_long(jobobj, "creation_time", job->creation_time);
-        add_property_long(jobobj, "processing_time", job->processing_time);
-
-        add_index_zval(return_value, i, jobobj);
-      }
-    }
-  }
-
-  cupsFreeJobs(num_jobs, jobs);
-}
-
-
-/*
- * 'zif_cups_last_error()' - Return the last IPP status code.
- */
-
-PHP_FUNCTION(cups_last_error)
-{
-  if (ZEND_NUM_ARGS() != 0)
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  RETURN_LONG(cupsLastError());
-}
-
-
-/*
- * 'zif_cups_last_error_string()' - Return the last IPP status-message.
- */
-
-PHP_FUNCTION(cups_last_error_string)
-{
-  if (ZEND_NUM_ARGS() != 0)
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  RETURN_STRING((char *)cupsLastErrorString(), 1);
-}
-
-
-/*
- * 'zif_cups_print_file()' - Print a single file.
- */
-
-PHP_FUNCTION(cups_print_file)
-{
-  char         *dest;                  /* Destination */
-  int          dest_len;               /* Length of destination */
-  char         *filename;              /* Filename */
-  int          filename_len;           /* Length of filename */
-  char         *title;                 /* Title */
-  int          title_len;              /* Length of title */
-  zval         *optionsobj;            /* Array of options */
-  int          num_options;            /* Number of options */
-  cups_option_t        *options;               /* Options */
-  int          id;                     /* Job ID */
-
-
-  if (ZEND_NUM_ARGS() != 4 ||
-      zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssa", &dest, &dest_len,
-                            &filename, &filename_len,
-                           &title, &title_len, &optionsobj))
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  num_options = cups_convert_options(optionsobj, &options);
-
-  id = cupsPrintFile(dest, filename, title, num_options, options);
-
-  cupsFreeOptions(num_options, options);
-
-  RETURN_LONG(id);
-}
-
-
-/*
- * 'zif_cups_print_files()' - Print multiple files.
- */
-
-PHP_FUNCTION(cups_print_files)
-{
-  char         *dest;                  /* Destination */
-  int          dest_len;               /* Length of destination */
-  zval         *filesobj;              /* Files array */
-  int          num_files;              /* Number of files */
-  const char   *files[1000];           /* Files */
-  char         *title;                 /* Title */
-  int          title_len;              /* Length of title */
-  zval         *optionsobj;            /* Array of options */
-  int          num_options;            /* Number of options */
-  cups_option_t        *options;               /* Options */
-  HashTable    *ht2;                   /* Option array hash table */
-  Bucket       *current;               /* Current element in array */
-  int          id;                     /* Job ID */
-
-
-  if (ZEND_NUM_ARGS() != 4 ||
-      zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sasa", &dest, &dest_len, &filesobj,
-                           &title, &title_len, &optionsobj))
-  {
-    WRONG_PARAM_COUNT;
-  }
-
-  ht2       = Z_ARRVAL_P(filesobj);
-  num_files = 0;
-
-  for (current = ht2->pListHead; current; current = current->pListNext)
-  {
-    files[num_files ++] = Z_STRVAL_P(((zval *)current->pDataPtr));
-
-    if (num_files >= (int)(sizeof(files) / sizeof(files[0])))
-      break;
-  }
-
-  num_options = cups_convert_options(optionsobj, &options);
-
-  id = cupsPrintFiles(dest, num_files, files, title, num_options, options);
-
-  cupsFreeOptions(num_options, options);
-
-  RETURN_LONG(id);
-}
-
diff --git a/scripting/php/phpcups.h b/scripting/php/phpcups.h
deleted file mode 100644 (file)
index 36ca1d5..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *   PHP module include file for CUPS.
- *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "COPYING"
- *   which should have been included with this file.
- */
-
-#ifndef PHPCUPS_H
-#  define PHPCUPS_H
-
-/*
- * Include necessary headers...
- */
-
-#  include <cups/cups.h>
-#  include <cups/language.h>
-#  include <cups/debug-private.h>
-#  include <fcntl.h>
-#  include <sys/stat.h>
-#  if defined(WIN32) || defined(__EMX__)
-#    include <io.h>
-#  else
-#    include <unistd.h>
-#  endif /* WIN32 || __EMX__ */
-
-
-/*
- * Zend definitions...
- */
-
-extern zend_module_entry       phpcups_module_entry;
-#  define phpext_phpcups_ptr   &phpcups_module_entry
-
-#  ifdef PHP_WIN32
-#    define PHP_PHPCUPS_API    __declspec(dllexport)
-#  else
-#    define PHP_PHPCUPS_API
-#  endif
-
-#  ifdef ZTS
-#    include "TSRM.h"
-#  endif
-
-PHP_MINIT_FUNCTION(phpcups);
-
-PHP_FUNCTION(cups_cancel_job);
-PHP_FUNCTION(cups_get_dests);
-PHP_FUNCTION(cups_get_jobs);
-PHP_FUNCTION(cups_last_error);
-PHP_FUNCTION(cups_last_error_string);
-PHP_FUNCTION(cups_print_file);
-PHP_FUNCTION(cups_print_files);
-
-#endif /* !PHPCUPS_H */
-
diff --git a/scripting/php/phpcups.php b/scripting/php/phpcups.php
deleted file mode 100755 (executable)
index 0386e8d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/php -f
-<?
-//
-//   PHP test script for CUPS.
-//
-//   Copyright 2007-2011 by Apple Inc.
-//   Copyright 1997-2006 by Easy Software Products, all rights reserved.
-//
-//   These coded instructions, statements, and computer programs are the
-//   property of Apple Inc. and are protected by Federal copyright
-//   law.  Distribution and use rights are outlined in the file "COPYING"
-//   which should have been included with this file.
-//
-
-// Make sure the module is loaded...
-if(!extension_loaded("phpcups"))
-{
-  dl("phpcups.so");
-}
-
-// Get the list of functions in the module...
-$module    = "phpcups";
-$functions = get_extension_funcs($module);
-
-print("Functions available in the $module extension:\n");
-
-foreach ($functions as $func)
-{
-  print("$func\n");
-}
-
-print("\n");
-
-print("cups_get_dests:\n");
-print_r(cups_get_dests());
-
-print("cups_get_jobs(\"\", 0, -1):\n");
-print_r(cups_get_jobs("", 0, -1));
-
-print("cups_print_file(\"test\", \"../../test/testfile.jpg\", "
-     ."\"testfile.jpg\", ...):\n");
-print_r(cups_print_file("test", "../../test/testfile.jpg", "testfile.jpg",
-                        array("scaling" => "100",
-                             "page-label" => "testfile.jpg")));
-
-print("cups_print_files(\"test\", array(\"../../test/testfile.jpg\", "
-     ."\"../../test/testfile.ps\"), \"testfiles\", ...):\n");
-print_r(cups_print_files("test", array("../../test/testfile.jpg",
-                                       "../../test/testfile.ps"),
-                         "testfiles",
-                         array("scaling" => "100",
-                              "page-label" => "testfile.jpg")));
-
-?>