printer.c revision 355b4669e025ff377602b6fc7caaf30dbc218371
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <locale.h>
#include "stdio.h"
#include "string.h"
#include "errno.h"
#include "stdlib.h"
#include "lp.h"
#include "printers.h"
#include "msgs.h"
#define WHO_AM_I I_AM_LPSTAT
#include "oam.h"
#include "lpstat.h"
SCALED *);
static void printallowdeny(FILE *, int, char **, char **);
static void printpwheels(PRINTER *, char *);
#define USERS_AD 0
#define FORMS_AD 1
/*
* do_printer()
*/
void
do_printer(char **list)
{
while (*list) {
(void) output(R_INQUIRE_PRINTER_STATUS);
} else {
switch (output(R_INQUIRE_PRINTER_STATUS)) {
case MNODEST:
exit_rc = 1;
break;
}
}
list++;
}
}
/*
* putpline() - DISPLAY STATUS OF PRINTER
*/
void
char *character_set)
{
char **u_allow = 0,
**u_deny = 0,
**f_allow = 0,
**f_deny = 0,
**pt;
char enable_date[SZ_DATE_BUFF];
int multi_type;
done(1);
}
/*
* if (prbufp->login)
* printf(gettext(" (login terminal)"));
*/
if (printer_status & PS_FAULTED) {
if (printer_status & PS_BUSY)
"printer %s faulted printing %s."),
else
printer);
} else if (printer_status & PS_BUSY)
else
} else if (printer_status & PS_DISABLED)
else if (printer_status & PS_LATER)
}
else
}
register char *sep = " ";
if (sep[0] == '|')
printf("\n");
char *ptrForm, *ptrEndForm;
int trayNum;
if (*(ptrEndForm+1)) {
trayNum = 1;
while (ptrEndForm) {
*ptrEndForm = 0;
}
} else {
*ptrEndForm = 0;
}
if (prbufp->input_types) {
}
printf("\n");
if (prbufp->printer_types) {
} else
printf("\n");
gettext(NAME_DIRECT)));
} else {
}
}
if (is_user_admin()) {
printf("\t");
}
gettext(NAME_CONTINUE)));
}
case BAN_ALWAYS:
break;
case BAN_OPTIONAL:
break;
case BAN_NEVER:
break;
}
} else {
}
if (multi_type)
else
else {
}
printf("\n");
if (multi_type)
*pt);
else
printf("\n");
}
printf("\n");
}
printf("\n");
}
}
printf("\n");
}
}
/*
* figure_pitch_size() - CALCULATE *REAL* DEFAULT PITCH, PAGE SIZE
*/
static void
{
short orc,
orhi,
orl,
orvi,
cols,
/*
* The user want's to know how the page will look if
* he or she uses this printer. Thus, if the administrator
* hasn't set any defaults, figure out what they are from
* the Terminfo entry.
*/
return;
/*
* NOTE: We should never get a failure return unless
* someone has trashed the printer configuration file.
* Also, if we don't fail the first time, we can't fail
* subsequently.
*/
return;
}
}
}
}
}
/*
*/
static void
{
printlist_setup("\t\t", 0, 0, 0);
else
else
} else {
else
}
}
/*
* printpwheels() - PRINT LIST OF PRINT WHEELS
*/
static void
{
register char **list;
register int mount_in_list = 0,
something_shown = 0;
while (*list) {
mount_in_list = 1;
}
printf("\n");
list++;
something_shown = 1;
}
something_shown = 1;
}
if (!something_shown)
}
/*
* printsets() - PRINT LIST OF CHARACTER SETS, WITH MAPPING
*/
static void
{
*cp;
char **tlist = 0;
/*
* We'll report the administrator defined character set aliases
* and any OTHER character sets we find in the Terminfo database.
*/
return;
}
if (alist)
while (*alist) {
if (cp)
*cp++ = 0;
/*
* Remove the alias from the Terminfo list so
* we don't report it twice.
*/
done(1);
}
if (cp)
else
alist++;
}
if (tlist)
while (*tlist)
}
/*
* if the msg is in the format:
* Warning: <printer> is down: <reason>\n
* break it up and reprint it out so we can do it in the users language.
*/
static int
{
char *dup, *p;
return (0);
return (0);
}
return (0);
}
return (0);
}
p += 6;
if (*p == NULL) {
return (0);
}
*(p + (strlen(p) - 1)) = 0;
putchar('\t');
return (1);
}