]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/backend.c
Merge changes from CUPS 1.4svn-r7715.
[thirdparty/cups.git] / cups / backend.c
index f846a2a3a7073ed55dae0b854855d6e9c8ee13b0..021dad2e21ce3adfb72f7c2f85516ee76592a1da 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id$"
+ * "$Id: backend.c 7583 2008-05-16 17:47:16Z mike $"
  *
  *   Backend functions for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  *   This file is subject to the Apple OS-Developed Software exception.
  *
@@ -34,7 +25,7 @@
 
 #include <stdlib.h>
 #include "backend.h"
-#include "string.h"
+#include "globals.h"
 
 
 /*
  * first.
  */
 
-const char *                           /* O - Device URI or NULL */
+const char *                           /* O - Device URI or @code NULL@ */
 cupsBackendDeviceURI(char **argv)      /* I - Command-line arguments */
 {
   const char   *device_uri;            /* Device URI */
+  _cups_globals_t *cg = _cupsGlobals();        /* Global info */
+
 
+  if ((device_uri = getenv("DEVICE_URI")) == NULL)
+  {
+    if (!argv || !argv[0] || !strchr(argv[0], ':'))
+      return (NULL);
 
-  if ((device_uri = getenv("DEVICE_URI")) != NULL)
-    return (device_uri);
+    device_uri = argv[0];
+  }
 
-  if (!argv || !argv[0] || !strchr(argv[0], ':'))
-    return (NULL);
-  else
-    return (argv[0]);
+  return (_httpResolveURI(device_uri, cg->resolved_uri,
+                          sizeof(cg->resolved_uri), 1));
 }
 
 
 /*
- * End of "$Id$".
+ * End of "$Id: backend.c 7583 2008-05-16 17:47:16Z mike $".
  */