diff options
author | Damien Laniel <dlaniel@entrouvert.com> | 2007-04-12 12:17:00 +0000 |
---|---|---|
committer | Damien Laniel <dlaniel@entrouvert.com> | 2007-04-12 12:17:00 +0000 |
commit | 97eb1dfcc9d8ffb1563a2c23cbcc1af034c5e3d5 (patch) | |
tree | 350869d40ed5d8aa1b927d8c3f8c56adc4c589fa | |
parent | 31f42481c5d9615565a75eb65ccbe4399dde219d (diff) | |
download | lasso-97eb1dfcc9d8ffb1563a2c23cbcc1af034c5e3d5.tar.gz lasso-97eb1dfcc9d8ffb1563a2c23cbcc1af034c5e3d5.tar.xz lasso-97eb1dfcc9d8ffb1563a2c23cbcc1af034c5e3d5.zip |
added wsu_timestamp class
-rw-r--r-- | lasso/xml/ws/wsu_timestamp.c | 94 | ||||
-rw-r--r-- | lasso/xml/ws/wsu_timestamp.h | 69 |
2 files changed, 163 insertions, 0 deletions
diff --git a/lasso/xml/ws/wsu_timestamp.c b/lasso/xml/ws/wsu_timestamp.c new file mode 100644 index 00000000..42643fb8 --- /dev/null +++ b/lasso/xml/ws/wsu_timestamp.c @@ -0,0 +1,94 @@ +/* $Id: wsu_timestamp.c 2495 2005-05-02 09:17:08Z dlaniel $ + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <lasso/xml/ws/wsu_timestamp.h> + +/* + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "Created", SNIPPET_NODE, G_STRUCT_OFFSET(LassoWsuTimestamp, Created) }, + { "Expired", SNIPPET_NODE, G_STRUCT_OFFSET(LassoWsuTimestamp, Expired) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoWsuTimestamp *node) +{ + node->Created = NULL; + node->Expired = NULL; +} + +static void +class_init(LassoWsuTimestampClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Timestamp"); + lasso_node_class_set_ns(nclass, LASSO_WSU_HREF, LASSO_WSU_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_wsu_timestamp_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoWsuTimestampClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoWsuTimestamp), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoWsuTimestamp", &this_info, 0); + } + return this_type; +} + +LassoWsuTimestamp* +lasso_wsu_timestamp_new() +{ + LassoWsuTimestamp *node; + + node = g_object_new(LASSO_TYPE_WSU_TIMESTAMP, NULL); + + return node; +} diff --git a/lasso/xml/ws/wsu_timestamp.h b/lasso/xml/ws/wsu_timestamp.h new file mode 100644 index 00000000..a6d9a611 --- /dev/null +++ b/lasso/xml/ws/wsu_timestamp.h @@ -0,0 +1,69 @@ +/* $Id: wsu_timestamp.h 2495 2005-05-02 09:17:08Z dlaniel $ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_WSU_TIMESTAMP_H__ +#define __LASSO_WSU_TIMESTAMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_WSU_TIMESTAMP (lasso_wsu_timestamp_get_type()) +#define LASSO_WSU_TIMESTAMP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_WSU_TIMESTAMP, LassoWsuTimestamp)) +#define LASSO_WSU_TIMESTAMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_WSU_TIMESTAMP, LassoWsuTimestampClass)) +#define LASSO_IS_WSU_TIMESTAMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_WSU_TIMESTAMP)) +#define LASSO_IS_WSU_TIMESTAMP_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_WSU_TIMESTAMP)) +#define LASSO_WSU_TIMESTAMP_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_WSU_TIMESTAMP, LassoWsuTimestampClass)) + +typedef struct _LassoWsuTimestamp LassoWsuTimestamp; +typedef struct _LassoWsuTimestampClass LassoWsuTimestampClass; + +struct _LassoWsuTimestamp { + LassoNode parent; + + gchar *Created; + gchar *Expired; +}; + +struct _LassoWsuTimestampClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_wsu_timestamp_get_type(void); + +LASSO_EXPORT LassoWsuTimestamp* lasso_wsu_timestamp_new(void); + +LASSO_EXPORT LassoWsuTimestamp* lasso_wsu_timestamp_new_from_message(const gchar *message); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_WSU_TIMESTAMP_H__ */ |