do_mount.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1993 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.9 */
#include "stdio.h"
#include "string.h"
#include "lp.h"
#include "msgs.h"
#include "printers.h"
#include "form.h"
#include "access.h"
#define WHO_AM_I I_AM_LPADMIN
#include "oam.h"
#include "lpadmin.h"
void mount_unmount();
short printer_status;
static char *cur_pwheel;
char *disable_reason,
static void inquire_printer_status();
/**
** do_mount() - MOUNT/UNMOUNT A FORM/PRINT-WHEEL
**/
char *printer,
*form,
*pwheel;
{
/*
* Take care of unmounts, first.
*/
form = "";
pwheel = "";
form = 0;
pwheel = 0;
form = 0;
pwheel = 0;
}
return;
/*
* See if the form will work on the printer. We do this even if
* the form has already been allowed, just in case the form has
* changed since then. Also, the check reads the form definition
* into a global that we can use for subsequent checks.
*/
if (!s) { /* a local printer */
switch (verify_form(form)) {
case -1:
break;
case -2:
done (1);
}
/*
* Is the form allowed on the printer?
*/
/*
* Does the printer take print wheels?
* For us to be here, "daisy" must have been set.
* (-S requires knowing printer type (T), and knowing
* T caused call to "tidbit()" to set "daisy").
*/
done (1);
}
/*
* If the form requires a particular print wheel, make sure
* it is either mounted already, or is being mounted now.
*/
/*
* The printer status is also needed for "do_align()".
*/
/*
* The "!daisy" case was investigated in "verify_form()".
*/
);
);
}
}
/*
* Is the print wheel listed for this printer?
* The information that will tell us is either in the
* original info. we read in ("oldp->char_sets") if this
* is an existing printer, or--if this is a new printer--we
* don't have it (ambiguous -S options, mate!)
*/
if (
&& *pwheel
&& !(
)
)
}
/*
* Do the mount with the printing of the alignment pattern,
* if required and possible. Otherwise, just mount the form
* (and print-wheel).
*/
return;
}
int type;
char *printer,
*form,
*pwheel;
{
int rc;
if (t) { /* tray specified */
} else
switch(rc) {
case MOK:
break;
case MNOMEDIA:
done (1);
/*NOTREACHED*/
case MNODEST:
done (1);
/*NOTREACHED*/
case MBUSY:
done (1);
/*NOTREACHED*/
case MNOTRAY:
done (1);
/*NOTREACHED*/
case MNOPERM: /* taken care of up front */
default:
done (1);
/*NOTREACHED*/
}
return;
}
void
do_max_trays(char *printer)
{
int rc;
if (t) /* tray specified */
switch(rc) {
case MOK:
break;
case MNOMEDIA:
done (1);
/*NOTREACHED*/
case MNODEST:
done (1);
/*NOTREACHED*/
case MBUSY:
done (1);
/*NOTREACHED*/
case MNOTRAY:
done (1);
/*NOTREACHED*/
case MNOPERM: /* taken care of up front */
default:
done (1);
/*NOTREACHED*/
}
return;
}
/**
** inquire_printer_status()
**/
static void inquire_printer_status (printer)
char *printer;
{
short status;
char *s_ignore,
long l_ignore;
done (1);
}
(void)getmessage (
&status,
&s_ignore,
&s_ignore,
&s_ignore,
&l_ignore,
);
switch (status) {
case MOK:
break;
case MNODEST:
done (1);
}
return;
}