/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include "dispatch.h"
#include <syslog.h>
#include <time.h>
/*
* untidbit_all() - CALL untidbit() FOR A LIST OF TYPES
*/
static void
{
char ** pl;
return;
}
/*
* s_load_printer()
*/
void
{
char *printer;
char **paperDenied;
if (!*printer)
/* no printer */
/* Strange or missing printer? */
switch (errno) {
case EBADF:
break;
case ENOENT:
default:
break;
}
/* Printer we know about already? */
/*
* Ensure that an old Terminfo type that's no longer
* needed gets freed, and that an existing type gets
* reloaded (in case it has been changed).
*/
/*
* Does an alert get affected?
* - Different command?
* - Different wait interval?
*/
/*
* We can't use "cancel_alert()" here
* because it will remove the message.
* We'll do half of the cancel, then
* check if we need to run the new alert,
* and remove the message if not.
*/
(char *)0);
else
}
freeprinter (op);
&pps->users_denied);
&pps->forms_denied);
&paperDenied);
pps->last_dial_rc = 0;
/*
* Evaluate all requests queued for this printer,
* to make sure they are still eligible. They will
* get moved to another printer, get (re)filtered,
* or get canceled.
*/
/* don't really load a remote printer */
dump_pstatus ();
} else {
freeprinter (pp);
}
return;
}
/*
* s_unload_printer()
*/
static void
{
int i;
/*
* Remove this printer from the classes it may be in.
* This is likely to be redundant, i.e. upon deleting
* a printer the caller is SUPPOSED TO check all the
* classes; any that contain the printer will be changed
* and we should receive a S_LOAD_CLASS message for each
* to reload the class.
*
* HOWEVER, this leaves a (small) window where someone
* can sneak a request in destined for the CLASS. If
* we have deleted the printer but still have it in the
* class, we may have trouble!
*/
/*
* this is removed from the PStatus table by the caller
* list_remove((void ***)&PStatus, (void *)pps);
*/
return;
}
void
{
char *printer;
/* Unload ALL printers */
if (!Request_List)
/* If we have ANY requests queued, we can't do it. */
else {
int i;
_unload_printer (PStatus[i]);
}
/* Have we seen this printer before */
else {
/*
* Note: This routine WILL MOVE requests to another
* printer. It will not stop until it has gone through
* the entire list of requests, so all requests that
* can be moved will be moved. If any couldn't move,
* however, we don't unload the printer.
*/
else
}
}
dump_pstatus ();
return;
}
/*
* combineReasons()
*/
static char *
{
*freeReason = 1;
else {
if (reason)
/* memory allocation failed part way through */
*freeReason = 0;
}
} else {
*freeReason = 0;
}
return (reason);
}
static void
{
char freeReason = 0;
if (formList)
if (freeReason)
}
/*
* s_inquire_printer_status()
*/
void
{
char *printer;
/* inquire about all printers */
int i;
}
} else
/* inquire about a specific printer */
if (pps)
else {
"", 0, "", 0L, 0L);
}
}
/*
* s_load_class()
*/
void
{
char *class;
if (!*class)
/* no class defined */
/* Strange or missing class */
switch (errno) {
case EBADF:
break;
case ENOENT:
default:
break;
}
/* Class we already know about */
/*
* Here we go through the list of requests
* to see who gets affected.
*/
/*
* If not still eligible for this class...
*/
case MOK:
case MERRDEST: /* rejecting (shouldn't happen) */
break;
case MDENYDEST:
case MNOMOUNT:
case MNOMEDIA:
case MNOFILTER:
default:
/*
* ...then too bad!
*/
break;
}
}
/* Room for new class? */
dump_cstatus ();
} else {
}
return;
}
/*
* s_unload_class()
*/
static void
{
return;
}
void
{
char *class;
/*
* Unload ALL classes?
*/
int i;
/*
* If we have a request queued for a member of ANY
* class, we can't do it.
*/
break;
}
}
_unload_class (CStatus[i]);
}
/*
* Have we seen this class before?
*/
/*
* Is there even one request queued for this class?
* If not, we can safely remove it.
*/
else {
break;
}
_unload_class (pcs);
}
}
dump_cstatus ();
return;
}
/*
* s_inquire_class()
*/
void
{
char *class;
/* inquire about ALL classes */
int i;
}
} else
/* inquire about a single class */
if (pcs)
else
return;
}
/*
* s_paper_allowed()
*/
void
{
char *printer;
/* inquire about ALL printers */
int i;
if (paperList)
}
}
} else
/* inquire about a specific printer */
if (pps) {
if (paperList)
} else {
}
}