lp.c revision 179184d3e9bc6ab146407a62a8461338687b1908
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A/* $Id: lp.c 179 2006-07-17 18:24:07Z njacobs $ */ 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A#
endif /* HAVE_LIBMAGIC */ 2N/A gettext(
"Usage: %s [-c] [-m] [-p] [-s] [-w] [-d destination] " 2N/A "[-f form-name] [-H special-handling] [-n number] " 2N/A "[-o option] [-P page-list] [-q priority-level] " 2N/A "[-S character-set | print-wheel] [-t title] [-v] " 2N/A "[-T content-type [-r]] [-y mode-list] [file...]\n"),
2N/A case 'H':
/* handling */ 2N/A "job-hold-until",
"indefinite");
2N/A "job-hold-until",
"no-hold");
2N/A "job-priority",
100);
2N/A case 'P':
/* page list */ 2N/A case 'S':
/* charset */ 2N/A case 'T':
/* type */ 2N/A case 'D':
/* dump */ 2N/A case 'c':
/* copy */ 2N/A case 'd':
/* destination */ 2N/A case 'f':
/* form */ 2N/A case 'i':
/* modify job */ 2N/A case 'm':
/* mail when complete */ 2N/A "rfc-1179-mail",
1);
2N/A case 'n':
/* copies */ 2N/A case 'o':
/* lp "options" */ case 'p':
/* Solaris - notification */ case 'q': {
/* priority */ i =
99 * (
39 - i) /
39 +
1;
if ((i <
1) || (i >
100)) {
"priority must be between 0 and 39.\n"));
case 'r':
/* "raw" mode */ case 's':
/* suppress message */ case 'y':
/* lp "modes" */ /* convert "banner", "nobanner" to "job-sheet" */ /* get the mime type of the file data */ "job-sheets",
"standard");
"Failed to contact service for %s: %s\n"),
printer,
else if (
optind ==
ac)
/* no file list, use stdin */ else if (
validate ==
1)
/* validate the request can be processed */ else if (
copy == 0)
/* reference the files in the job, default */ else /* copy the files before return, -c */