init.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 1998 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.10.1.8 */
#include "lpsched.h"
#include <syslog.h>
int CT_Size,
ET_SlowSize = 1,
ET_NotifySize = 1,
/*
**
** CLRMEM clears memory pointed to by <addr> over the range of
** <addr>[<cnt> .. <size>]. <datum> is the size of an element of <addr>.
**
*/
#define ACLUSTERSIZE 10
static void init_printers(),
init_classes(),
init_forms(),
init_pwheels(),
init_exec();
static RSTATUS *init_requests();
void
init_memory(void)
{
init_classes();
init_forms();
init_pwheels();
init_exec();
/*
* Load the status after the basic structures have been loaded,
* but before loading requests still in the queue. This is so
* the requests can be compared against accurate status information
* (except rejection status--accept the jobs anyway).
*/
load_status();
}
static void
{
PRINTER *p;
int pt_allocation;
int at_allocation;
int PT_Count;
int i;
char **paperDenied;
PT_Size = 10;
PT_Count = 0;
if (!p)
continue;
if (p->remote) /* this is remote, ignore it */
continue;
*pt_pointer = *p;
pt_pointer++;
continue;
PT_Size += 10;
}
for (i = 0; i < PT_Size; i++)
{
char buf[15];
if (i < PT_Count)
{
p->name,
&(psp->users_allowed),
&(psp->users_denied)
);
p->name,
&(psp->forms_allowed),
&(psp->forms_denied)
);
p->name,
&psp->paper_allowed,
);
}
}
}
static void
{
CLASS *p;
int ct_allocation;
int CT_Count;
int i;
CT_Size = 10;
CT_Count = 0;
{
if (!p)
continue;
*ct_pointer = *p;
ct_pointer++;
continue;
CT_Size += 10;
}
for (i = 0; i < CT_Size; i++)
}
static void
{
*f;
int at_allocation;
int ft_allocation;
int FT_Count;
int i;
FT_Size = 10;
FT_Count = 0;
ft_pointer->np = 0;
ft_pointer->mandatory = 0;
ft_pointer->alert.Q = 0;
ft_pointer->alert.W = 0;
ft_pointer->isDefault = 0;
ft_pointer++;
FT_Count++;
*(ft_pointer++) = *f;
continue;
FT_Size += 10;
}
for (i = 0; i < FT_Size; i++) {
char buf[15];
if (i < FT_Count) {
Form_Table[i].name,
&(FStatus[i].users_allowed),
&(FStatus[i].users_denied)
);
}
}
/* for BSD_FORM, make sure it denies no one */
}
static void
{
PWHEEL *p;
int at_allocation;
int pwt_allocation;
int PWT_Count;
int i;
PWT_Count = 0;
PWT_Size = 10;
{
if (!p)
continue;
*pwt_pointer = *p;
pwt_pointer++;
continue;
PWT_Size += 10;
}
for (i = 0; i < PWT_Size; i++)
{
char buf[15];
}
}
static RSTATUS *
init_requests(void)
{
REQUEST *r;
SECURE *s;
char *name;
char *sysdir;
char *sysname;
int count;
int i;
long addr = -1;
long sysaddr = -1;
unsigned long size;
short vr_ret;
size = 20;
count = 0;
continue;
}
freesecure(s);
continue;
}
{
continue;
}
/*
* So far, the only way RS_NOTIFY can be set without there
* being a notification file containing the message to the
* user, is if the request was cancelled. This is because
* cancelling a request does not cause the creation of the
* message if the request is currently printing or filtering.
* (The message is created after the child process dies.)
* Thus, we know what to say.
*
* If this behaviour changes, we may have to find another way
* of determining what to say in the message.
*/
if (!(r->outcome & RS_CANCELLED)) {
continue;
}
}
}
/* fix for bugid 1103709. if validate_request returns
* MNODEST, then the printer for the request doesn't exist
* anymore! E.g. lpadmin -x was issued, and the request
* hasn't been cleaned up. In this case, the "printer"
* element of table[] will be NULL, and cancel will
* core dump! So we clean this up here.
*/
/*
* Well actually this happens with MDENYDEST too. The real problem
* is if the printer is NULL, so test for it
*/
continue;
}
}
continue;
size += 20;
}
sysaddr = -1;
}
if (!count)
else
(int (*)(const void * , const void *))rsort);
for (i = 0; i < size - 1; i++) {
}
}
return(rp);
}
static void
{
int et_allocation;
int i;
+ PWT_Size
+ FT_Size;
for (i = 0; i < ET_SlowSize; i++)
for (i = 0; i < ET_NotifySize; i++)
for (i = 0; i < PT_Size; i++) {
et_pointer++;
et_pointer++;
et_pointer++;
}
for (i = 0; i < PWT_Size; i++) {
et_pointer++;
}
for (i = 0; i < FT_Size; i++) {
et_pointer++;
}
}