1 /* $Id: ims_identity_mapping_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 "ims_identity_mapping_response.h"
26 #include "idwsf2_strings.h"
27 
28 /**
29  * SECTION:ims_identity_mapping_response
30  * @short_description: &lt;ims:IdentityMappingResponse&gt;
31  *
32  * <figure><title>Schema fragment for ims:IdentityMappingResponse</title>
33  * <programlisting><![CDATA[
34  *
35  * <xs:complexType name="IdentityMappingResponseType">
36  *   <xs:sequence>
37  *     <xs:element ref="lu:Status"/>
38  *     <xs:element ref="MappingOutput" minOccurs="0" maxOccurs="unbounded"/>
39  *   </xs:sequence>
40  *   <xs:anyAttribute namespace="##other" processContents="lax"/>
41  * </xs:complexType>
42  * ]]></programlisting>
43  * </figure>
44  */
45 
46 /*****************************************************************************/
47 /* private methods                                                           */
48 /*****************************************************************************/
49 
50 
51 static struct XmlSnippet schema_snippets[] = {
52 	{ "Status", SNIPPET_NODE,
53 		G_STRUCT_OFFSET(LassoIdWsf2ImsIdentityMappingResponse, Status),
54 		"LassoIdWsf2UtilStatus", LASSO_IDWSF2_UTIL_PREFIX, LASSO_IDWSF2_UTIL_HREF},
55 	{ "MappingOutput", SNIPPET_LIST_NODES,
56 		G_STRUCT_OFFSET(LassoIdWsf2ImsIdentityMappingResponse, MappingOutput), NULL, NULL, NULL},
57 	{ "attributes", SNIPPET_ATTRIBUTE | SNIPPET_ANY,
58 		G_STRUCT_OFFSET(LassoIdWsf2ImsIdentityMappingResponse, attributes), NULL, NULL, NULL},
59 	{NULL, 0, 0, NULL, NULL, NULL}
60 };
61 
62 static LassoNodeClass *parent_class = NULL;
63 
64 
65 /*****************************************************************************/
66 /* instance and class init functions                                         */
67 /*****************************************************************************/
68 
69 static void
instance_init(LassoIdWsf2ImsIdentityMappingResponse * node)70 instance_init(LassoIdWsf2ImsIdentityMappingResponse *node)
71 {
72 	node->attributes = g_hash_table_new_full(
73 		g_str_hash, g_str_equal, g_free, g_free);
74 }
75 
76 static void
class_init(LassoIdWsf2ImsIdentityMappingResponseClass * klass,void * unused G_GNUC_UNUSED)77 class_init(LassoIdWsf2ImsIdentityMappingResponseClass *klass, void *unused G_GNUC_UNUSED)
78 {
79 	LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
80 
81 	parent_class = g_type_class_peek_parent(klass);
82 	nclass->node_data = g_new0(LassoNodeClassData, 1);
83 	lasso_node_class_set_nodename(nclass, "IdentityMappingResponse");
84 	lasso_node_class_set_ns(nclass, LASSO_IDWSF2_IMS_HREF, LASSO_IDWSF2_IMS_PREFIX);
85 	lasso_node_class_add_snippets(nclass, schema_snippets);
86 }
87 
88 GType
lasso_idwsf2_ims_identity_mapping_response_get_type()89 lasso_idwsf2_ims_identity_mapping_response_get_type()
90 {
91 	static GType this_type = 0;
92 
93 	if (!this_type) {
94 		static const GTypeInfo this_info = {
95 			sizeof (LassoIdWsf2ImsIdentityMappingResponseClass),
96 			NULL,
97 			NULL,
98 			(GClassInitFunc) class_init,
99 			NULL,
100 			NULL,
101 			sizeof(LassoIdWsf2ImsIdentityMappingResponse),
102 			0,
103 			(GInstanceInitFunc) instance_init,
104 			NULL
105 		};
106 
107 		this_type = g_type_register_static(LASSO_TYPE_NODE,
108 				"LassoIdWsf2ImsIdentityMappingResponse", &this_info, 0);
109 	}
110 	return this_type;
111 }
112 
113 /**
114  * lasso_idwsf2_ims_identity_mapping_response_new:
115  *
116  * Creates a new #LassoIdWsf2ImsIdentityMappingResponse object.
117  *
118  * Return value: a newly created #LassoIdWsf2ImsIdentityMappingResponse object
119  **/
120 LassoIdWsf2ImsIdentityMappingResponse*
lasso_idwsf2_ims_identity_mapping_response_new()121 lasso_idwsf2_ims_identity_mapping_response_new()
122 {
123 	return g_object_new(LASSO_TYPE_IDWSF2_IMS_IDENTITY_MAPPING_RESPONSE, NULL);
124 }
125