2 * Copyright (C) 2007 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include <atompub/atom.h>
35 iri = g_slice_new (IRI);
51 g_slice_free (IRI, iri);
58 niri = g_slice_new (IRI);
59 niri->scheme = g_strdup (iri->scheme);
60 niri->host = g_strdup (iri->host);
61 niri->path = g_strdup (iri->path);
66 iri_get_scheme (IRI *iri)
72 iri_set_scheme (IRI *iri, char *scheme)
76 iri->scheme = g_strdup (iri->scheme);
80 iri_get_host (IRI *iri)
86 iri_set_host (IRI *iri, char *host)
90 iri->host = g_strdup (host);
94 iri_get_path (IRI *iri)
100 iri_set_path (IRI *iri, char *path)
104 iri->path = g_strdup (path);
108 iri_get_string (IRI *iri)
110 if (iri->scheme == NULL || iri->host == NULL || iri->path == NULL)
112 return g_strconcat (iri->scheme, iri->host, iri->path, NULL);