job.c revision 355b4669e025ff377602b6fc7caaf30dbc218371
/*
* 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.
*
*/
/* $Id: job.c 155 2006-04-26 02:34:54Z ktou $ */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include <libintl.h>
#include <fcntl.h>
#include <papi_impl.h>
#include <uri.h>
/*
* must copy files before leaving routine
*/
{
return (PAPI_BAD_ARGUMENT);
if (job_ticket != NULL) {
gettext("papiJobSubmit: job ticket not supported"));
return (PAPI_OPERATION_NOT_SUPPORTED);
}
return (status);
gettext("calloc() failed"));
return (PAPI_TEMPORARY_ERROR);
}
/* create a control file */
&j->attributes);
&j->attributes);
/* send the job to the server */
return (status);
}
{
}
{
return (PAPI_BAD_ARGUMENT);
if (job_ticket != NULL)
return (PAPI_OPERATION_NOT_SUPPORTED);
return (status);
/* create the stream container */
return (PAPI_TEMPORARY_ERROR);
/* create the job */
return (PAPI_TEMPORARY_ERROR);
/* process the attribute list */
/* if we can stream, do it */
&(s->job->attributes));
&s->fd);
} else {
char dfname[18];
}
return (status);
}
{
(buflen == 0))
return (PAPI_BAD_ARGUMENT);
return (PAPI_DEVICE_ERROR);
return (PAPI_OK);
}
{
int ret;
return (PAPI_BAD_ARGUMENT);
char *files[2];
&(s->job->attributes));
} else
return (status);
}
{
return (PAPI_BAD_ARGUMENT);
return (status);
}
{
return (PAPI_BAD_ARGUMENT);
return (status);
}
{
if (j != NULL)
return ((papi_attribute_t **)j->attributes);
return (NULL);
}
char *
{
if (j != NULL)
"printer-name", &result);
return (result);
}
int
{
int result = -1;
if (j != NULL)
"job-id", &result);
return (result);
}
void
{
if (j != NULL) {
free(j);
}
}
void
{
int i;
papiJobFree(jobs[i]);
}
}