service.c revision 355b4669e025ff377602b6fc7caaf30dbc218371
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER START
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * The contents of this file are subject to the terms of the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Common Development and Distribution License (the "License").
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You may not use this file except in compliance with the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * See the License for the specific language governing permissions
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * and limitations under the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * When distributing Covered Code, include this CDDL HEADER in each
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * If applicable, add the following below this CDDL HEADER, with the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fields enclosed by brackets "[]" replaced with your own identifying
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * information: Portions Copyright [yyyy] [name of copyright owner]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER END
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* $Id: service.c 163 2006-05-09 15:07:45Z njacobs $ */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#pragma ident "%Z%%M% %I% %E% SMI"
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * valid URIs are in the form:
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * lpd://server[:port]/.../queue[#extensions]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * rfc-1179://server[:port]/.../queue[#extensions]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * any authentication information supplied the URI is ignored.
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceCreate(papi_service_t *handle, char *service_name,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((*handle = svc = (service_t *)calloc(1, sizeof (*svc))) == NULL)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papiAttributeListAddString(&svc->attributes, PAPI_ATTR_EXCL,
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetUserName(papi_service_t handle, char *user_name)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (papiAttributeListAddString(&svc->attributes, PAPI_ATTR_REPLACE,
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetPassword(papi_service_t handle, char *password)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (papiAttributeListAddInteger(&svc->attributes, PAPI_ATTR_REPLACE,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs svc->authCB = (int (*)(papi_service_t svc, void *))authCB;
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetAppData(papi_service_t handle, void *app_data)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fill in the message. If the buffer is too small, allocate
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * one that is large enough and fill it in.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((size = vsnprintf(message, BUFSIZ, fmt, ap)) >= BUFSIZ)