~ubuntu-branches/ubuntu/breezy/lasso/breezy

« back to all changes in this revision

Viewing changes to lasso/xml/sa_password_transforms.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-09-16 02:16:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050916021649-lr5tuka6pfmmks44
Tags: 0.6.2-3ubuntu1
* debian/control: removed hardcoded php dependency, added php:Depends
  substvar
* debian/rules: added phpapiver, added substitution of php:Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: sa_password_transforms.c,v 1.1 2005/02/10 16:44:36 nclapies Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004, 2005 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, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#include <lasso/xml/sa_password_transforms.h>
 
26
 
 
27
/*
 
28
 * Schema fragments (liberty-idwsf-authn-svc-v1.0.xsd):
 
29
 *   <xs:element name="PasswordTransforms">
 
30
 *      <xs:annotation>
 
31
 *        <xs:documentation>
 
32
 *          Contains ordered list of sequential password transformations
 
33
 *        </xs:documentation>
 
34
 *      </xs:annotation>
 
35
 *      <xs:complexType>
 
36
 *        <xs:sequence>
 
37
 *          <xs:element name="Transform" maxOccurs="unbounded">
 
38
 *            <xs:complexType>
 
39
 *              <xs:sequence>
 
40
 *                <xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
 
41
 *                <xs:complexType>
 
42
 *                  <xs:simpleContent>
 
43
 *                    <xs:extension base="xs:string">
 
44
 *                      <xs:attribute name="name" type="xs:string" use="required"/>
 
45
 *                    </xs:extension>
 
46
 *                  </xs:simpleContent>
 
47
 *                </xs:complexType>
 
48
 *                </xs:eledment>
 
49
 *              </xs:sequence>
 
50
 *              <xs:attribute name="name" type="xs:anyURI" use="required"/>
 
51
 *              <xs:attribute name="id" type="xs:ID"use="optional"/>
 
52
 *            </xs:complexType>
 
53
 *          </xs:element>
 
54
 *        </xs:sequence>
 
55
 *      </xs:complexType>
 
56
 *  </xs:element>
 
57
 */ 
 
58
 
 
59
/*****************************************************************************/
 
60
/* private methods                                                           */
 
61
/*****************************************************************************/
 
62
 
 
63
static struct XmlSnippet schema_snippets[] = {
 
64
        { "Transform", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSaPasswordTransforms, Transform) },
 
65
        { NULL, 0, 0}
 
66
};
 
67
 
 
68
/*****************************************************************************/
 
69
/* instance and class init functions                                         */
 
70
/*****************************************************************************/
 
71
 
 
72
static void
 
73
instance_init(LassoSaPasswordTransforms *node)
 
74
{
 
75
        node->Transform = NULL;
 
76
}
 
77
 
 
78
static void
 
79
class_init(LassoSaPasswordTransformsClass *klass)
 
80
{
 
81
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
82
 
 
83
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
84
        lasso_node_class_set_nodename(nclass, "PasswordTransforms");
 
85
        lasso_node_class_set_ns(nclass, LASSO_SA_HREF, LASSO_SA_PREFIX);
 
86
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
87
}
 
88
 
 
89
GType
 
90
lasso_sa_password_transforms_get_type()
 
91
{
 
92
        static GType this_type = 0;
 
93
 
 
94
        if (!this_type) {
 
95
                static const GTypeInfo this_info = {
 
96
                        sizeof (LassoSaPasswordTransformsClass),
 
97
                        NULL,
 
98
                        NULL,
 
99
                        (GClassInitFunc) class_init,
 
100
                        NULL,
 
101
                        NULL,
 
102
                        sizeof(LassoSaPasswordTransforms),
 
103
                        0,
 
104
                        (GInstanceInitFunc) instance_init,
 
105
                };
 
106
                
 
107
                this_type = g_type_register_static(LASSO_TYPE_NODE,
 
108
                                "LassoSaPasswordTransforms", &this_info, 0);
 
109
        }
 
110
        return this_type;
 
111
}
 
112
 
 
113
LassoSaPasswordTransforms*
 
114
lasso_sa_password_transforms_new()
 
115
{
 
116
        LassoSaPasswordTransforms *node;
 
117
 
 
118
        node = g_object_new(LASSO_TYPE_SA_PASSWORD_TRANSFORMS, NULL);
 
119
 
 
120
        return node;
 
121
}
 
122
 
 
123
LassoSaPasswordTransforms*
 
124
lasso_sa_password_transforms_new_from_message(const gchar *message)
 
125
{
 
126
        LassoSaPasswordTransforms *node;
 
127
 
 
128
        g_return_val_if_fail(message != NULL, NULL);
 
129
 
 
130
        node = g_object_new(LASSO_TYPE_SA_PASSWORD_TRANSFORMS, NULL);
 
131
        lasso_node_init_from_message(LASSO_NODE(node), message);
 
132
 
 
133
        return node;
 
134
}