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
18 #include "xsd_nonPositiveInteger.h"
19 #include "globus_soap_message.h"
20
21 #include "globus_i_xsd.h"
22
23 GLOBUS_I_XSD_DEFINE_QNAME(xsd, nonPositiveInteger);
24 GLOBUS_I_XSD_DEFINE_TYPE_INFO(xsd_nonPositiveInteger);
25 0 GLOBUS_I_XSD_DEFINE_TYPE_FUNCTIONS(xsd_nonPositiveInteger);
26 0 GLOBUS_I_XSD_DEFINE_ATTR_FUNCTIONS(xsd_nonPositiveInteger, integer);
27
28 globus_result_t
29 xsd_nonPositiveInteger_init_contents(
30     xsd_nonPositiveInteger *            instance)
31 {
32 0     GlobusFuncName(xsd_nonPositiveInteger_init_contents);
33 0     GlobusSoapMessageDebugEnter();
34     
35 0     *instance = NULL;
36
37 0     GlobusSoapMessageDebugExit();
38 0     return GLOBUS_SUCCESS;
39 }
40
41 void
42 xsd_nonPositiveInteger_destroy_contents(
43     xsd_nonPositiveInteger *            instance)
44 0 {
45 0     GlobusFuncName(xsd_nonPositiveInteger_destroy_contents);
46 0     GlobusSoapMessageDebugEnter();
47
48 0     if (*instance)
49     {
50 0         BN_free(*instance);
51 0         *instance = NULL;
52     }
53
54 0     GlobusSoapMessageDebugExit();
55 }
56
57 globus_result_t
58 xsd_nonPositiveInteger_copy_contents(
59     xsd_nonPositiveInteger *            dest,
60     const xsd_nonPositiveInteger *      src)
61 0 {
62 0     globus_result_t                     result = GLOBUS_SUCCESS;
63 0     GlobusFuncName(xsd_nonPositiveInteger_copy_contents);
64 0     GlobusSoapMessageDebugEnter();
65
66 0     if(dest)
67     {
68 0         if(!src || !*src)
69         {
70 0             *dest = NULL;
71         }
72         else
73         {
74 0             *dest = BN_new();
75 0             if(!*dest || !BN_copy(*dest, *src))
76             {
77 0                 result = GlobusSoapMessageErrorOutOfMemory;
78             }
79         }
80     }
81
82 0     GlobusSoapMessageDebugExit();
83 0     return result;
84 }
85
86 globus_result_t
87 xsd_nonPositiveInteger_serialize_contents(
88     const xsd_QName *                   element,
89     const xsd_nonPositiveInteger *      instance,
90     globus_soap_message_handle_t        message_handle,
91     globus_xsd_element_options_t        options)
92 0 {
93 0     globus_result_t                     result = GLOBUS_SUCCESS;
94 0     GlobusFuncName(xsd_nonPositiveInteger_serialize_contents);
95 0     GlobusSoapMessageDebugEnter();
96
97     /* serialize contents of type */
98 0     result = globus_soap_message_serialize_positiveInteger(
99         message_handle, instance);
100
101 0     GlobusSoapMessageDebugExit();
102 0     return result;
103 }
104
105 globus_result_t
106 xsd_nonPositiveInteger_deserialize_contents(
107     const xsd_QName *                   eqn,
108     xsd_nonPositiveInteger *            instance,
109     globus_soap_message_handle_t        message_handle,
110     globus_xsd_element_options_t        options)
111 0 {
112 0     globus_result_t                     result = GLOBUS_SUCCESS;
113 0     GlobusFuncName(xsd_nonPositiveInteger_deserialize_contents);
114 0     GlobusSoapMessageDebugEnter();
115     
116 0     result = globus_soap_message_deserialize_positiveInteger(
117         message_handle, instance);
118
119 0     GlobusSoapMessageDebugExit();
120 0     return result;