xref: /onnv-gate/usr/src/lib/print/libpapi-common/common/uri.h (revision 2264:b2b9267d002d)
1*2264Sjacobs /*
2*2264Sjacobs  * CDDL HEADER START
3*2264Sjacobs  *
4*2264Sjacobs  * The contents of this file are subject to the terms of the
5*2264Sjacobs  * Common Development and Distribution License (the "License").
6*2264Sjacobs  * You may not use this file except in compliance with the License.
7*2264Sjacobs  *
8*2264Sjacobs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2264Sjacobs  * or http://www.opensolaris.org/os/licensing.
10*2264Sjacobs  * See the License for the specific language governing permissions
11*2264Sjacobs  * and limitations under the License.
12*2264Sjacobs  *
13*2264Sjacobs  * When distributing Covered Code, include this CDDL HEADER in each
14*2264Sjacobs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2264Sjacobs  * If applicable, add the following below this CDDL HEADER, with the
16*2264Sjacobs  * fields enclosed by brackets "[]" replaced with your own identifying
17*2264Sjacobs  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2264Sjacobs  *
19*2264Sjacobs  * CDDL HEADER END
20*2264Sjacobs  */
21*2264Sjacobs 
22*2264Sjacobs /*
23*2264Sjacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2264Sjacobs  * Use is subject to license terms.
25*2264Sjacobs  *
26*2264Sjacobs  */
27*2264Sjacobs 
28*2264Sjacobs #ifndef _URI_H
29*2264Sjacobs #define	_URI_H
30*2264Sjacobs 
31*2264Sjacobs /* $Id: uri.h 146 2006-03-24 00:26:54Z njacobs $ */
32*2264Sjacobs 
33*2264Sjacobs #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*2264Sjacobs 
35*2264Sjacobs #ifdef __cplusplus
36*2264Sjacobs extern "C" {
37*2264Sjacobs #endif
38*2264Sjacobs 
39*2264Sjacobs /*
40*2264Sjacobs  *	scheme://[[user[:password]@]host[:port]]/path[[#fragment]|[?query]]
41*2264Sjacobs  */
42*2264Sjacobs typedef struct {
43*2264Sjacobs 	char *scheme;
44*2264Sjacobs 	char *scheme_part;
45*2264Sjacobs 	char *user;
46*2264Sjacobs 	char *password;
47*2264Sjacobs 	char *host;
48*2264Sjacobs 	char *port;
49*2264Sjacobs 	char *path;
50*2264Sjacobs 	char *fragment;
51*2264Sjacobs 	char *query;
52*2264Sjacobs 	/* really for testing, but left in */
53*2264Sjacobs 	char *user_part;
54*2264Sjacobs 	char *host_part;
55*2264Sjacobs 	char *path_part;
56*2264Sjacobs } uri_t;
57*2264Sjacobs 
58*2264Sjacobs extern int uri_from_string(char *string, uri_t **uri);
59*2264Sjacobs extern int uri_to_string(uri_t *uri, char *buffer, size_t buflen);
60*2264Sjacobs extern void uri_free(uri_t *uri);
61*2264Sjacobs 
62*2264Sjacobs #ifdef __cplusplus
63*2264Sjacobs }
64*2264Sjacobs #endif
65*2264Sjacobs 
66*2264Sjacobs #endif /* _URI_H */
67