diff options
| -rw-r--r-- | lasso/xml/soap-env_body.c | 101 | ||||
| -rw-r--r-- | lasso/xml/soap-env_body.h | 62 | ||||
| -rw-r--r-- | lasso/xml/soap-env_envelope.c | 102 | ||||
| -rw-r--r-- | lasso/xml/soap-env_envelope.h | 63 |
4 files changed, 328 insertions, 0 deletions
diff --git a/lasso/xml/soap-env_body.c b/lasso/xml/soap-env_body.c new file mode 100644 index 00000000..44e71f74 --- /dev/null +++ b/lasso/xml/soap-env_body.c @@ -0,0 +1,101 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.com> + * + * 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/soap-env_body.h> + +/*****************************************************************************/ +/* public methods */ +/*****************************************************************************/ + +void +lasso_soap_env_body_add_child(LassoSoapEnvBody *body, LassoNode *node) +{ + g_assert(LASSO_IS_SOAP_ENV_BODY(body)); + g_assert(LASSO_IS_NODE(node)); + + LassoNodeClass *class = LASSO_NODE_GET_CLASS(body); + class->add_child(LASSO_NODE(body), + LASSO_NODE(node), + FALSE); +} + +void +lasso_soap_env_body_get_child(LassoSoapEnvBody *body, const xmlChar *name) +{ + LassoNode *node; + + //g_assert(LASSO_IS_SOAP_ENV_BODY(body)); + + node = lasso_node_get_child(body, name); + + return(node); +} + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +lasso_soap_env_body_instance_init(LassoSoapEnvBody *node) +{ + LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node)); + + class->set_ns(LASSO_NODE(node), lassoSoapEnvHRef, + lassoSoapEnvPrefix); + class->set_name(LASSO_NODE(node), "Body"); +} + +static void +lasso_soap_env_body_class_init(LassoSoapEnvBodyClass *klass) +{ +} + +GType lasso_soap_env_body_get_type() { + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapEnvBodyClass), + NULL, + NULL, + (GClassInitFunc) lasso_soap_env_body_class_init, + NULL, + NULL, + sizeof(LassoSoapEnvBody), + 0, + (GInstanceInitFunc) lasso_soap_env_body_instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE , + "LassoSoapEnvBody", + &this_info, 0); + } + return this_type; +} + +LassoNode* lasso_soap_env_body_new() { + return LASSO_NODE(g_object_new(LASSO_TYPE_SOAP_ENV_BODY, + NULL)); +} diff --git a/lasso/xml/soap-env_body.h b/lasso/xml/soap-env_body.h new file mode 100644 index 00000000..cae598d6 --- /dev/null +++ b/lasso/xml/soap-env_body.h @@ -0,0 +1,62 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.com> + * + * 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_SOAP_ENV_BODY_H__ +#define __LASSO_SOAP_ENV_BODY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SOAP_ENV_BODY (lasso_soap_env_body_get_type()) +#define LASSO_SOAP_ENV_BODY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SOAP_ENV_BODY, LassoSoapEnvBody)) +#define LASSO_SOAP_ENV_BODY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SOAP_ENV_BODY, LassoSoapEnvBodyClass)) +#define LASSO_IS_SOAP_ENV_BODY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_ENV_BODY)) +#define LASSO_IS_SOAP_ENV_BODY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SOAP_ENV_BODY)) +#define LASSO_SOAP_ENV_BODY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SOAP_ENV_BODY, LassoSoapEnvBodyClass)) + +typedef struct _LassoSoapEnvBody LassoSoapEnvBody; +typedef struct _LassoSoapEnvBodyClass LassoSoapEnvBodyClass; + +struct _LassoSoapEnvBody { + LassoNode parent; + /*< private >*/ +}; + +struct _LassoSoapEnvBodyClass { + LassoNodeClass parent; + /*< vtable >*/ +}; + +LASSO_EXPORT GType lasso_soap_env_body_get_type(void); +LASSO_EXPORT LassoNode* lasso_soap_env_body_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_ENV_BODY_H__ */ diff --git a/lasso/xml/soap-env_envelope.c b/lasso/xml/soap-env_envelope.c new file mode 100644 index 00000000..cd842ff2 --- /dev/null +++ b/lasso/xml/soap-env_envelope.c @@ -0,0 +1,102 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.com> + * + * 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/soap-env_envelope.h> + +/*****************************************************************************/ +/* public methods */ +/*****************************************************************************/ + +void +lasso_soap_env_envelope_add_body(LassoSoapEnvEnvelope *envelope, + LassoSoapEnvBody *body) +{ + g_assert(LASSO_IS_SOAP_ENV_ENVELOPE(envelope)); + g_assert(LASSO_IS_SOAP_ENV_BODY(body)); + + LassoNodeClass *class = LASSO_NODE_GET_CLASS(envelope); + class->add_child(LASSO_NODE(envelope), + LASSO_NODE(body), + FALSE); +} + +LassoNode * +lasso_soap_env_envelope_get_body(LassoSoapEnvEnvelope *envelope) +{ + LassoNode *body; + + g_assert(LASSO_IS_SOAP_ENV_ENVELOPE(envelope)); + + body = lasso_node_get_child(envelope, "Body"); + + return(body); +} + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +lasso_soap_env_envelope_instance_init(LassoSoapEnvEnvelope *node) +{ + LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node)); + + class->set_ns(LASSO_NODE(node), lassoSoapEnvHRef, + lassoSoapEnvPrefix); + class->set_name(LASSO_NODE(node), "Envelope"); +} + +static void +lasso_soap_env_envelope_class_init(LassoSoapEnvEnvelopeClass *klass) +{ +} + +GType lasso_soap_env_envelope_get_type() { + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapEnvEnvelopeClass), + NULL, + NULL, + (GClassInitFunc) lasso_soap_env_envelope_class_init, + NULL, + NULL, + sizeof(LassoSoapEnvEnvelope), + 0, + (GInstanceInitFunc) lasso_soap_env_envelope_instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE , + "LassoSoapEnvEnvelope", + &this_info, 0); + } + return this_type; +} + +LassoNode* lasso_soap_env_envelope_new() { + return LASSO_NODE(g_object_new(LASSO_TYPE_SOAP_ENV_ENVELOPE, + NULL)); +} diff --git a/lasso/xml/soap-env_envelope.h b/lasso/xml/soap-env_envelope.h new file mode 100644 index 00000000..c9005a69 --- /dev/null +++ b/lasso/xml/soap-env_envelope.h @@ -0,0 +1,63 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.com> + * Nicolas Clapies <nclapies@entrouvert.com> + * + * 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_SOAP_ENV_ENVELOPE_H__ +#define __LASSO_SOAP_ENV_ENVELOPE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> +#include <lasso/xml/soap-env_body.h> + +#define LASSO_TYPE_SOAP_ENV_ENVELOPE (lasso_soap_env_envelope_get_type()) +#define LASSO_SOAP_ENV_ENVELOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SOAP_ENV_ENVELOPE, LassoSoapEnvEnvelope)) +#define LASSO_SOAP_ENV_ENVELOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SOAP_ENV_ENVELOPE, LassoSoapEnvEnvelopeClass)) +#define LASSO_IS_SOAP_ENV_ENVELOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_ENV_ENVELOPE)) +#define LASSO_IS_SOAP_ENV_ENVELOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SOAP_ENV_ENVELOPE)) +#define LASSO_SOAP_ENV_ENVELOPE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SOAP_ENV_ENVELOPE, LassoSoapEnvEnvelopeClass)) + +typedef struct _LassoSoapEnvEnvelope LassoSoapEnvEnvelope; +typedef struct _LassoSoapEnvEnvelopeClass LassoSoapEnvEnvelopeClass; + +struct _LassoSoapEnvEnvelope { + LassoNode parent; + /*< private >*/ +}; + +struct _LassoSoapEnvEnvelopeClass { + LassoNodeClass parent; + /*< vtable >*/ +}; + +LASSO_EXPORT GType lasso_soap_env_envelope_get_type(void); +LASSO_EXPORT LassoNode* lasso_soap_env_envelope_new(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_ENV_ENVELOPE_H__ */ |
