/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: job.c 148 2006-04-25 16:54:17Z njacobs $ */
/*LINTLIBRARY*/
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <papi_impl.h>
#include <fcntl.h>
#include <libintl.h>
#ifndef OPID_CUPS_MOVE_JOB
#endif
void
{
}
}
void
{
int i;
papiJobFree(jobs[i]);
}
}
{
if (j != NULL)
result = j->attributes;
return (result);
}
char *
{
if (j != NULL)
"printer-name", &result);
return (result);
}
{
if (j != NULL)
"job-id", &result);
return (result);
}
{
return (result);
}
static void
{
static char *operational_names[] = {
"job-name", "ipp-attribute-fidelity", "document-name",
"compression", "document-format", "document-natural-language",
};
/* create the base IPP request */
/* create an operational attributes group */
/* split up the attributes into operational and job attributes */
&operational, &job);
/* add the operational attributes group to the request */
"operational-attributes-group", operational);
/* add the job attributes group to the request */
/*
* Add job-originating-host-name to attributes
* if not already set.
*/
"job-originating-host-name", &hostname);
"job-originating-host-name", host);
}
"job-attributes-group", job);
}
}
static papi_status_t
{
/* create the base IPP request */
/* create an operational attributes group */
file);
"operational-attributes-group", op);
/* send the IPP request to the server */
return (result);
}
{
int i;
return (PAPI_BAD_ARGUMENT);
switch (call_type) {
case _BY_REFERENCE:
/*
* For the time being, this is disabled. There are a number
* of issues to be dealt with before we can send a URI
* across the network to the server. For example, the file
* name(s) passed in are most likely relative to the current
* hosts filesystem. They also most likely will require some
* form of authentication information to be passed with the
* URI.
*/
#endif
/* fall-through */
case _WITH_DATA:
return (PAPI_BAD_ARGUMENT);
break;
case _VALIDATE:
/* if we have files, validate access to them */
return (PAPI_DOCUMENT_ACCESS_ERROR);
}
"Cannot access file: %s:"
" %s"), files[i],
return (
}
"Zero byte (empty) file: "
"%s",
files[i]);
return (PAPI_BAD_ARGUMENT);
}
}
}
}
break;
}
/* if we are already connected, use that connection. */
return (result);
return (PAPI_TEMPORARY_ERROR);
/*
* before creating IPP request
* add the job-name
*/
"job-name", files[0]);
/* create IPP request */
switch (req_type) {
case OPID_PRINT_JOB:
files[0]);
break;
case OPID_CREATE_JOB:
case OPID_VALIDATE_JOB:
case OPID_PRINT_URI:
break;
}
/* retrieve the job attributes */
"job-attributes-group", &op);
if (req_type == OPID_CREATE_JOB) {
"job-id", &id);
/* send each document */
i++)
}
}
return (result);
}
{
}
{
}
{
}
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
"job-name", "standard input");
/* create job request */
return (result);
}
{
#ifdef DEBUG
printf("papiJobStreamWrite(0x%8.8x, 0x%8.8x, 0x%8.8x, %d)\n",
#endif
(buflen == 0))
return (PAPI_BAD_ARGUMENT);
if (rc < 0)
else {
}
}
#ifdef DEBUG
#endif
return (result);
}
{
return (PAPI_BAD_ARGUMENT);
return (PAPI_TEMPORARY_ERROR);
/* update our connection info */
while (status == HTTP_CONTINUE)
return (http_to_papi_status(status));
/* read the IPP response */
"job-attributes-group", &op);
}
return (result);
}
char **requested_attrs,
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
return (PAPI_TEMPORARY_ERROR);
if (requested_attrs != NULL) {
int i;
for (i = 0; requested_attrs[i] != NULL; i++)
"requested-attributes", requested_attrs[i]);
}
"operational-attributes-group", op);
"job-attributes-group", &op);
return (result);
}
/* papiJob{Cancel|Hold|Release|Restart|Promote} are all the same */
static papi_status_t
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
"operational-attributes-group", op);
return (result);
}
{
}
{
job_id, OPID_HOLD_JOB));
}
{
}
{
}
{
}
char *destination)
{
(destination == NULL))
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
"operational-attributes-group", op);
"job-printer-uri", destination);
"job-attributes-group", op);
return (result);
}
{
(attributes == NULL))
return (PAPI_BAD_ARGUMENT);
return (PAPI_TEMPORARY_ERROR);
/* if we are already connected, use that connection. */
return (result);
"operational-attributes-group", op);
"job-attributes-group", attributes);
"job-attributes-group", &op);
return (result);
}