Debian Codegraph @

libgdome/gdomecore/gdome-xml-comment.c

raw
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
2 /* gdome-xml-commen.c
3 *
4 * Copyright (C) 1999 Raph Levien <[email protected]>
5 * Copyright (C) 2000 Mathieu Lacage <[email protected]>
6 * Copyright (C) 2001 Paolo Casarini <[email protected]>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23 #include <string.h>
24 #include "gdome.h"
25 #include "gdome-xml-util.h"
26 #include "gdome-xml-node.h"
27 #include "gdome-xml-cdata.h"
28 #include "gdome-xml-comment.h"
29
30
31
32 const GdomeCommentVtab gdome_xml_c_vtab = {
33 {
34 {
35 gdome_xml_n_ref,
36 gdome_xml_n_unref,
37 gdome_xml_c_query_interface,
38 gdome_xml_n_nodeName,
39 gdome_xml_n_nodeValue,
40 gdome_xml_n_set_nodeValue,
41 gdome_xml_n_nodeType,
42 gdome_xml_n_parentNode,
43 gdome_xml_n_childNodes,
44 gdome_xml_n_firstChild,
45 gdome_xml_n_lastChild,
46 gdome_xml_n_previousSibling,
47 gdome_xml_n_nextSibling,
48 gdome_xml_n_attributes,
49 gdome_xml_n_ownerDocument,
50 gdome_xml_n_insertBefore,
51 gdome_xml_n_replaceChild,
52 gdome_xml_n_removeChild,
53 gdome_xml_n_appendChild,
54 gdome_xml_n_hasChildNodes,
55 gdome_xml_n_cloneNode,
56 gdome_xml_n_normalize,
57 gdome_xml_n_isSupported,
58 gdome_xml_n_namespaceURI,
59 gdome_xml_n_prefix,
60 gdome_xml_n_set_prefix,
61 gdome_xml_n_localName,
62 gdome_xml_n_hasAttributes,
63 gdome_xml_n_addEventListener,
64 gdome_xml_n_removeEventListener,
65 gdome_xml_n_dispatchEvent,
66 gdome_xml_n_subTreeDispatchEvent
67 },
68 gdome_xml_cd_data,
69 gdome_xml_cd_set_data,
70 gdome_xml_cd_length,
71 gdome_xml_cd_substringData,
72 gdome_xml_cd_appendData,
73 gdome_xml_cd_insertData,
74 gdome_xml_cd_deleteData,
75 gdome_xml_cd_replaceData
76 }
77 };
78
79 /**
80 * gdome_xml_c_query_interface:
81 * @self: Node Object ref
82 * @interface: interface needed
83 * @exc: Exception Object ref
84 *
85 * Returns: a reference to this object that implements the @interface needed,
86 * or %NULL if the @interface is not supported by this Object.
87 */
88 gpointer
89 gdome_xml_c_query_interface (GdomeNode *self, const char *interface, GdomeException *exc)
90 {
91 Gdome_xml_Comment *priv = (Gdome_xml_Comment *)self;
92
93 g_return_val_if_fail (priv != NULL, NULL);
94 g_return_val_if_fail (GDOME_XML_IS_C (priv), NULL);
95 g_return_val_if_fail (interface != NULL, NULL);
96 g_return_val_if_fail (exc != NULL, NULL);
97
98 if (!strcmp (interface, "Node") ||
99 !strcmp (interface, "CharacterData") ||
100 !strcmp (interface, "Comment") ||
101 !strcmp (interface, "EventTarget")) {
102 priv->refcnt++;
103 return self;
104 }
105 else
106 return NULL;
107 }
108
109
110