cancel_list.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 1998-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <syslog.h>
#ifndef SUNOS_4
#include <libintl.h>
#endif
#include <cancel_list.h>
/*
* printer_compair() compares the printer name in the cancel request and the
* printer name passed in. If they match, 0 is returned.
*/
static int
{
}
/*
* binding_compair() compares the binding in the cancel request and the
* binding passed in. If they match, 0 is returned.
*/
static int
{
}
/*
* cancel_list_element() adds information to the cancel list. It either adds
* information to an existing cancel entry if the printers match, or
* adds a new entry to the cancel list. It returns the new list in either
* case.
*/
static cancel_req_t *
{
== NULL) {
extern int exit_code;
"No default destination\n"));
else
"%s: unknown printer\n"),
printer);
exit_code = -1;
return (NULL);
}
(void *)element);
}
}
return (element);
}
/*
* cancel_list_element_by_binding() returns an element in the cancel list
* passed in that matches the binding passed in. If none exists, then
* one is created, inserted and returned.
*/
static cancel_req_t *
{
(void *)element);
}
}
return (element);
}
/*
* cancel_list_add_item() adds information to the cancel list. It either adds
* information to an existing cancel entry if the printers match, or
* adds a new entry to the cancel list. It returns the new list in either
* case.
*/
cancel_req_t **
{
(void *)item);
return (list);
}
/*
* cancel_list_add_list() adds information to the cancel list. It either adds
* information to an existing cancel entry if the printers match, or
* adds a new entry to the cancel list. It returns the new list in either
* case.
*/
cancel_req_t **
{
return (list);
}
/*
* cancel_list_add_binding_list() adds information to the cancel list. It
* either adds information to an existing cancel entry if the bindings
* match, or adds a new entry to the cancel list. It returns the new
* list in either case.
*/
cancel_req_t **
char **items)
{
return (list);
}