]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/lp.c
Import CUPS 1.4svn-r7153.
[thirdparty/cups.git] / systemv / lp.c
index f9b90836a5f5218b69ece16cef985f23a1ad9065..9c886ae3c60691c5c2ae0557cb5a78d52b7298c7 100644 (file)
@@ -73,9 +73,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
   int          num_copies;             /* Number of copies per file */
   int          num_files;              /* Number of files to print */
   const char   *files[1000];           /* Files to print */
-  int          num_dests;              /* Number of destinations */
-  cups_dest_t  *dests,                 /* Destinations */
-               *dest;                  /* Selected destination */
+  cups_dest_t  *dest;                  /* Selected destination */
   int          num_options;            /* Number of options */
   cups_option_t        *options;               /* Options */
   int          end_options;            /* No more options? */
@@ -112,8 +110,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   silent      = 0;
   printer     = NULL;
-  num_dests   = 0;
-  dests       = NULL;
+  dest        = NULL;
   num_options = 0;
   options     = NULL;
   num_files   = 0;
@@ -179,10 +176,7 @@ main(int  argc,                            /* I - Number of command-line arguments */
             if ((instance = strrchr(printer, '/')) != NULL)
              *instance++ = '\0';
 
-           if (num_dests == 0)
-             num_dests = cupsGetDests(&dests);
-
-            if ((dest = cupsGetDest(printer, instance, num_dests, dests)) != NULL)
+            if ((dest = cupsGetNamedDest(NULL, printer, instance)) != NULL)
            {
              for (j = 0; j < dest->num_options; j ++)
                if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
@@ -593,10 +587,7 @@ main(int  argc,                            /* I - Number of command-line arguments */
 
   if (printer == NULL)
   {
-    if (num_dests == 0)
-      num_dests = cupsGetDests(&dests);
-
-    if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) != NULL)
+    if ((dest = cupsGetNamedDest(NULL, NULL, NULL)) != NULL)
     {
       printer = dest->name;
 
@@ -625,7 +616,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       val = "LPDEST";
 
-    if (printer && !cupsGetDest(printer, NULL, num_dests, dests))
+    if (printer && !cupsGetNamedDest(NULL, printer, NULL))
       _cupsLangPrintf(stderr,
                      _("%s: Error - %s environment variable names "
                        "non-existent destination \"%s\"!\n"),