1 /* $Id: disco_svc_md_register_response.c,v 1.0 2005/10/14 15:17:55 fpeters Exp $
2 *
3 * Lasso - A free implementation of the Liberty Alliance specifications.
4 *
5 * Copyright (C) 2004-2007 Entr'ouvert
6 * http://lasso.entrouvert.org
7 *
8 * Authors: See AUTHORS file in top-level directory.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 */
23
24 #include "../private.h"
25 #include "disco_svc_md_register_response.h"
26 #include "idwsf2_strings.h"
27
28 /**
29 * SECTION:disco_svc_md_register_response
30 * @short_description: <disco:SvcMDRegisterResponse>
31 *
32 * <figure><title>Schema fragment for disco:SvcMDRegisterResponse</title>
33 * <programlisting><![CDATA[
34 *
35 * <xs:complexType name="SvcMDRegisterResponseType">
36 * <xs:sequence>
37 *
38 * <xs:element ref="lu:Status" />
39 * <xs:element ref="SvcMDID" minOccurs="0" maxOccurs="unbounded" />
40 * <xs:element ref="Keys" minOccurs="0" maxOccurs="unbounded" />
41 *
42 * </xs:sequence>
43 * <xs:anyAttribute namespace="##other" processContents="lax"/>
44 * </xs:complexType>
45 * ]]></programlisting>
46 * </figure>
47 */
48
49 /*****************************************************************************/
50 /* private methods */
51 /*****************************************************************************/
52
53
54 static struct XmlSnippet schema_snippets[] = {
55 { "Status", SNIPPET_NODE,
56 G_STRUCT_OFFSET(LassoIdWsf2DiscoSvcMDRegisterResponse, Status),
57 "LassoIdWsf2UtilStatus", LASSO_IDWSF2_UTIL_PREFIX, LASSO_IDWSF2_UTIL_PREFIX},
58 { "SvcMDID", SNIPPET_LIST_CONTENT,
59 G_STRUCT_OFFSET(LassoIdWsf2DiscoSvcMDRegisterResponse, SvcMDID), NULL, NULL, NULL},
60 { "Keys", SNIPPET_LIST_NODES,
61 G_STRUCT_OFFSET(LassoIdWsf2DiscoSvcMDRegisterResponse, Keys),
62 "LassoIdWsf2DiscoKeys", NULL, NULL },
63 { "attributes", SNIPPET_ATTRIBUTE | SNIPPET_ANY,
64 G_STRUCT_OFFSET(LassoIdWsf2DiscoSvcMDRegisterResponse, attributes), NULL, NULL, NULL},
65 {NULL, 0, 0, NULL, NULL, NULL}
66 };
67
68 static LassoNodeClass *parent_class = NULL;
69
70
71 /*****************************************************************************/
72 /* instance and class init functions */
73 /*****************************************************************************/
74
75 static void
instance_init(LassoIdWsf2DiscoSvcMDRegisterResponse * node)76 instance_init(LassoIdWsf2DiscoSvcMDRegisterResponse *node)
77 {
78 node->attributes = g_hash_table_new_full(
79 g_str_hash, g_str_equal, g_free, g_free);
80 }
81
82 static void
class_init(LassoIdWsf2DiscoSvcMDRegisterResponseClass * klass,void * unused G_GNUC_UNUSED)83 class_init(LassoIdWsf2DiscoSvcMDRegisterResponseClass *klass, void *unused G_GNUC_UNUSED)
84 {
85 LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
86
87 parent_class = g_type_class_peek_parent(klass);
88 nclass->node_data = g_new0(LassoNodeClassData, 1);
89 lasso_node_class_set_nodename(nclass, "SvcMDRegisterResponse");
90 lasso_node_class_set_ns(nclass, LASSO_IDWSF2_DISCOVERY_HREF, LASSO_IDWSF2_DISCOVERY_PREFIX);
91 lasso_node_class_add_snippets(nclass, schema_snippets);
92 }
93
94 GType
lasso_idwsf2_disco_svc_md_register_response_get_type()95 lasso_idwsf2_disco_svc_md_register_response_get_type()
96 {
97 static GType this_type = 0;
98
99 if (!this_type) {
100 static const GTypeInfo this_info = {
101 sizeof (LassoIdWsf2DiscoSvcMDRegisterResponseClass),
102 NULL,
103 NULL,
104 (GClassInitFunc) class_init,
105 NULL,
106 NULL,
107 sizeof(LassoIdWsf2DiscoSvcMDRegisterResponse),
108 0,
109 (GInstanceInitFunc) instance_init,
110 NULL
111 };
112
113 this_type = g_type_register_static(LASSO_TYPE_NODE,
114 "LassoIdWsf2DiscoSvcMDRegisterResponse", &this_info, 0);
115 }
116 return this_type;
117 }
118
119 /**
120 * lasso_idwsf2_disco_svc_md_register_response_new:
121 *
122 * Creates a new #LassoIdWsf2DiscoSvcMDRegisterResponse object.
123 *
124 * Return value: a newly created #LassoIdWsf2DiscoSvcMDRegisterResponse object
125 **/
126 LassoIdWsf2DiscoSvcMDRegisterResponse*
lasso_idwsf2_disco_svc_md_register_response_new()127 lasso_idwsf2_disco_svc_md_register_response_new()
128 {
129 return g_object_new(LASSO_TYPE_IDWSF2_DISCO_SVC_MD_REGISTER_RESPONSE, NULL);
130 }
131