2 * libiri: An IRI/URI/URL parsing library
7 * Copyright (c) 2005, 2008 Mo McRoberts.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The names of the author(s) of this software may not be used to endorse
18 * or promote products derived from this software without specific prior
21 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
24 * AUTHORS OF THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 main(int argc, char **argv)
51 fprintf(stderr, "Usage: %s IRI\n", argv[0]);
54 iri = iri_parse(argv[1]);
55 printf(" scheme: %s\n", iri->scheme);
56 for(c = 0; c < iri->nschemes; c++)
58 printf("%8d: %s\n", (int) c, iri->schemelist[c]);
60 printf(" user: %s\n", iri->user);
61 printf(" auth: %s\n", iri->auth);
62 printf("password: %s\n", iri->password);
63 printf(" host: %s\n", iri->host);
64 printf(" port: %d\n", iri->port);
65 printf(" path: %s\n", iri->path);
66 printf(" query: %s\n", iri->query);
67 printf(" anchor: %s\n", iri->anchor);