diff options
Diffstat (limited to 'print/cups/patches/patch-ak')
-rw-r--r-- | print/cups/patches/patch-ak | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/print/cups/patches/patch-ak b/print/cups/patches/patch-ak new file mode 100644 index 00000000000..0b9966db857 --- /dev/null +++ b/print/cups/patches/patch-ak @@ -0,0 +1,96 @@ +$NetBSD: patch-ak,v 1.13 2010/06/05 23:09:29 sbd Exp $ + +Incorporate +usb-backend-both-usblp-and-libusb.dpatch by <till.kamppeter@gmail.com> +http://www.cups.org/str.php?L3357 + +--- backend/usb-hybrid.c.orig 2010-06-05 02:02:53.089601743 +0000 ++++ backend/usb-hybrid.c +@@ -0,0 +1,87 @@ ++/* ++ * "Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike " ++ * ++ * USB port backend for the Common UNIX Printing System (CUPS). ++ * ++ * This file is included from "usb.c" when compiled on Linux. ++ * ++ * Copyright 2007-2008 by Apple Inc. ++ * Copyright 1997-2007 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 "LICENSE.txt" ++ * "LICENSE" which should have been included with this file. If this ++ * file is missing or damaged, see the license at "http://www.cups.org/". ++ * ++ * This file is subject to the Apple OS-Developed Software exception. ++ * ++ * Contents: ++ * ++ * print_device() - Print a file to a USB device. ++ * list_devices() - List all USB devices. ++ */ ++ ++/* ++ * Include necessary headers. ++ */ ++ ++#include <sys/select.h> ++ ++/* ++ * Include the two USB implementations used under Linux ... ++ */ ++ ++#include "usb-libusb.c" ++#include "usb-unix.c" ++ ++/* ++ * 'print_device()' - Print a file to a USB device. ++ */ ++ ++int /* O - Exit status */ ++print_device(const char *uri, /* I - Device URI */ ++ const char *hostname, /* I - Hostname/manufacturer */ ++ const char *resource, /* I - Resource/modelname */ ++ char *options, /* I - Device options/serial number */ ++ int print_fd, /* I - File descriptor to print */ ++ int copies, /* I - Copies to print */ ++ int argc, /* I - Number of command-line arguments (6 or 7) */ ++ char *argv[]) /* I - Command-line arguments */ ++{ ++ int result; ++ for(;;) ++ { ++ result = print_device_unix(uri, hostname, resource, options, print_fd, ++ copies, argc, argv); ++ if (result == -1) ++ { ++ result = print_device_libusb(uri, hostname, resource, options, print_fd, ++ copies, argc, argv); ++ if (result == -1) ++ sleep(5); ++ else ++ return(result); ++ } ++ else ++ return(result); ++ } ++} ++ ++/* ++ * 'list_devices()' - List all USB devices. ++ */ ++ ++void ++list_devices(void) ++{ ++ /* Try both discovery methods, each device will appear only under one ++ of them */ ++ list_devices_libusb(); ++ list_devices_unix(); ++} ++ ++ ++/* ++ * End of "Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike ". ++ */ |