Initial import.
[platform/upstream/libiri.git] / include / iri.h
1 /*
2  * Copyright (c) 2005, 2008 Mo McRoberts.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. The names of the author(s) of this software may not be used to endorse
13  * or promote products derived from this software without specific prior
14  * written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 
17  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
18  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
19  * AUTHORS OF THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
23  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27
28 #ifndef IRI_H_
29 # define IRI_H_                        1
30
31 typedef struct iri_struct iri_t;
32
33 struct iri_struct
34 {
35         void *_private;
36         const char *scheme;
37         const char *user;
38         const char *auth;
39         const char *host;
40         int port;
41         const char *path;
42         const char *query;
43         const char *anchor;
44         const char **params;
45 };
46
47 # undef EXTERNC_
48 # if defined(__cplusplus)
49 #  define EXTERNC_                     extern "C"
50 # else
51 #  define EXTERNC_                     extern
52 # endif
53
54 EXTERNC_ iri_t *iri_parse(const char *src);
55 EXTERNC_ void iri_destroy(iri_t *iri);
56
57 #endif /* !IRI_H_ */