IRI * iri_new (void);
void iri_delete (IRI *);
+IRI * iri_copy (IRI *);
+char *iri_get_scheme (IRI *);
+void iri_set_scheme (IRI *, char *);
+char * iri_get_host (IRI *);
+void iri_set_host (IRI *, char *);
char * iri_get_path (IRI *);
void iri_set_path (IRI *, char *);
+char * iri_get_string (IRI *);
#endif
g_slice_free (IRI, iri);
}
+IRI *
+iri_copy (IRI *iri)
+{
+ IRI *niri;
+ niri = g_slice_new (IRI);
+ niri->scheme = g_strdup (iri->scheme);
+ niri->host = g_strdup (iri->host);
+ niri->path = g_strdup (iri->path);
+ return niri;
+}
+
+char *
+iri_get_scheme (IRI *iri)
+{
+ return iri->scheme;
+}
+
+void
+iri_set_scheme (IRI *iri, char *scheme)
+{
+ if (iri->scheme)
+ g_free (iri->scheme);
+ iri->scheme = g_strdup (iri->scheme);
+}
+
+char *
+iri_get_host (IRI *iri)
+{
+ return iri->host;
+}
+
+void
+iri_set_host (IRI *iri, char *host)
+{
+ if (iri->host)
+ g_free (iri->host);
+ iri->host = g_strdup (host);
+}
+
char *
iri_get_path (IRI *iri)
{
g_free (iri->path);
iri->path = g_strdup (path);
}
+
+char *
+iri_get_string (IRI *iri)
+{
+ if (iri->scheme == NULL || iri->host == NULL || iri->path == NULL)
+ return NULL;
+ return g_strconcat (iri->scheme, iri->host, iri->path, NULL);
+}