1 /*
2  * Portions of this file Copyright 1999-2005 University of Chicago
3  * Portions of this file Copyright 1999-2005 The University of Southern California.
4  *
5  * This file or a portion of this file is licensed under the
6  * terms of the Globus Toolkit Public License, found at
7  * http://www.globus.org/toolkit/download/license.html.
8  * If you redistribute this file, with or without
9  * modifications, you must include this notice in the file.
10  */
11
12 #include "globus_i_xsd.h"
13 #include "globus_i_xsd_type_info.h"
14 #include "globus_soap_message.h"
15
16 GLOBUS_I_XSD_DEFINE_QNAME(xsd, hexBinary);
17 GLOBUS_I_XSD_DEFINE_TYPE_INFO(xsd_hexBinary);
18 0 GLOBUS_I_XSD_DEFINE_TYPE_FUNCTIONS(xsd_hexBinary);
19
20 0 GLOBUS_I_XSD_DEFINE_INIT_CONTENTS_GENERIC(xsd_hexBinary);
21
22 void
23 xsd_hexBinary_destroy_contents(
24     xsd_hexBinary *                     instance)
25 {
26 0     GlobusFuncName(xsd_hexBinary_destroy_contents);
27 0     GlobusSoapMessageDebugEnter();
28
29 0     if(instance)
30     {
31 0         if(instance->value)
32         {
33 0             free(instance->value);
34 0             instance->value = NULL;
35         }
36     }
37
38 0     GlobusSoapMessageDebugExit();
39 }
40
41 globus_result_t
42 xsd_hexBinary_copy_contents(
43     xsd_hexBinary *                     dest,
44     const xsd_hexBinary *               src)
45 0 {
46 0     globus_result_t                     result = GLOBUS_SUCCESS;
47 0     GlobusFuncName(xsd_hexBinary_copy_contents);
48 0     GlobusSoapMessageDebugEnter();
49
50 0     if(dest && src)
51     {
52 0         dest->length = src->length;
53 0         dest->value = globus_libc_strdup(src->value);
54 0         if(!dest->value)
55         {
56 0             result = GlobusSoapMessageErrorOutOfMemory;
57         }
58     }
59
60 0     GlobusSoapMessageDebugExit();
61
62 0     return result;
63 }
64
65 globus_result_t
66 xsd_hexBinary_serialize_contents(
67     xsd_QName *                         element,
68     xsd_hexBinary *                     instance,
69     globus_soap_message_handle_t        message_handle,
70     globus_xsd_element_options_t        options)
71 0 {
72 0     globus_result_t                     result = GLOBUS_SUCCESS;
73 0     GlobusFuncName(xsd_hexBinary_serialize_contents);
74 0     GlobusSoapMessageDebugEnter();
75
76     /* serialize contents of type */
77 0     result = globus_soap_message_serialize_hexBinary(
78         message_handle, instance);
79
80 0     GlobusSoapMessageDebugExit();
81 0     return result;
82 }
83
84 globus_result_t
85 xsd_hexBinary_deserialize_contents(
86     xsd_QName *                         eqn,
87     xsd_hexBinary *                     instance,
88     globus_soap_message_handle_t        message_handle,
89     globus_xsd_element_options_t        options)
90 0 {
91 0     globus_result_t                     result = GLOBUS_SUCCESS;
92 0     GlobusFuncName(xsd_hexBinary_deserialize_contents);
93 0     GlobusSoapMessageDebugEnter();
94     
95 0     result = globus_soap_message_deserialize_hexBinary(
96         message_handle, instance);
97
98 0     GlobusSoapMessageDebugExit();
99 0     return result;