]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - berkeley/lpr.c
Merge changes from CUPS 1.5svn-r9641
[thirdparty/cups.git] / berkeley / lpr.c
index a1388be7e1c34b8f65d828ef08510fd2e5ac725b..b71f54fed14306088d8668a71e2657eb49d41a3e 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: lpr.c 7170 2008-01-04 02:21:30Z mike $"
+ * "$Id: lpr.c 7720 2008-07-11 22:46:21Z mike $"
  *
- *   "lpr" command for the Common UNIX Printing System (CUPS).
+ *   "lpr" command for CUPS.
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2011 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  * Include necessary headers...
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <cups/string.h>
-#include <cups/cups.h>
-#include <cups/i18n.h>
+#include <cups/cups-private.h>
 
 
 /*
@@ -73,8 +67,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
 #ifdef HAVE_SSL
            cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
 #else
-            _cupsLangPrintf(stderr,
-                           _("%s: Sorry, no encryption support compiled in!\n"),
+            _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."),
                            argv[0]);
 #endif /* HAVE_SSL */
            break;
@@ -89,8 +82,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
              {
                _cupsLangPrintf(stderr,
                                _("%s: Error - expected username after "
-                                 "\'-U\' option!\n"),
-                               argv[0]);
+                                 "\"-U\" option."), argv[0]);
                return (1);
              }
 
@@ -109,8 +101,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
              {
                _cupsLangPrintf(stderr,
                                _("%s: Error - expected hostname after "
-                                 "\'-H\' option!\n"),
-                               argv[0]);
+                                 "\"-H\" option."), argv[0]);
                return (1);
               }
              else
@@ -131,8 +122,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if (i >= argc)
              {
                _cupsLangPrintf(stderr,
-                               _("%s: Error - expected value after \'-%c\' "
-                                 "option!\n"), argv[0], ch);
+                               _("%s: Error - expected value after \"-%c\" "
+                                 "option."), argv[0], ch);
                return (1);
              }
            }
@@ -145,8 +136,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
        case 't' : /* Troff */
        case 'v' : /* Raster image */
            _cupsLangPrintf(stderr,
-                           _("%s: Warning - \'%c\' format modifier not "
-                             "supported - output may not be correct!\n"),
+                           _("%s: Warning - \"%c\" format modifier not "
+                             "supported - output may not be correct."),
                            argv[0], ch);
            break;
 
@@ -159,9 +150,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if (i >= argc)
              {
                _cupsLangPrintf(stderr,
-                               _("%s: error - expected option=value after "
-                                 "\'-o\' option!\n"),
-                               argv[0]);
+                               _("%s: Error - expected option=value after "
+                                 "\"-o\" option."), argv[0]);
                return (1);
              }
 
@@ -217,8 +207,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
              {
                _cupsLangPrintf(stderr,
                                _("%s: Error - expected destination after "
-                                 "\'-P\' option!\n"),
-                               argv[0]);
+                                 "\"-P\" option."), argv[0]);
                return (1);
              }
 
@@ -248,9 +237,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if (i >= argc)
              {
                _cupsLangPrintf(stderr,
-                               _("%s: Error - expected copy count after "
-                                 "\'-#\' option!\n"),
-                               argv[0]);
+                               _("%s: Error - expected copies after "
+                                 "\"-#\" option."), argv[0]);
                return (1);
              }
 
@@ -272,8 +260,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if (i >= argc)
              {
                _cupsLangPrintf(stderr,
-                               _("%s: Error - expected name after \'-%c\' "
-                                 "option!\n"), argv[0], ch);
+                               _("%s: Error - expected name after \"-%c\" "
+                                 "option."), argv[0], ch);
                return (1);
              }
 
@@ -283,8 +271,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
        default :
            _cupsLangPrintf(stderr,
-                           _("%s: Error - unknown option \'%c\'!\n"),
-                           argv[0], argv[i][1]);
+                           _("%s: Error - unknown option \"%c\"."), argv[0],
+                           argv[i][1]);
            return (1);
       }
     else if (num_files < 1000)
@@ -296,7 +284,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       if (access(argv[i], R_OK) != 0)
       {
         _cupsLangPrintf(stderr,
-                       _("%s: Error - unable to access \"%s\" - %s\n"),
+                       _("%s: Error - unable to access \"%s\" - %s"),
                        argv[0], argv[i], strerror(errno));
         return (1);
       }
@@ -314,8 +302,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
     }
     else
       _cupsLangPrintf(stderr,
-                      _("%s: Error - too many files - \"%s\"\n"),
-                     argv[0], argv[i]);
+                      _("%s: Error - too many files - \"%s\"."), argv[0],
+                     argv[i]);
  /*
   * See if we have any files to print; if not, print from stdin...
   */
@@ -354,15 +342,14 @@ main(int  argc,                           /* I - Number of command-line arguments */
     if (printer && !cupsGetNamedDest(NULL, printer, NULL))
       _cupsLangPrintf(stderr,
                       _("%s: Error - %s environment variable names "
-                       "non-existent destination \"%s\"!\n"),
-                     argv[0], val, printer);
+                       "non-existent destination \"%s\"."), argv[0], val,
+                     printer);
     else if (cupsLastError() == IPP_NOT_FOUND)
       _cupsLangPrintf(stderr,
-                      _("%s: Error - no default destination available.\n"),
+                      _("%s: Error - no default destination available."),
                      argv[0]);
     else
-      _cupsLangPrintf(stderr,
-                      _("%s: Error - scheduler not responding!\n"),
+      _cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."),
                      argv[0]);
 
     return (1);
@@ -406,8 +393,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     if (status != HTTP_CONTINUE)
     {
-      _cupsLangPrintf(stderr,
-                     _("%s: Error - unable to queue from stdin - %s\n"),
+      _cupsLangPrintf(stderr, _("%s: Error - unable to queue from stdin - %s."),
                      argv[0], httpStatus(status));
       return (1);
     }
@@ -418,7 +404,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   if (job_id < 1)
   {
-    _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString());
+    _cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
     return (1);
   }
 
@@ -427,5 +413,5 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: lpr.c 7170 2008-01-04 02:21:30Z mike $".
+ * End of "$Id: lpr.c 7720 2008-07-11 22:46:21Z mike $".
  */