~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to lasso/xml/lib_authn_response_envelope.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: lib_authn_response_envelope.c,v 1.2 2004/08/13 15:16:13 fpeters Exp $ 
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: Nicolas Clapies <nclapies@entrouvert.com>
 
9
 *          Valery Febvre <vfebvre@easter-eggs.com>
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 * 
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 * 
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#include <lasso/xml/lib_authn_response_envelope.h>
 
27
 
 
28
 
 
29
 
 
30
/*****************************************************************************/
 
31
/* public methods                                                            */
 
32
/*****************************************************************************/
 
33
 
 
34
void
 
35
lasso_lib_authn_response_envelope_set_extension(LassoLibAuthnResponseEnvelope *node,
 
36
                                                LassoNode *extension)
 
37
{
 
38
  LassoNodeClass *class;
 
39
  g_assert(LASSO_IS_LIB_AUTHN_RESPONSE_ENVELOPE(node));
 
40
  g_assert(LASSO_NODE(extension));
 
41
 
 
42
  class = LASSO_NODE_GET_CLASS(node);
 
43
  class->add_child(LASSO_NODE(extension), extension, FALSE);
 
44
}
 
45
 
 
46
void
 
47
lasso_lib_authn_response_envelope_set_authnResponse(LassoLibAuthnResponseEnvelope *node,
 
48
                                                    LassoLibAuthnResponse         *authnResponse_node)
 
49
{
 
50
  LassoNodeClass *class;
 
51
  g_assert(LASSO_IS_LIB_AUTHN_RESPONSE_ENVELOPE(node));
 
52
  g_assert(LASSO_IS_LIB_AUTHN_RESPONSE(authnResponse_node));
 
53
 
 
54
  class = LASSO_NODE_GET_CLASS(node);
 
55
  class->add_child(LASSO_NODE(node), LASSO_NODE(authnResponse_node), FALSE);
 
56
}
 
57
 
 
58
void
 
59
lasso_lib_authn_response_envelope_set_assertionConsumerServiceURL(LassoLibAuthnResponseEnvelope *node,
 
60
                                                                  const xmlChar                 *url)
 
61
{
 
62
  LassoNodeClass *class;
 
63
  g_assert(LASSO_IS_LIB_AUTHN_RESPONSE_ENVELOPE(node));
 
64
  g_assert(url != NULL);
 
65
 
 
66
  class = LASSO_NODE_GET_CLASS(node);
 
67
  class->new_child(LASSO_NODE (node), "AssertionConsumerServiceURL",
 
68
                   url, FALSE);
 
69
}
 
70
 
 
71
/*****************************************************************************/
 
72
/* instance and class init functions                                         */
 
73
/*****************************************************************************/
 
74
 
 
75
static void
 
76
lasso_lib_authn_response_envelope_instance_init(LassoLibAuthnResponseEnvelope *node)
 
77
{
 
78
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
79
 
 
80
  class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
 
81
  class->set_name(LASSO_NODE(node), "AuthnResponseEnvelope");
 
82
}
 
83
 
 
84
static void
 
85
lasso_lib_authn_response_envelope_class_init(LassoLibAuthnResponseEnvelopeClass *class)
 
86
{
 
87
}
 
88
 
 
89
GType lasso_lib_authn_response_envelope_get_type() {
 
90
  static GType this_type = 0;
 
91
 
 
92
  if (!this_type) {
 
93
    static const GTypeInfo this_info = {
 
94
      sizeof (LassoLibAuthnResponseEnvelopeClass),
 
95
      NULL,
 
96
      NULL,
 
97
      (GClassInitFunc) lasso_lib_authn_response_envelope_class_init,
 
98
      NULL,
 
99
      NULL,
 
100
      sizeof(LassoLibAuthnResponseEnvelope),
 
101
      0,
 
102
      (GInstanceInitFunc) lasso_lib_authn_response_envelope_instance_init,
 
103
    };
 
104
    
 
105
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
106
                                       "LassoLibAuthnResponseEnvelope",
 
107
                                       &this_info, 0);
 
108
  }
 
109
  return this_type;
 
110
}
 
111
 
 
112
LassoNode* lasso_lib_authn_response_envelope_new() {
 
113
  return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_AUTHN_RESPONSE_ENVELOPE,
 
114
                                 NULL));
 
115
}