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