1 /*
2  * Copyright 1999-2006 University of Chicago
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "globus_i_xsd.h"
18 #include "globus_i_xsd_type_info.h"
19 #include "globus_soap_message.h"
20
21 GLOBUS_I_XSD_DEFINE_QNAME(xsd, hexBinary);
22 GLOBUS_I_XSD_DEFINE_TYPE_INFO(xsd_hexBinary);
23 0 GLOBUS_I_XSD_DEFINE_TYPE_FUNCTIONS(xsd_hexBinary);
24
25 0 GLOBUS_I_XSD_DEFINE_INIT_CONTENTS_GENERIC(xsd_hexBinary);
26
27 void
28 xsd_hexBinary_destroy_contents(
29     xsd_hexBinary *                     instance)
30 {
31 0     GlobusFuncName(xsd_hexBinary_destroy_contents);
32 0     GlobusSoapMessageDebugEnter();
33
34 0     if(instance)
35     {
36 0         if(instance->value)
37         {
38 0             free(instance->value);
39 0             instance->value = NULL;
40         }
41     }
42
43 0     GlobusSoapMessageDebugExit();
44 }
45
46 globus_result_t
47 xsd_hexBinary_copy_contents(
48     xsd_hexBinary *                     dest,
49     const xsd_hexBinary *               src)
50 0 {
51 0     globus_result_t                     result = GLOBUS_SUCCESS;
52 0     GlobusFuncName(xsd_hexBinary_copy_contents);
53 0     GlobusSoapMessageDebugEnter();
54
55 0     if(dest && src)
56     {
57 0         dest->length = src->length;
58 0         dest->value = globus_libc_strdup(src->value);
59 0         if(!dest->value)
60         {
61 0             result = GlobusSoapMessageErrorOutOfMemory;
62         }
63     }
64
65 0     GlobusSoapMessageDebugExit();
66
67 0     return result;
68 }
69
70 globus_result_t
71 xsd_hexBinary_serialize_contents(
72     const xsd_QName *                   element,
73     const xsd_hexBinary *               instance,
74     globus_soap_message_handle_t        message_handle,
75     globus_xsd_element_options_t        options)
76 0 {
77 0     globus_result_t                     result = GLOBUS_SUCCESS;
78 0     GlobusFuncName(xsd_hexBinary_serialize_contents);
79 0     GlobusSoapMessageDebugEnter();
80
81     /* serialize contents of type */
82 0     result = globus_soap_message_serialize_hexBinary(
83         message_handle, instance);
84
85 0     GlobusSoapMessageDebugExit();
86 0     return result;
87 }
88
89 globus_result_t
90 xsd_hexBinary_deserialize_contents(
91     const xsd_QName *                   eqn,
92     xsd_hexBinary *                     instance,
93     globus_soap_message_handle_t        message_handle,
94     globus_xsd_element_options_t        options)
95 0 {
96 0     globus_result_t                     result = GLOBUS_SUCCESS;
97 0     GlobusFuncName(xsd_hexBinary_deserialize_contents);
98 0     GlobusSoapMessageDebugEnter();
99     
100 0     result = globus_soap_message_deserialize_hexBinary(
101         message_handle, instance);
102
103 0     GlobusSoapMessageDebugExit();
104 0     return result;