fncs.c revision 19d32b9ab53d17ac6605971e14c45a5281f8d9bb
/*
* 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 */
/* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
#include "unistd.h"
#include "errno.h"
#include "fcntl.h"
#include "stdlib.h"
#include "string.h"
#include "lpsched.h"
static int __list_increment = 16;
int
{
int count;
return (-1);
}
sizeof (void *));
return (-1);
return (-1);
}
}
return (0);
}
void
{
int i, count;
return;
;
if (count > 0) {
/* copy up to item */
/* copy after item */
}
/* replace the list */
}
}
void
{
}
}
EXEC *
{
switch (type) {
case EX_ALERT:
case EX_INTERF:
case EX_FAULT_MESSAGE:
break;
case EX_FALERT:
break;
case EX_PALERT:
break;
case EX_SLOWF:
case EX_NOTIFY:
break;
}
}
return (result);
}
void
{
}
}
ALERT *
{
char buf[15];
}
return (result);
}
void
{
}
}
void
{
char **paperDenied = NULL;
&(ps->users_denied));
&(ps->forms_denied));
&paperDenied);
}
}
PSTATUS *
new_pstatus(PRINTER *p)
{
static int i = 0;
char **paperDenied = NULL;
if (p != NULL)
}
return (result);
}
void
{
}
}
CLSTATUS *
new_cstatus(CLASS *c)
{
if (c != NULL)
else
}
return (result);
}
void
{
}
}
FSTATUS *
new_fstatus(_FORM *f)
{
static int i = 0;
if (f != NULL)
else
if (f != NULL) {
&(result->users_denied));
}
}
return (result);
}
void
{
}
}
PWSTATUS *
new_pwstatus(PWHEEL *p)
{
static int i = 0;
if (p != NULL)
else
}
return (result);
}
void
{
if (rsp->pwheel_name)
if (rsp->printer_type)
if (rsp->output_type)
}
}
RSTATUS *
{
}
return (result);
}
/**
** search_pstatus() - SEARCH PRINTER TABLE
** search_fstatus() - SEARCH FORMS TABLE
** search_cstatus() - SEARCH CLASS TABLE
** search_pwstatus() - SEARCH PRINT WHEEL TABLE
**/
PSTATUS *
search_pstatus(register char *name)
{
int i;
}
} else
return (ps);
}
FSTATUS *
search_fstatus(register char *name)
{
int i;
}
} else
return (ps);
}
FSTATUS *
search_fptable(register char *paper)
{
int i;
}
}
return (ps);
}
CLSTATUS *
search_cstatus(register char *name)
{
int i;
}
} else
return (ps);
}
PWSTATUS *
search_pwstatus(register char *name)
{
int i;
}
} else
return (ps);
}
/**
** load_str() - LOAD STRING WHERE ALLOC'D STRING MAY BE
** unload_str() - REMOVE POSSIBLE ALLOC'D STRING
**/
void
{
if (*pdst)
return;
}
void
unload_str(char **pdst)
{
if (*pdst)
*pdst = 0;
return;
}
/**
** unload_list() - REMOVE POSSIBLE ALLOC'D LIST
**/
void
unload_list(char ***plist)
{
if (*plist)
*plist = 0;
return;
}
/**
** load_sdn() - LOAD STRING WITH ASCII VERSION OF SCALED DECIMAL NUMBER
**/
void
{
if (!p)
return;
if (*p)
Free (*p);
*p = 0;
return;
*p = Malloc(sizeof("999999.999x"));
sprintf (
*p,
"%.3f%s",
);
return;
}
/**
** Getform() - EASIER INTERFACE TO "getform()"
**/
_FORM *
{
int ret;
while (
)
;
if (ret == -1)
return (0);
} else {
}
return (_form);
}
/**
** Getprinter()
** Getrequest()
** Getuser()
** Getclass()
** Getpwheel()
** Getsecure()
** Loadfilters()
**/
PRINTER *
Getprinter(char *name)
{
;
return (ret);
}
REQUEST *
Getrequest(char *file)
{
;
return (ret);
}
USER *
{
;
return (ret);
}
CLASS *
{
;
return (ret);
}
PWHEEL *
{
;
return (ret);
}
SECURE *
{
;
}
int
Loadfilters(char *file)
{
register int ret;
;
return (ret);
}
/**
** free_form() - FREE MEMORY ALLOCATED FOR _FORM STRUCTURE
**/
void
{
if (!pf)
return;
return;
}
/**
** getreqno() - GET NUMBER PART OF REQUEST ID
**/
char *
{
register char *cp;
else
cp++;
return (cp);
}
/* Putsecure(): Insurance for writing out the secure request file.
* input: char ptr to name of the request file,
* ptr to the SECURE structure to be written.
* ouput: 0 if successful, -1 otherwise.
*
* Description:
* The normal call to putsecure() is woefully lacking.
* The bottom line here is that there
* is no way to make sure that the file has been written out
* as expected. This can cause rude behaviour later on.
*
* This routine calls putsecure(), and then does a getsecure().
* The results are compared to the original structure. If the
* info obtained by getsecure() doesn't match, we retry a few
* times before giving up (presumably something is very seriously
* wrong at that point).
*/
int
{
int status; /* 0 = success, nonzero otherwise */
while (retries--) {
continue;
}
status = 2;
continue;
}
/* now compare each field */
/*
* A comparison is only valid if secbufp and pls point to
* different locations. In reality getsecure() will have
* already been called, allocating the same STATIC memory
* location to both structures making the following compare
* meaningless.
* Therefore test for this condition to prevent us from
* calling freesecure which will destroy uid and
* req_id fields in the strucure
*/
status = 0;
status = 3;
continue;
}
status = 4;
continue;
}
status = 5;
continue;
}
status = 6;
continue;
}
status = 7;
continue;
}
status = 8;
continue;
}
}
break;
}
if (status != 0) {
return -1;
}
return 0;
}
{
*ptr++ = *r++;
}
char *r;
r++;
else
r = buf;
} else
return;
}
/**
** _Malloc()
** _Realloc()
** _Calloc()
** _Strdup()
** _Free()
**/
void (*lp_alloc_fail_handler)( void ) = 0;
typedef void *alloc_type;
{
if (!ret) {
(*lp_alloc_fail_handler)();
}
return (ret);
}
{
if (!ret) {
(*lp_alloc_fail_handler)();
}
return (ret);
}
{
if (!ret) {
(*lp_alloc_fail_handler)();
}
return (ret);
}
char *
{
char * ret;
if (!s)
return( (char *) 0);
if (!ret) {
(*lp_alloc_fail_handler)();
}
return (ret);
}
void
{
return;
}