~ubuntu-branches/ubuntu/karmic/lasso/karmic

« back to all changes in this revision

Viewing changes to lasso/xml/ws/wsse_security_token_reference.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-11-01 20:01:20 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071101200120-9ruoui67n24xyz9c
Tags: 2.1.1-2ubuntu1
* Merge from debian unstable (LP: #134095), remaining changes:
  + debian/control:
    - Modify Maintainer value to match DebianMaintainerField spec.
  + configure{,.ac}:
    - Add missing quotes around the value for PHP[45]_LIBS.
* Fix two lintian warnings:
  + debian/control:
    - liblasso3-dev: Replace ${Source-Version} with ${binary:Version}
  + debian/rules:
    - Don't ignore a make clean error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: wsse_security_token_reference.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, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#include "wsse_security_token_reference.h"
 
26
 
 
27
/*
 
28
 * Schema fragment (oasis-200401-wss-wssecurity-secext-1.0.xsd):
 
29
 *
 
30
 * <xs:complexType name="SecurityTokenReferenceType">
 
31
 *   <xs:annotation>
 
32
 *     <xs:documentation>This type is used reference a security token.</xs:documentation>
 
33
 *     </xs:annotation>
 
34
 *     <xs:choice minOccurs="0" maxOccurs="unbounded">
 
35
 *       <xs:any processContents="lax"/>
 
36
 *     </xs:choice>
 
37
 *     <xs:attribute ref="wsu:Id"/>
 
38
 *     <xs:attribute ref="wsse:Usage"/>
 
39
 *     <xs:anyAttribute namespace="##other" processContents="lax"/>
 
40
 *   </xs:complexType>
 
41
 */
 
42
 
 
43
/*****************************************************************************/
 
44
/* private methods                                                           */
 
45
/*****************************************************************************/
 
46
 
 
47
 
 
48
static struct XmlSnippet schema_snippets[] = {
 
49
        { "Id", SNIPPET_ATTRIBUTE,
 
50
                G_STRUCT_OFFSET(LassoWsSec1SecurityTokenReference, Id) },
 
51
        { "Usage", SNIPPET_ATTRIBUTE,
 
52
                G_STRUCT_OFFSET(LassoWsSec1SecurityTokenReference, Usage) },
 
53
        { "attributes", SNIPPET_ATTRIBUTE | SNIPPET_ANY,
 
54
                G_STRUCT_OFFSET(LassoWsSec1SecurityTokenReference, attributes) },
 
55
        {NULL, 0, 0}
 
56
};
 
57
 
 
58
static LassoNodeClass *parent_class = NULL;
 
59
 
 
60
 
 
61
/*****************************************************************************/
 
62
/* instance and class init functions                                         */
 
63
/*****************************************************************************/
 
64
 
 
65
static void
 
66
instance_init(LassoWsSec1SecurityTokenReference *node)
 
67
{
 
68
        node->Id = NULL;
 
69
        node->Usage = NULL;
 
70
        node->attributes = g_hash_table_new_full(
 
71
                g_str_hash, g_str_equal, g_free, g_free);
 
72
}
 
73
 
 
74
static void
 
75
class_init(LassoWsSec1SecurityTokenReferenceClass *klass)
 
76
{
 
77
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
78
 
 
79
        parent_class = g_type_class_peek_parent(klass);
 
80
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
81
        lasso_node_class_set_nodename(nclass, "SecurityTokenReference");
 
82
        lasso_node_class_set_ns(nclass, LASSO_WSSE1_HREF, LASSO_WSSE1_PREFIX);
 
83
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
84
}
 
85
 
 
86
GType
 
87
lasso_wsse_security_token_reference_get_type()
 
88
{
 
89
        static GType this_type = 0;
 
90
 
 
91
        if (!this_type) {
 
92
                static const GTypeInfo this_info = {
 
93
                        sizeof (LassoWsSec1SecurityTokenReferenceClass),
 
94
                        NULL,
 
95
                        NULL,
 
96
                        (GClassInitFunc) class_init,
 
97
                        NULL,
 
98
                        NULL,
 
99
                        sizeof(LassoWsSec1SecurityTokenReference),
 
100
                        0,
 
101
                        (GInstanceInitFunc) instance_init,
 
102
                };
 
103
 
 
104
                this_type = g_type_register_static(LASSO_TYPE_NODE,
 
105
                                "LassoWsSec1SecurityTokenReference", &this_info, 0);
 
106
        }
 
107
        return this_type;
 
108
}
 
109
 
 
110
/**
 
111
 * lasso_wsse_security_token_reference_new:
 
112
 *
 
113
 * Creates a new #LassoWsSec1SecurityTokenReference object.
 
114
 *
 
115
 * Return value: a newly created #LassoWsSec1SecurityTokenReference object
 
116
 **/
 
117
LassoWsSec1SecurityTokenReference*
 
118
lasso_wsse_security_token_reference_new()
 
119
{
 
120
        return g_object_new(LASSO_TYPE_WSSE_SECURITY_TOKEN_REFERENCE, NULL);
 
121
}