| 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_soap_message.h" | |
| 18 | #include "xsd_IDREFS.h" | |
| 19 | ||
| 20 | /** | |
| 21 | * Initialize a xsd_IDREFS from a NULL-terminated character array. | |
| 22 | * @ingroup xsd_IDREFS | |
| 23 | * | |
| 24 | * Allocates a new xsd_IDREFS and sets it's value to be @a str. The | |
| 25 | * @a ip parameter will point to the new xsd_IDREFS when this function | |
| 26 | * returns successfully. | |
| 27 | * | |
| 28 | * @param ip | |
| 29 | * Pointer to hold the newly allocated xsd_IDREFS value. | |
| 30 | * @param str | |
| 31 | * Pointer to a character array allocated on the heap. The caller must | |
| 32 | * not free this value after this function is called. It will be freed | |
| 33 | * when the xsd_IDREFS pointed to by @a ip is destroyed. | |
| 34 | * | |
| 35 | * @retval GLOBUS_SUCCESS | |
| 36 | * Success. | |
| 37 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_NULL_PARAM | |
| 38 | * Null parameter. | |
| 39 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_OUT_OF_MEMORY | |
| 40 | * Out of memory. | |
| 41 | */ | |
| 42 | globus_result_t | |
| 43 | xsd_IDREFS_init_cstr( | |
| 44 | xsd_IDREFS ** ip, | |
| 45 | char * str) | |
| 46 | 0 | { |
| 47 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 48 | GlobusFuncName(xsd_IDREFS_init_cstr); | |
| 49 | 0 | GlobusSoapMessageDebugEnter(); |
| 50 | ||
| 51 | 0 | result = xsd_IDREFS_init(ip); |
| 52 | 0 | if(result == GLOBUS_SUCCESS) |
| 53 | { | |
| 54 | 0 | **ip = str; |
| 55 | } | |
| 56 | ||
| 57 | 0 | GlobusSoapMessageDebugExit(); |
| 58 | 0 | return result; |
| 59 | } | |
| 60 | /* xsd_IDREFS_init_cstr() */ | |
| 61 | ||
| 62 | /** | |
| 63 | * Initialize the contents of xsd_IDREFS from a NULL-terminated character array. | |
| 64 | * @ingroup xsd_IDREFS | |
| 65 | * | |
| 66 | * Initializes an already allocated xsd_IDREFS and sets it's value to be | |
| 67 | * @a str. | |
| 68 | * | |
| 69 | * @param instance | |
| 70 | * Allocated but uninitialized xsd_IDREFS value. | |
| 71 | * @param str | |
| 72 | * Pointer to a character array allocated on the heap. The caller must | |
| 73 | * not free this value after this function is called. It will be freed | |
| 74 | * when @a instance is destroyed by calling | |
| 75 | * xsd_IDREFS_destroy_contents(). | |
| 76 | * | |
| 77 | * @retval GLOBUS_SUCCESS | |
| 78 | * Success. | |
| 79 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_NULL_PARAM | |
| 80 | * Null parameter. | |
| 81 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_OUT_OF_MEMORY | |
| 82 | * Out of memory. | |
| 83 | */ | |
| 84 | globus_result_t | |
| 85 | xsd_IDREFS_init_contents_cstr( | |
| 86 | xsd_IDREFS * instance, | |
| 87 | char * str) | |
| 88 | 0 | { |
| 89 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 90 | GlobusFuncName(xsd_IDREFS_init_contents_cstr); | |
| 91 | 0 | GlobusSoapMessageDebugEnter(); |
| 92 | ||
| 93 | 0 | *instance = str; |
| 94 | ||
| 95 | 0 | GlobusSoapMessageDebugExit(); |
| 96 | 0 | return result; |
| 97 | } | |
| 98 | /* xsd_IDREFS_init_contents_cstr() */ | |
| 99 | ||
| 100 | ||
| 101 | /** | |
| 102 | * Initialize a xsd_IDREFS with a copy of a NULL-terminated character array. | |
| 103 | * @ingroup xsd_IDREFS | |
| 104 | * | |
| 105 | * Allocates a new xsd_IDREFS and sets it's value to be a newly allocated | |
| 106 | * copy of @a str. The @a ip parameter will point to the new xsd_IDREFS | |
| 107 | * when this function returns successfully. | |
| 108 | * | |
| 109 | * @param ip | |
| 110 | * Pointer to hold the newly allocated xsd_IDREFS value. | |
| 111 | * @param str | |
| 112 | * Pointer to a character array. The caller is responsible for freeing this | |
| 113 | * if it was allocated on the heap. | |
| 114 | * | |
| 115 | * @retval GLOBUS_SUCCESS | |
| 116 | * Success. | |
| 117 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_NULL_PARAM | |
| 118 | * Null parameter. | |
| 119 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_OUT_OF_MEMORY | |
| 120 | * Out of memory. | |
| 121 | */ | |
| 122 | globus_result_t | |
| 123 | xsd_IDREFS_copy_cstr( | |
| 124 | xsd_IDREFS ** ip, | |
| 125 | const char * str) | |
| 126 | 0 | { |
| 127 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 128 | GlobusFuncName(xsd_IDREFS_copy_cstr); | |
| 129 | 0 | GlobusSoapMessageDebugEnter(); |
| 130 | ||
| 131 | 0 | result = xsd_IDREFS_copy(ip, (const xsd_IDREFS *) &str); |
| 132 | ||
| 133 | 0 | GlobusSoapMessageDebugExit(); |
| 134 | 0 | return result; |
| 135 | } | |
| 136 | /* xsd_IDREFS_copy_cstr() */ | |
| 137 | ||
| 138 | /** | |
| 139 | * Initialize a xsd_IDREFS with a copy of a NULL-terminated character array. | |
| 140 | * @ingroup xsd_IDREFS | |
| 141 | * | |
| 142 | * Initializes a xsd_IDREFS and sets it's value to be a newly allocated | |
| 143 | * copy of @a str. | |
| 144 | * | |
| 145 | * @param instance | |
| 146 | * Pointer to the xsd_IDREFS. | |
| 147 | * @param str | |
| 148 | * Pointer to a character array. The caller is responsible for freeing this | |
| 149 | * if it was allocated on the heap. | |
| 150 | * | |
| 151 | * @retval GLOBUS_SUCCESS | |
| 152 | * Success. | |
| 153 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_NULL_PARAM | |
| 154 | * Null parameter. | |
| 155 | * @retval GLOBUS_SOAP_MESSAGE_ERROR_TYPE_OUT_OF_MEMORY | |
| 156 | * Out of memory. | |
| 157 | */ | |
| 158 | globus_result_t | |
| 159 | xsd_IDREFS_copy_contents_cstr( | |
| 160 | xsd_IDREFS * instance, | |
| 161 | const char * str) | |
| 162 | 0 | { |
| 163 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 164 | GlobusFuncName(xsd_IDREFS_copy_cstr); | |
| 165 | 0 | GlobusSoapMessageDebugEnter(); |
| 166 | ||
| 167 | 0 | result = xsd_IDREFS_copy_contents( |
| 168 | instance, (const xsd_IDREFS *) &str); | |
| 169 | ||
| 170 | 0 | GlobusSoapMessageDebugExit(); |
| 171 | 0 | return result; |
| 172 | } |