/*
- * "$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>
/*
#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;
{
_cupsLangPrintf(stderr,
_("%s: Error - expected username after "
- "\'-U\' option!\n"),
- argv[0]);
+ "\"-U\" option."), argv[0]);
return (1);
}
{
_cupsLangPrintf(stderr,
_("%s: Error - expected hostname after "
- "\'-H\' option!\n"),
- argv[0]);
+ "\"-H\" option."), argv[0]);
return (1);
}
else
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);
}
}
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;
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);
}
{
_cupsLangPrintf(stderr,
_("%s: Error - expected destination after "
- "\'-P\' option!\n"),
- argv[0]);
+ "\"-P\" option."), argv[0]);
return (1);
}
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);
}
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);
}
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)
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);
}
}
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...
*/
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);
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);
}
if (job_id < 1)
{
- _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString());
+ _cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
return (1);
}
/*
- * 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 $".
*/