Change lookup method to find if content is of XML type.
[cascardo/atompub.git] / atom / id.c
1 /*
2  *  Copyright (C) 2008  Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3  *
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.
8  *
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.
13  *
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.
17  */
18
19
20 #include <atompub/atom.h>
21
22 #include <glib.h>
23
24 struct _atom_id
25 {
26   char *iri;
27 };
28
29 AtomID *
30 atom_id_new (char *iri)
31 {
32   AtomID *id;
33   id = g_slice_new (AtomID);
34   id->iri = g_strdup (iri);
35   return id;
36 }
37
38 void
39 atom_id_delete (AtomID *id)
40 {
41   if (id->iri)
42     g_free (id->iri);
43   g_slice_free (AtomID, id);
44 }
45
46 char *
47 atom_id_string (AtomID *id)
48 {
49   return id->iri;
50 }