| 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 | /* | |
| 19 | * This file is automatically generated from source-type-builtin.tmpl | |
| 20 | */ | |
| 21 | ||
| 22 | #include "globus_common.h" | |
| 23 | #include "globus_xsd_types.h" | |
| 24 | #include "globus_soap_message.h" | |
| 25 | #include "globus_xsd_type_info.h" | |
| 26 | #include "xsd_boolean.h" | |
| 27 | #include "globus_xsd_generic.h" | |
| 28 | #include "globus_xsd_generic_array.h" | |
| 29 | #include "globus_i_soap_message.h" | |
| 30 | #include "xsd_QName.h" | |
| 31 | #include "libxml/schemasInternals.h" | |
| 32 | #include "libxml/xmlschemastypes.h" | |
| 33 | ||
| 34 | /** | |
| 35 | * QName of the xsd_boolean builtin type | |
| 36 | * @ingroup xsd_boolean | |
| 37 | */ | |
| 38 | xsd_QName xsd_boolean_qname = | |
| 39 | { | |
| 40 | "http://www.w3.org/2001/XMLSchema", | |
| 41 | "boolean" | |
| 42 | ||
| 43 | }; | |
| 44 | ||
| 45 | #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL | |
| 46 | static | |
| 47 | globus_result_t | |
| 48 | xsd_boolean_serialize_wrapper( | |
| 49 | const xsd_QName * element_qname, | |
| 50 | const void * instance, | |
| 51 | globus_soap_message_handle_t message_handle, | |
| 52 | globus_xsd_element_options_t options) | |
| 53 | 35 | { |
| 54 | 35 | return xsd_boolean_serialize( |
| 55 | element_qname, | |
| 56 | (xsd_boolean *) instance, | |
| 57 | message_handle, options); | |
| 58 | } | |
| 59 | /* xsd_boolean_serialize_wrapper() */ | |
| 60 | ||
| 61 | static | |
| 62 | globus_result_t | |
| 63 | xsd_boolean_deserialize_pointer_wrapper( | |
| 64 | const xsd_QName * element_qname, | |
| 65 | void ** ip, | |
| 66 | globus_soap_message_handle_t message_handle, | |
| 67 | globus_xsd_element_options_t options) | |
| 68 | 6 | { |
| 69 | 6 | return xsd_boolean_deserialize_pointer( |
| 70 | element_qname, | |
| 71 | (xsd_boolean **) ip, | |
| 72 | message_handle, options); | |
| 73 | } | |
| 74 | /* xsd_boolean_deserialize_pointer_wrapper() */ | |
| 75 | ||
| 76 | static | |
| 77 | globus_result_t | |
| 78 | xsd_boolean_init_wrapper(void **object) | |
| 79 | 6 | { |
| 80 | 6 | return xsd_boolean_init( |
| 81 | (xsd_boolean **) object); | |
| 82 | } | |
| 83 | /* xsd_boolean_init_wrapper() */ | |
| 84 | ||
| 85 | static | |
| 86 | void | |
| 87 | xsd_boolean_destroy_wrapper( | |
| 88 | void * object) | |
| 89 | 197 | { |
| 90 | 197 | xsd_boolean_destroy( |
| 91 | (xsd_boolean *) object); | |
| 92 | 197 | } |
| 93 | /* xsd_boolean_destroy_wrapper() */ | |
| 94 | ||
| 95 | static | |
| 96 | globus_result_t | |
| 97 | xsd_boolean_copy_wrapper( | |
| 98 | void ** dest_obj, | |
| 99 | const void * src_obj) | |
| 100 | 16 | { |
| 101 | 16 | return xsd_boolean_copy( |
| 102 | (xsd_boolean **) dest_obj, | |
| 103 | (const xsd_boolean *) src_obj); | |
| 104 | } | |
| 105 | /* xsd_boolean_copy_wrapper() */ | |
| 106 | ||
| 107 | static | |
| 108 | globus_result_t | |
| 109 | xsd_boolean_init_contents_wrapper(void *object) | |
| 110 | 0 | { |
| 111 | 0 | return xsd_boolean_init_contents( |
| 112 | (xsd_boolean *) object); | |
| 113 | } | |
| 114 | /* xsd_boolean_init_contents_wrapper() */ | |
| 115 | ||
| 116 | static | |
| 117 | void | |
| 118 | xsd_boolean_destroy_contents_wrapper( | |
| 119 | void * object) | |
| 120 | 0 | { |
| 121 | 0 | xsd_boolean_destroy_contents( |
| 122 | (xsd_boolean *) object); | |
| 123 | 0 | } |
| 124 | /* xsd_boolean_destroy_contents_wrapper() */ | |
| 125 | ||
| 126 | static | |
| 127 | globus_result_t | |
| 128 | xsd_boolean_copy_contents_wrapper( | |
| 129 | void * dest_obj, | |
| 130 | const void * src_obj) | |
| 131 | 0 | { |
| 132 | 0 | return xsd_boolean_copy_contents( |
| 133 | (xsd_boolean *) dest_obj, | |
| 134 | (const xsd_boolean *) src_obj); | |
| 135 | } | |
| 136 | /* xsd_boolean_copy_contents_wrapper() */ | |
| 137 | ||
| 138 | static | |
| 139 | globus_result_t | |
| 140 | xsd_boolean_serialize_contents_wrapper( | |
| 141 | const xsd_QName * element_qname, | |
| 142 | const void * instance, | |
| 143 | globus_soap_message_handle_t message_handle, | |
| 144 | globus_xsd_element_options_t options) | |
| 145 | 41 | { |
| 146 | 41 | return xsd_boolean_serialize_contents( |
| 147 | element_qname, | |
| 148 | (xsd_boolean *) instance, | |
| 149 | message_handle, options); | |
| 150 | } | |
| 151 | /* xsd_boolean_serialize_contents_wrapper() */ | |
| 152 | ||
| 153 | static | |
| 154 | globus_result_t | |
| 155 | xsd_boolean_deserialize_contents_wrapper( | |
| 156 | const xsd_QName * element_qname, | |
| 157 | void ** instance, | |
| 158 | globus_soap_message_handle_t message_handle, | |
| 159 | globus_xsd_element_options_t options) | |
| 160 | 12 | { |
| 161 | globus_result_t result; | |
| 162 | 12 | globus_bool_t allocated = GLOBUS_FALSE; |
| 163 | GlobusFuncName(xsd_boolean_deserialize_contents_wrapper); | |
| 164 | 12 | GlobusSoapMessageDebugEnter(); |
| 165 | ||
| 166 | 12 | if(!*instance) |
| 167 | { | |
| 168 | 0 | result = xsd_boolean_init( |
| 169 | (xsd_boolean **)instance); | |
| 170 | 0 | if(result != GLOBUS_SUCCESS) |
| 171 | { | |
| 172 | 0 | goto error; |
| 173 | } | |
| 174 | 0 | allocated = GLOBUS_TRUE; |
| 175 | } | |
| 176 | ||
| 177 | 12 | result = xsd_boolean_deserialize_contents( |
| 178 | element_qname, | |
| 179 | *(xsd_boolean **)instance, | |
| 180 | message_handle, options); | |
| 181 | 12 | error: |
| 182 | 12 | if (result != GLOBUS_SUCCESS && allocated) |
| 183 | { | |
| 184 | 0 | xsd_boolean_destroy(*(xsd_boolean **)instance); |
| 185 | 0 | *instance = NULL; |
| 186 | } | |
| 187 | 12 | GlobusSoapMessageDebugExit(); |
| 188 | 12 | return result; |
| 189 | } | |
| 190 | /* xsd_boolean_deserialize_contents_wrapper() */ | |
| 191 | ||
| 192 | static | |
| 193 | globus_result_t | |
| 194 | xsd_boolean_array_serialize_wrapper( | |
| 195 | const xsd_QName * element, | |
| 196 | const void * instance, | |
| 197 | globus_soap_message_handle_t message, | |
| 198 | globus_xsd_element_options_t options) | |
| 199 | 0 | { |
| 200 | 0 | return xsd_boolean_array_serialize( |
| 201 | element, | |
| 202 | (xsd_boolean_array *) instance, | |
| 203 | message, options); | |
| 204 | } | |
| 205 | /* xsd_boolean_array_serialize_wrapper() */ | |
| 206 | ||
| 207 | static | |
| 208 | globus_result_t | |
| 209 | xsd_boolean_array_deserialize_wrapper( | |
| 210 | const xsd_QName * element_qname, | |
| 211 | void ** inst, | |
| 212 | globus_soap_message_handle_t message, | |
| 213 | globus_xsd_element_options_t options) | |
| 214 | 0 | { |
| 215 | 0 | globus_bool_t allocated = GLOBUS_FALSE; |
| 216 | ||
| 217 | globus_result_t result; | |
| 218 | 0 | if(!*inst) |
| 219 | { | |
| 220 | 0 | result = xsd_boolean_array_init( |
| 221 | (xsd_boolean_array **)inst); | |
| 222 | 0 | if(result != GLOBUS_SUCCESS) |
| 223 | { | |
| 224 | 0 | return result; |
| 225 | } | |
| 226 | 0 | allocated = GLOBUS_TRUE; |
| 227 | } | |
| 228 | ||
| 229 | 0 | result = xsd_boolean_array_deserialize( |
| 230 | element_qname, | |
| 231 | *(xsd_boolean_array **) inst, | |
| 232 | message, options); | |
| 233 | 0 | if (result != GLOBUS_SUCCESS && allocated) |
| 234 | { | |
| 235 | 0 | xsd_boolean_array_destroy(*(xsd_boolean_array **) inst); |
| 236 | 0 | *inst = NULL; |
| 237 | } | |
| 238 | 0 | return result; |
| 239 | } | |
| 240 | /* xsd_boolean_array_deserialize_wrapper() */ | |
| 241 | ||
| 242 | static | |
| 243 | globus_result_t | |
| 244 | xsd_boolean_array_init_wrapper( | |
| 245 | void ** arr) | |
| 246 | 0 | { |
| 247 | 0 | return xsd_boolean_array_init( |
| 248 | (xsd_boolean_array **) arr); | |
| 249 | } | |
| 250 | /* xsd_boolean_array_init_wrapper() */ | |
| 251 | ||
| 252 | static | |
| 253 | void | |
| 254 | xsd_boolean_array_destroy_wrapper( | |
| 255 | void * arr) | |
| 256 | 0 | { |
| 257 | 0 | xsd_boolean_array_destroy( |
| 258 | (xsd_boolean_array *) arr); | |
| 259 | 0 | } |
| 260 | /* xsd_boolean_array_destroy_wrapper() */ | |
| 261 | ||
| 262 | static | |
| 263 | globus_result_t | |
| 264 | xsd_boolean_array_copy_wrapper( | |
| 265 | void ** dest_arr, | |
| 266 | const void * src_arr) | |
| 267 | 0 | { |
| 268 | 0 | return xsd_boolean_array_copy( |
| 269 | (xsd_boolean_array **) dest_arr, | |
| 270 | (const xsd_boolean_array *) src_arr); | |
| 271 | } | |
| 272 | /* xsd_boolean_array_copy_wrapper() */ | |
| 273 | ||
| 274 | static | |
| 275 | globus_result_t | |
| 276 | xsd_boolean_array_init_contents_wrapper( | |
| 277 | void * arr) | |
| 278 | 0 | { |
| 279 | 0 | return xsd_boolean_array_init_contents( |
| 280 | (xsd_boolean_array *) arr); | |
| 281 | } | |
| 282 | /* xsd_boolean_array_init_contents_wrapper() */ | |
| 283 | ||
| 284 | static | |
| 285 | void | |
| 286 | xsd_boolean_array_destroy_contents_wrapper( | |
| 287 | void * arr) | |
| 288 | 0 | { |
| 289 | 0 | xsd_boolean_array_destroy_contents( |
| 290 | (xsd_boolean_array *) arr); | |
| 291 | 0 | } |
| 292 | /* xsd_boolean_array_destroy_contents_wrapper() */ | |
| 293 | ||
| 294 | static | |
| 295 | globus_result_t | |
| 296 | xsd_boolean_array_copy_contents_wrapper( | |
| 297 | void * dest_arr, | |
| 298 | const void * src_arr) | |
| 299 | 0 | { |
| 300 | 0 | return xsd_boolean_array_copy_contents( |
| 301 | (xsd_boolean_array *) dest_arr, | |
| 302 | (const xsd_boolean_array *) src_arr); | |
| 303 | } | |
| 304 | /* xsd_boolean_array_copy_contents_wrapper() */ | |
| 305 | ||
| 306 | static | |
| 307 | void * | |
| 308 | xsd_boolean_array_push_wrapper( | |
| 309 | void * array) | |
| 310 | 0 | { |
| 311 | 0 | return (void *) xsd_boolean_array_push((xsd_boolean_array *) array); |
| 312 | } | |
| 313 | /* xsd_boolean_array_push_wrapper() */ | |
| 314 | #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ | |
| 315 | ||
| 316 | /** | |
| 317 | * Type info for xsd_boolean | |
| 318 | * @ingroup xsd_boolean | |
| 319 | * This type info is used when serializing/deserializing an xsd:any | |
| 320 | * which contains array values of this type. | |
| 321 | */ | |
| 322 | struct globus_xsd_type_info_s xsd_boolean_array_info = | |
| 323 | { | |
| 324 | &xsd_boolean_qname, | |
| 325 | xsd_boolean_array_serialize_wrapper, | |
| 326 | xsd_boolean_array_deserialize_wrapper, | |
| 327 | xsd_boolean_array_init_wrapper, | |
| 328 | xsd_boolean_array_destroy_wrapper, | |
| 329 | xsd_boolean_array_copy_wrapper, | |
| 330 | xsd_boolean_array_init_contents_wrapper, | |
| 331 | xsd_boolean_array_destroy_contents_wrapper, | |
| 332 | xsd_boolean_array_copy_contents_wrapper, | |
| 333 | sizeof(xsd_boolean), | |
| 334 | xsd_boolean_array_push_wrapper, | |
| 335 | NULL, | |
| 336 | NULL | |
| 337 | }; | |
| 338 | ||
| 339 | /** | |
| 340 | * Type info for xsd_boolean | |
| 341 | * @ingroup xsd_boolean | |
| 342 | * This type info is used when serializing/deserializing an xsd:anyType | |
| 343 | * which contains values of this type. | |
| 344 | */ | |
| 345 | struct globus_xsd_type_info_s xsd_boolean_contents_info = | |
| 346 | { | |
| 347 | &xsd_boolean_qname, | |
| 348 | xsd_boolean_serialize_contents_wrapper, | |
| 349 | xsd_boolean_deserialize_contents_wrapper, | |
| 350 | xsd_boolean_init_wrapper, | |
| 351 | xsd_boolean_destroy_wrapper, | |
| 352 | xsd_boolean_copy_wrapper, | |
| 353 | xsd_boolean_init_contents_wrapper, | |
| 354 | xsd_boolean_destroy_contents_wrapper, | |
| 355 | xsd_boolean_copy_contents_wrapper, | |
| 356 | sizeof(xsd_boolean), | |
| 357 | NULL, | |
| 358 | NULL, | |
| 359 | NULL | |
| 360 | }; | |
| 361 | ||
| 362 | /** | |
| 363 | * Type info for xsd_boolean | |
| 364 | * @ingroup xsd_boolean | |
| 365 | * This type info is used when serializing/deserializing an xsd:any | |
| 366 | * which contains values of this type. | |
| 367 | */ | |
| 368 | struct globus_xsd_type_info_s xsd_boolean_info = | |
| 369 | { | |
| 370 | &xsd_boolean_qname, | |
| 371 | xsd_boolean_serialize_wrapper, | |
| 372 | xsd_boolean_deserialize_pointer_wrapper, | |
| 373 | xsd_boolean_init_wrapper, | |
| 374 | xsd_boolean_destroy_wrapper, | |
| 375 | xsd_boolean_copy_wrapper, | |
| 376 | xsd_boolean_init_contents_wrapper, | |
| 377 | xsd_boolean_destroy_contents_wrapper, | |
| 378 | xsd_boolean_copy_contents_wrapper, | |
| 379 | sizeof(xsd_boolean), | |
| 380 | NULL, | |
| 381 | &xsd_boolean_contents_info, | |
| 382 | &xsd_boolean_array_info | |
| 383 | }; | |
| 384 | ||
| 385 | ||
| 386 | /** | |
| 387 | * Initialize the contents of a xsd_boolean | |
| 388 | * @ingroup xsd_boolean | |
| 389 | * | |
| 390 | * Initialize the contents of a xsd_boolean. This should be used | |
| 391 | * when the structure is allocated on the stack or by a some allocator besides | |
| 392 | * xsd_boolean_init(). The contents may be freed | |
| 393 | * by calling xsd_boolean_destroy_contents(). | |
| 394 | * | |
| 395 | * @param instance | |
| 396 | * Pointer to an allocated but uninitialized xsd_boolean. | |
| 397 | */ | |
| 398 | globus_result_t | |
| 399 | xsd_boolean_init_contents( | |
| 400 | xsd_boolean * instance) | |
| 401 | 778 | { |
| 402 | 778 | globus_result_t result = GLOBUS_SUCCESS; |
| 403 | GlobusFuncName(xsd_boolean_init_contents); | |
| 404 | 778 | GlobusSoapMessageDebugEnter(); |
| 405 | ||
| 406 | 778 | memset(instance, 0, sizeof(xsd_boolean)); |
| 407 | ||
| 408 | 778 | GlobusSoapMessageDebugExit(); |
| 409 | 778 | return result; |
| 410 | } | |
| 411 | ||
| 412 | ||
| 413 | ||
| 414 | /** | |
| 415 | * Initialize a xsd_boolean | |
| 416 | * @ingroup xsd_boolean | |
| 417 | * | |
| 418 | * Allocates a new xsd_boolean and initializes its contents. When the | |
| 419 | * structure is no longer needed, it should be freed by calling | |
| 420 | * xsd_boolean_destroy(). | |
| 421 | * | |
| 422 | * @param object | |
| 423 | * Pointer to set to a newly allocated instance. | |
| 424 | */ | |
| 425 | globus_result_t | |
| 426 | xsd_boolean_init( | |
| 427 | xsd_boolean ** object) | |
| 428 | 778 | { |
| 429 | 778 | globus_result_t result = GLOBUS_SUCCESS; |
| 430 | GlobusFuncName(xsd_boolean_init); | |
| 431 | 778 | GlobusSoapMessageDebugEnter(); |
| 432 | ||
| 433 | 778 | *object = malloc(sizeof(xsd_boolean)); |
| 434 | 778 | if (*object == NULL) |
| 435 | { | |
| 436 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 437 | ||
| 438 | 0 | goto exit; |
| 439 | } | |
| 440 | 778 | result = xsd_boolean_init_contents(*object); |
| 441 | 778 | if (result != GLOBUS_SUCCESS) |
| 442 | { | |
| 443 | 0 | free(*object); |
| 444 | 0 | *object = NULL; |
| 445 | } | |
| 446 | 778 | exit: |
| 447 | 778 | GlobusSoapMessageDebugExit(); |
| 448 | 778 | return result; |
| 449 | } | |
| 450 | /* xsd_boolean_init() */ | |
| 451 | ||
| 452 | ||
| 453 | ||
| 454 | /** | |
| 455 | * Destroy a xsd_boolean | |
| 456 | * @ingroup xsd_boolean | |
| 457 | * | |
| 458 | * Frees a xsd_boolean. | |
| 459 | * | |
| 460 | * @param instance | |
| 461 | * Pointer to the instance to destroy. | |
| 462 | */ | |
| 463 | void | |
| 464 | xsd_boolean_destroy( | |
| 465 | xsd_boolean * instance) | |
| 466 | 1996 | { |
| 467 | GlobusFuncName(xsd_boolean_destroy); | |
| 468 | 1996 | GlobusSoapMessageDebugEnter(); |
| 469 | ||
| 470 | 1996 | if(!instance) |
| 471 | { | |
| 472 | 647 | goto exit; |
| 473 | } | |
| 474 | ||
| 475 | 1349 | xsd_boolean_destroy_contents(instance); |
| 476 | 1349 | free(instance); |
| 477 | ||
| 478 | 1996 | exit: |
| 479 | ||
| 480 | 1996 | GlobusSoapMessageDebugExit(); |
| 481 | 1996 | } |
| 482 | /* xsd_boolean_destroy() */ | |
| 483 | ||
| 484 | ||
| 485 | ||
| 486 | /** | |
| 487 | * Destroy the contents of a xsd_boolean | |
| 488 | * @ingroup xsd_boolean | |
| 489 | * | |
| 490 | * Destroy the the given xsd_boolean. | |
| 491 | * | |
| 492 | * @param instance | |
| 493 | * Pointer to a xsd_boolean instance to destroy. | |
| 494 | */ | |
| 495 | void | |
| 496 | xsd_boolean_destroy_contents( | |
| 497 | xsd_boolean * instance) | |
| 498 | 1349 | { |
| 499 | GlobusFuncName(xsd_boolean_destroy_contents); | |
| 500 | 1349 | GlobusSoapMessageDebugEnter(); |
| 501 | ||
| 502 | 1349 | GlobusSoapMessageDebugExit(); |
| 503 | 1349 | } |
| 504 | /* xsd_boolean_destroy_contents() */ | |
| 505 | ||
| 506 | ||
| 507 | ||
| 508 | ||
| 509 | /** | |
| 510 | * Copy a xsd_boolean | |
| 511 | * @ingroup xsd_boolean | |
| 512 | * | |
| 513 | * Perform a copy of a xsd_boolean. | |
| 514 | * The @a dest_obj will be allocated, and then a copy of the contents | |
| 515 | * of @a src to it. The caller is responsible for destroying @a dest_objb | |
| 516 | * | |
| 517 | * @param dest_obj | |
| 518 | * The xsd_boolean to be initialized with a copy of the | |
| 519 | * contents of the @a src_obj structure. | |
| 520 | * @param src_obj | |
| 521 | * Source xsd_boolean to be copied. | |
| 522 | */ | |
| 523 | globus_result_t | |
| 524 | xsd_boolean_copy( | |
| 525 | xsd_boolean ** dest_obj, | |
| 526 | const xsd_boolean * src_obj) | |
| 527 | 664 | { |
| 528 | 664 | globus_result_t result = GLOBUS_SUCCESS; |
| 529 | xsd_boolean * instance; | |
| 530 | GlobusFuncName(xsd_boolean_copy); | |
| 531 | ||
| 532 | 664 | GlobusSoapMessageDebugEnter(); |
| 533 | ||
| 534 | 664 | instance = malloc(sizeof(xsd_boolean)); |
| 535 | 664 | if (instance == NULL) |
| 536 | { | |
| 537 | 0 | GlobusSoapMessageDebugExit(); |
| 538 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 539 | } | |
| 540 | ||
| 541 | 664 | result = xsd_boolean_copy_contents(instance, src_obj); |
| 542 | 664 | if(result != GLOBUS_SUCCESS) |
| 543 | { | |
| 544 | 0 | free(instance); |
| 545 | 0 | instance = NULL; |
| 546 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 547 | } | |
| 548 | ||
| 549 | 664 | *dest_obj = instance; |
| 550 | 664 | GlobusSoapMessageDebugExit(); |
| 551 | 664 | return result; |
| 552 | } | |
| 553 | /* xsd_boolean_copy() */ | |
| 554 | ||
| 555 | ||
| 556 | ||
| 557 | /** | |
| 558 | * Copy the contents of a xsd_boolean | |
| 559 | * @ingroup xsd_boolean | |
| 560 | * | |
| 561 | * Perform a copy of the contents of a xsd_boolean. | |
| 562 | * The @a dest_obj value must point to a previously-allocated xsd_boolean. | |
| 563 | * A copy of value @ src_obj will be made to | |
| 564 | * @a dest_obj. | |
| 565 | * | |
| 566 | * @param dest_obj | |
| 567 | * Structure to be initialized with copies of the contents of @a src_obj. | |
| 568 | * @param src_obj | |
| 569 | * Source xsd_boolean to be copied. | |
| 570 | */ | |
| 571 | globus_result_t | |
| 572 | xsd_boolean_copy_contents( | |
| 573 | xsd_boolean * dest_obj, | |
| 574 | const xsd_boolean * src_obj) | |
| 575 | 664 | { |
| 576 | 664 | globus_result_t result = GLOBUS_SUCCESS; |
| 577 | GlobusFuncName(xsd_boolean_copy_contents); | |
| 578 | ||
| 579 | 664 | GlobusSoapMessageDebugEnter(); |
| 580 | ||
| 581 | ||
| 582 | 664 | *dest_obj = *src_obj; |
| 583 | ||
| 584 | ||
| 585 | 664 | GlobusSoapMessageDebugExit(); |
| 586 | 664 | return result; |
| 587 | } | |
| 588 | /* xsd_boolean_copy_contents() */ | |
| 589 | ||
| 590 | ||
| 591 | /** | |
| 592 | * @fn globus_result_t xsd_boolean_serialize_contents(const xsd_QName *element_qname, const xsd_boolean * inst, globus_soap_message_handle_t message_handle, globus_xsd_element_options_t options) | |
| 593 | * Serialize the contents of a xsd_boolean | |
| 594 | * @ingroup xsd_boolean | |
| 595 | * Serialize a xsd_boolean without an enclosing element. | |
| 596 | * | |
| 597 | * @param element_qname | |
| 598 | * Ignored parameter. | |
| 599 | * @param inst | |
| 600 | * The xsd_boolean to serialize. | |
| 601 | * @param message_handle | |
| 602 | * The handle to serialize the contents on. | |
| 603 | * @param options | |
| 604 | * Serialization options. | |
| 605 | */ | |
| 606 | ||
| 607 | globus_result_t | |
| 608 | xsd_boolean_serialize_contents( | |
| 609 | const xsd_QName * element_qname, /* ignored */ | |
| 610 | const xsd_boolean * inst, | |
| 611 | globus_soap_message_handle_t message_handle, | |
| 612 | globus_xsd_element_options_t options) | |
| 613 | 41 | { |
| 614 | 41 | globus_result_t result = GLOBUS_SUCCESS; |
| 615 | GlobusFuncName(xsd_boolean_serialize_contents); | |
| 616 | 41 | GlobusSoapMessageDebugEnter(); |
| 617 | ||
| 618 | ||
| 619 | 41 | result = globus_soap_message_serialize_boolean( |
| 620 | message_handle, | |
| 621 | inst); | |
| 622 | 41 | if(result != GLOBUS_SUCCESS) |
| 623 | { | |
| 624 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 625 | result, NULL, element_qname); | |
| 626 | } | |
| 627 | ||
| 628 | ||
| 629 | 41 | GlobusSoapMessageDebugExit(); |
| 630 | 41 | return result; |
| 631 | } | |
| 632 | /* xsd_boolean_serialize_contents() */ | |
| 633 | ||
| 634 | ||
| 635 | ||
| 636 | globus_result_t | |
| 637 | xsd_boolean_serialize( | |
| 638 | const xsd_QName * element_qname, | |
| 639 | const xsd_boolean * instance, | |
| 640 | globus_soap_message_handle_t message_handle, | |
| 641 | globus_xsd_element_options_t options) | |
| 642 | 41 | { |
| 643 | 41 | globus_result_t result = GLOBUS_SUCCESS; |
| 644 | GlobusFuncName(xsd_boolean_serialize); | |
| 645 | 41 | GlobusSoapMessageDebugEnter(); |
| 646 | ||
| 647 | 41 | result = globus_xsd_generic_serialize( |
| 648 | element_qname, | |
| 649 | &xsd_boolean_info, | |
| 650 | instance, | |
| 651 | message_handle, | |
| 652 | options); | |
| 653 | ||
| 654 | 41 | return result; |
| 655 | } | |
| 656 | /* xsd_boolean_serialize() */ | |
| 657 | ||
| 658 | ||
| 659 | ||
| 660 | globus_result_t | |
| 661 | xsd_boolean_deserialize_contents( | |
| 662 | const xsd_QName * element_qname, /* ignored */ | |
| 663 | xsd_boolean * inst, | |
| 664 | globus_soap_message_handle_t message_handle, | |
| 665 | globus_xsd_element_options_t options) | |
| 666 | 12 | { |
| 667 | 12 | globus_result_t result = GLOBUS_SUCCESS; |
| 668 | GlobusFuncName(xsd_boolean_deserialize_contents); | |
| 669 | 12 | GlobusSoapMessageDebugEnter(); |
| 670 | ||
| 671 | ||
| 672 | 12 | if (options & GLOBUS_XSD_ELEMENT_ATTRIBUTE) |
| 673 | { | |
| 674 | 0 | result = globus_soap_message_deserialize_boolean_attribute( |
| 675 | message_handle, element_qname, inst); | |
| 676 | } | |
| 677 | else | |
| 678 | { | |
| 679 | 12 | result = globus_soap_message_deserialize_boolean( |
| 680 | message_handle, inst); | |
| 681 | } | |
| 682 | ||
| 683 | ||
| 684 | 12 | GlobusSoapMessageDebugExit(); |
| 685 | 12 | return result; |
| 686 | } | |
| 687 | /* xsd_boolean_deserialize_contents() */ | |
| 688 | ||
| 689 | ||
| 690 | ||
| 691 | globus_result_t | |
| 692 | xsd_boolean_deserialize( | |
| 693 | const xsd_QName * element_qname, | |
| 694 | xsd_boolean * instance, | |
| 695 | globus_soap_message_handle_t message_handle, | |
| 696 | globus_xsd_element_options_t options) | |
| 697 | 6 | { |
| 698 | 6 | globus_result_t result = GLOBUS_SUCCESS; |
| 699 | GlobusFuncName(xsd_boolean_deserialize); | |
| 700 | 6 | GlobusSoapMessageDebugEnter(); |
| 701 | ||
| 702 | 6 | result = globus_xsd_generic_deserialize( |
| 703 | element_qname, | |
| 704 | &xsd_boolean_info, | |
| 705 | (void **) &instance, | |
| 706 | message_handle, | |
| 707 | options); | |
| 708 | ||
| 709 | 6 | GlobusSoapMessageDebugExit(); |
| 710 | 6 | return result; |
| 711 | } | |
| 712 | /* xsd_boolean_deserialize() */ | |
| 713 | ||
| 714 | globus_result_t | |
| 715 | xsd_boolean_deserialize_pointer( | |
| 716 | const xsd_QName * element_qname, | |
| 717 | xsd_boolean ** ip, | |
| 718 | globus_soap_message_handle_t message_handle, | |
| 719 | globus_xsd_element_options_t options) | |
| 720 | 140 | { |
| 721 | 140 | globus_result_t result = GLOBUS_SUCCESS; |
| 722 | GlobusFuncName(xsd_boolean_deserialize_pointer); | |
| 723 | 140 | GlobusSoapMessageDebugEnter(); |
| 724 | ||
| 725 | 140 | result = globus_xsd_generic_deserialize_pointer( |
| 726 | element_qname, | |
| 727 | &xsd_boolean_info, | |
| 728 | (void **)ip, | |
| 729 | message_handle, | |
| 730 | options); | |
| 731 | ||
| 732 | 140 | return result; |
| 733 | } | |
| 734 | /* xsd_boolean_deserialize_pointer() */ | |
| 735 | ||
| 736 | ||
| 737 | ||
| 738 | globus_result_t | |
| 739 | xsd_boolean_array_init_contents( | |
| 740 | xsd_boolean_array * array) | |
| 741 | 0 | { |
| 742 | GlobusFuncName(xsd_boolean_array_init_contents); | |
| 743 | 0 | GlobusSoapMessageDebugEnter(); |
| 744 | ||
| 745 | 0 | array->elements = NULL; |
| 746 | 0 | array->length = 0; |
| 747 | 0 | array->type_info = &xsd_boolean_info; |
| 748 | ||
| 749 | 0 | GlobusSoapMessageDebugExit(); |
| 750 | 0 | return GLOBUS_SUCCESS; |
| 751 | } | |
| 752 | /* xsd_boolean_array_init_contents() */ | |
| 753 | ||
| 754 | ||
| 755 | ||
| 756 | globus_result_t | |
| 757 | xsd_boolean_array_init( | |
| 758 | xsd_boolean_array ** arr) | |
| 759 | 0 | { |
| 760 | 0 | return globus_xsd_generic_array_init( |
| 761 | (globus_xsd_generic_array_t **) arr, | |
| 762 | &xsd_boolean_info); | |
| 763 | } | |
| 764 | /* xsd_boolean_array_init() */ | |
| 765 | ||
| 766 | ||
| 767 | ||
| 768 | void | |
| 769 | xsd_boolean_array_destroy_contents( | |
| 770 | xsd_boolean_array * array) | |
| 771 | 0 | { |
| 772 | 0 | globus_xsd_generic_array_destroy_contents( |
| 773 | (globus_xsd_generic_array_t *) array); | |
| 774 | 0 | } |
| 775 | /* xsd_boolean_array_destroy_contents() */ | |
| 776 | ||
| 777 | ||
| 778 | ||
| 779 | void | |
| 780 | xsd_boolean_array_destroy( | |
| 781 | xsd_boolean_array * array) | |
| 782 | 0 | { |
| 783 | ||
| 784 | 0 | globus_xsd_generic_array_destroy( |
| 785 | (globus_xsd_generic_array_t *) array); | |
| 786 | 0 | } |
| 787 | /* xsd_boolean_array_destroy() */ | |
| 788 | ||
| 789 | ||
| 790 | ||
| 791 | ||
| 792 | globus_result_t | |
| 793 | xsd_boolean_array_copy( | |
| 794 | xsd_boolean_array ** dest_arr, | |
| 795 | const xsd_boolean_array * src_arr) | |
| 796 | 0 | { |
| 797 | 0 | return globus_xsd_generic_array_copy( |
| 798 | (globus_xsd_generic_array_t **) dest_arr, | |
| 799 | (const globus_xsd_generic_array_t *) src_arr); | |
| 800 | } | |
| 801 | /* xsd_boolean_array_copy() */ | |
| 802 | ||
| 803 | ||
| 804 | ||
| 805 | globus_result_t | |
| 806 | xsd_boolean_array_copy_contents( | |
| 807 | xsd_boolean_array * dest_arr, | |
| 808 | const xsd_boolean_array * src_arr) | |
| 809 | 0 | { |
| 810 | 0 | return globus_xsd_generic_array_copy_contents( |
| 811 | (globus_xsd_generic_array_t *) dest_arr, | |
| 812 | (const globus_xsd_generic_array_t *) src_arr); | |
| 813 | } | |
| 814 | /* xsd_boolean_array_copy_contents() */ | |
| 815 | ||
| 816 | ||
| 817 | ||
| 818 | xsd_boolean * | |
| 819 | xsd_boolean_array_push( | |
| 820 | xsd_boolean_array * array) | |
| 821 | 0 | { |
| 822 | /* Some contents initializers don't initialize subelments but to set their | |
| 823 | * values to be NULL | |
| 824 | */ | |
| 825 | 0 | if (array->type_info == NULL) |
| 826 | { | |
| 827 | 0 | array->type_info = &xsd_boolean_info; |
| 828 | } | |
| 829 | 0 | return globus_xsd_generic_array_push( |
| 830 | (globus_xsd_generic_array_t *) array); | |
| 831 | } | |
| 832 | /* xsd_boolean_array_push() */ | |
| 833 | ||
| 834 | ||
| 835 | ||
| 836 | globus_result_t | |
| 837 | xsd_boolean_array_serialize( | |
| 838 | const xsd_QName * element_qname, | |
| 839 | const xsd_boolean_array * array, | |
| 840 | globus_soap_message_handle_t message, | |
| 841 | globus_xsd_element_options_t options) | |
| 842 | 0 | { |
| 843 | 0 | return globus_xsd_generic_array_serialize( |
| 844 | element_qname, | |
| 845 | (const globus_xsd_generic_array_t *) array, | |
| 846 | message, | |
| 847 | options); | |
| 848 | } | |
| 849 | /* xsd_boolean_array_serialize() */ | |
| 850 | ||
| 851 | ||
| 852 | ||
| 853 | ||
| 854 | globus_result_t | |
| 855 | xsd_boolean_array_deserialize( | |
| 856 | const xsd_QName * element_qname, | |
| 857 | xsd_boolean_array * array, | |
| 858 | globus_soap_message_handle_t message, | |
| 859 | globus_xsd_element_options_t options) | |
| 860 | 0 | { |
| 861 | /* Some initializers set the array contents to NULL */ | |
| 862 | 0 | if (array->type_info == NULL) |
| 863 | { | |
| 864 | 0 | array->type_info = &xsd_boolean_info; |
| 865 | } | |
| 866 | ||
| 867 | 0 | return globus_xsd_generic_array_deserialize( |
| 868 | element_qname, | |
| 869 | (globus_xsd_generic_array_t *) array, | |
| 870 | message, | |
| 871 | options); | |
| 872 | } | |
| 873 | /* xsd_boolean_array_deserialize() */ | |
| 874 | ||
| 875 | ||
| 876 | ||
| 877 | globus_result_t | |
| 878 | xsd_boolean_serialize_attribute( | |
| 879 | const xsd_QName * attr_qname, | |
| 880 | const xsd_boolean * val, | |
| 881 | globus_soap_message_handle_t handle, | |
| 882 | globus_xsd_element_options_t options) | |
| 883 | 162 | { |
| 884 | 162 | globus_result_t result = GLOBUS_SUCCESS; |
| 885 | GlobusFuncName(xsd_boolean_serialize_attribute); | |
| 886 | 162 | GlobusSoapMessageDebugEnter(); |
| 887 | ||
| 888 | 162 | result = globus_soap_message_serialize_boolean_attribute( |
| 889 | handle, attr_qname, val); | |
| 890 | 162 | if(result != GLOBUS_SUCCESS) |
| 891 | { | |
| 892 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 893 | result, NULL, attr_qname); | |
| 894 | 0 | goto exit; |
| 895 | } | |
| 896 | 162 | exit: |
| 897 | ||
| 898 | 162 | GlobusSoapMessageDebugExit(); |
| 899 | 162 | return result; |
| 900 | } | |
| 901 | /* xsd_boolean_serialize_attribute() */ | |
| 902 | ||
| 903 | ||
| 904 | ||
| 905 | ||
| 906 | globus_result_t | |
| 907 | xsd_boolean_deserialize_attribute( | |
| 908 | const xsd_QName * attr_qname, | |
| 909 | xsd_boolean * instance, | |
| 910 | globus_soap_message_handle_t message, | |
| 911 | globus_xsd_element_options_t options) | |
| 912 | 0 | { |
| 913 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 914 | GlobusFuncName(xsd_boolean_deserialize_attribute); | |
| 915 | 0 | GlobusSoapMessageDebugEnter(); |
| 916 | ||
| 917 | 0 | result = globus_soap_message_deserialize_boolean_attribute( |
| 918 | message, attr_qname, instance); | |
| 919 | ||
| 920 | 0 | if(result != GLOBUS_SUCCESS) |
| 921 | { | |
| 922 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 923 | result, attr_qname); | |
| 924 | } | |
| 925 | ||
| 926 | 0 | GlobusSoapMessageDebugExit(); |
| 927 | 0 | return result; |
| 928 | } | |
| 929 | /* xsd_boolean_deserialize_attribute() */ | |
| 930 | ||
| 931 | ||
| 932 | ||
| 933 | globus_result_t | |
| 934 | xsd_boolean_deserialize_attribute_pointer( | |
| 935 | const xsd_QName * attr_qname, | |
| 936 | xsd_boolean ** ip, | |
| 937 | globus_soap_message_handle_t message, | |
| 938 | globus_xsd_element_options_t options) | |
| 939 | 504 | { |
| 940 | 504 | xsd_boolean * instance = NULL; |
| 941 | 504 | globus_result_t result = GLOBUS_SUCCESS; |
| 942 | GlobusFuncName(xsd_boolean_deserialize_attribute_pointer); | |
| 943 | 504 | GlobusSoapMessageDebugEnter(); |
| 944 | ||
| 945 | ||
| 946 | 504 | result = xsd_boolean_init(&instance); |
| 947 | ||
| 948 | 504 | if (result != GLOBUS_SUCCESS) |
| 949 | { | |
| 950 | 0 | goto exit; |
| 951 | } | |
| 952 | ||
| 953 | 504 | result = globus_soap_message_deserialize_boolean_attribute( |
| 954 | message, | |
| 955 | attr_qname, | |
| 956 | instance); | |
| 957 | ||
| 958 | 504 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 959 | { | |
| 960 | 180 | result = GLOBUS_SUCCESS; |
| 961 | 180 | xsd_boolean_destroy(instance); |
| 962 | 180 | instance = NULL; |
| 963 | goto exit; | |
| 964 | } | |
| 965 | ||
| 966 | 504 | exit: |
| 967 | 504 | *ip = instance; |
| 968 | ||
| 969 | 504 | GlobusSoapMessageDebugExit(); |
| 970 | 504 | return result; |
| 971 | } | |
| 972 | /* xsd_boolean_deserialize_attribute_pointer() */ | |
| 973 | ||
| 974 | ||
| 975 | ||
| 976 | globus_result_t | |
| 977 | xsd_boolean_list_serialize( | |
| 978 | const xsd_QName * element_qname, | |
| 979 | const xsd_boolean_array * inst, | |
| 980 | globus_soap_message_handle_t message_handle, | |
| 981 | globus_xsd_element_options_t options) | |
| 982 | 0 | { |
| 983 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 984 | GlobusFuncName(xsd_boolean_list_serialize); | |
| 985 | 0 | GlobusSoapMessageDebugEnter(); |
| 986 | ||
| 987 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 988 | { | |
| 989 | /* add begin element */ | |
| 990 | 0 | result = globus_soap_message_element_ns_set( |
| 991 | message_handle, | |
| 992 | element_qname, | |
| 993 | element_qname->Namespace, | |
| 994 | &options); | |
| 995 | 0 | if(result != GLOBUS_SUCCESS) |
| 996 | { | |
| 997 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 998 | result, NULL, element_qname); | |
| 999 | 0 | goto exit; |
| 1000 | } | |
| 1001 | ||
| 1002 | 0 | result = globus_soap_message_serialize_element( |
| 1003 | message_handle, | |
| 1004 | element_qname, | |
| 1005 | options, | |
| 1006 | &xsd_boolean_qname); | |
| 1007 | 0 | if(result != GLOBUS_SUCCESS) |
| 1008 | { | |
| 1009 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1010 | result, NULL, element_qname); | |
| 1011 | 0 | goto exit; |
| 1012 | } | |
| 1013 | ||
| 1014 | 0 | if(options & GLOBUS_XSD_ELEMENT_TYPE_ATTR && |
| 1015 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 1016 | { | |
| 1017 | xsd_QName type_attr; | |
| 1018 | 0 | type_attr.local = "type"; |
| 1019 | 0 | type_attr.Namespace = |
| 1020 | "http://www.w3.org/2001/XMLSchema-instance"; | |
| 1021 | 0 | result = globus_soap_message_serialize_QName_attribute( |
| 1022 | message_handle, | |
| 1023 | &type_attr, | |
| 1024 | &xsd_boolean_qname); | |
| 1025 | 0 | if(result != GLOBUS_SUCCESS) |
| 1026 | { | |
| 1027 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1028 | result, NULL, element_qname); | |
| 1029 | 0 | goto exit; |
| 1030 | } | |
| 1031 | } | |
| 1032 | ||
| 1033 | 0 | result = globus_soap_message_serialize_element_begin_close( |
| 1034 | message_handle, element_qname); | |
| 1035 | 0 | if(result != GLOBUS_SUCCESS) |
| 1036 | { | |
| 1037 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1038 | result, NULL, element_qname); | |
| 1039 | 0 | goto exit; |
| 1040 | } | |
| 1041 | } | |
| 1042 | ||
| 1043 | 0 | result = xsd_boolean_list_serialize_contents( |
| 1044 | inst, | |
| 1045 | message_handle, | |
| 1046 | options); | |
| 1047 | 0 | if(result != GLOBUS_SUCCESS) |
| 1048 | { | |
| 1049 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1050 | result, NULL, element_qname); | |
| 1051 | 0 | goto exit; |
| 1052 | } | |
| 1053 | ||
| 1054 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1055 | { | |
| 1056 | /* add end element */ | |
| 1057 | 0 | result = globus_soap_message_serialize_element_end( |
| 1058 | message_handle, | |
| 1059 | element_qname, | |
| 1060 | options, | |
| 1061 | &xsd_boolean_qname); | |
| 1062 | 0 | if(result != GLOBUS_SUCCESS) |
| 1063 | { | |
| 1064 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1065 | result, NULL, element_qname); | |
| 1066 | 0 | goto exit; |
| 1067 | } | |
| 1068 | ||
| 1069 | 0 | globus_soap_message_element_ns_remove( |
| 1070 | message_handle, | |
| 1071 | element_qname->Namespace, | |
| 1072 | &options); | |
| 1073 | } | |
| 1074 | ||
| 1075 | 0 | exit: |
| 1076 | ||
| 1077 | 0 | GlobusSoapMessageDebugExit(); |
| 1078 | 0 | return result; |
| 1079 | } | |
| 1080 | ||
| 1081 | ||
| 1082 | ||
| 1083 | ||
| 1084 | globus_result_t | |
| 1085 | xsd_boolean_list_serialize_contents( | |
| 1086 | const xsd_boolean_array * inst, | |
| 1087 | globus_soap_message_handle_t message_handle, | |
| 1088 | globus_xsd_element_options_t options) | |
| 1089 | 0 | { |
| 1090 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1091 | GlobusFuncName(xsd_boolean_list_serialize_contents); | |
| 1092 | 0 | GlobusSoapMessageDebugEnter(); |
| 1093 | ||
| 1094 | 0 | result = globus_soap_message_serialize_boolean_list( |
| 1095 | message_handle, | |
| 1096 | inst); | |
| 1097 | 0 | if(result != GLOBUS_SUCCESS) |
| 1098 | { | |
| 1099 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1100 | result, "could not serialize as list", &xsd_boolean_qname); | |
| 1101 | 0 | goto exit; |
| 1102 | } | |
| 1103 | ||
| 1104 | 0 | exit: |
| 1105 | ||
| 1106 | 0 | GlobusSoapMessageDebugExit(); |
| 1107 | 0 | return result; |
| 1108 | } | |
| 1109 | /* xsd_boolean_list_serialize_contents() */ | |
| 1110 | ||
| 1111 | ||
| 1112 | ||
| 1113 | globus_result_t | |
| 1114 | xsd_boolean_list_serialize_attribute( | |
| 1115 | const xsd_QName * attr_qname, | |
| 1116 | const xsd_boolean_array * inst, | |
| 1117 | globus_soap_message_handle_t message_handle, | |
| 1118 | globus_xsd_element_options_t options) | |
| 1119 | 0 | { |
| 1120 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1121 | GlobusFuncName(xsd_boolean_list_serialize_attribute); | |
| 1122 | 0 | GlobusSoapMessageDebugEnter(); |
| 1123 | ||
| 1124 | 0 | result = globus_soap_message_serialize_boolean_attribute_list( |
| 1125 | message_handle, | |
| 1126 | attr_qname, | |
| 1127 | inst); | |
| 1128 | 0 | if(result != GLOBUS_SUCCESS) |
| 1129 | { | |
| 1130 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1131 | result, NULL, attr_qname); | |
| 1132 | 0 | goto exit; |
| 1133 | } | |
| 1134 | ||
| 1135 | 0 | exit: |
| 1136 | ||
| 1137 | 0 | GlobusSoapMessageDebugExit(); |
| 1138 | 0 | return result; |
| 1139 | } | |
| 1140 | /* xsd_boolean_list_serialize_attribute() */ | |
| 1141 | ||
| 1142 | ||
| 1143 | ||
| 1144 | globus_result_t | |
| 1145 | xsd_boolean_list_deserialize_attribute( | |
| 1146 | const xsd_QName * attr_qname, | |
| 1147 | xsd_boolean_array * ip, | |
| 1148 | globus_soap_message_handle_t message_handle, | |
| 1149 | globus_xsd_element_options_t options) | |
| 1150 | 0 | { |
| 1151 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1152 | GlobusFuncName(xsd_boolean_list_deserialize_attribute); | |
| 1153 | 0 | GlobusSoapMessageDebugEnter(); |
| 1154 | ||
| 1155 | 0 | result = |
| 1156 | globus_soap_message_deserialize_boolean_attribute_list( | |
| 1157 | message_handle, attr_qname, ip); | |
| 1158 | 0 | if(result != GLOBUS_SUCCESS) |
| 1159 | { | |
| 1160 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1161 | result, attr_qname); | |
| 1162 | } | |
| 1163 | ||
| 1164 | 0 | return result; |
| 1165 | } | |
| 1166 | /* xsd_boolean_list_deserialize_attribute() */ | |
| 1167 | ||
| 1168 | ||
| 1169 | ||
| 1170 | globus_result_t | |
| 1171 | xsd_boolean_list_deserialize( | |
| 1172 | const xsd_QName * element_qname, | |
| 1173 | xsd_boolean_array * ip, | |
| 1174 | globus_soap_message_handle_t message_handle, | |
| 1175 | globus_xsd_element_options_t options) | |
| 1176 | 0 | { |
| 1177 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1178 | GlobusFuncName(xsd_boolean_list_deserialize); | |
| 1179 | 0 | GlobusSoapMessageDebugEnter(); |
| 1180 | ||
| 1181 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1182 | { | |
| 1183 | 0 | result = globus_soap_message_deserialize_element( |
| 1184 | message_handle, element_qname); | |
| 1185 | 0 | if(result != GLOBUS_SUCCESS) |
| 1186 | { | |
| 1187 | 0 | goto error_exit; |
| 1188 | } | |
| 1189 | ||
| 1190 | 0 | result = |
| 1191 | globus_soap_message_deserialize_element_begin_close( | |
| 1192 | message_handle); | |
| 1193 | 0 | if(result != GLOBUS_SUCCESS) |
| 1194 | { | |
| 1195 | 0 | goto error_exit; |
| 1196 | } | |
| 1197 | } | |
| 1198 | ||
| 1199 | 0 | result = |
| 1200 | xsd_boolean_list_deserialize_contents( | |
| 1201 | ip, message_handle, options); | |
| 1202 | 0 | if(result != GLOBUS_SUCCESS) |
| 1203 | { | |
| 1204 | 0 | goto error_exit; |
| 1205 | } | |
| 1206 | ||
| 1207 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1208 | { | |
| 1209 | 0 | result = |
| 1210 | globus_soap_message_deserialize_element_end( | |
| 1211 | message_handle, | |
| 1212 | element_qname); | |
| 1213 | 0 | if(result != GLOBUS_SUCCESS) |
| 1214 | { | |
| 1215 | 0 | goto error_exit; |
| 1216 | } | |
| 1217 | } | |
| 1218 | ||
| 1219 | 0 | goto exit; |
| 1220 | ||
| 1221 | 0 | error_exit: |
| 1222 | ||
| 1223 | 0 | if(!GlobusSoapMessageStatusCheck(result)) |
| 1224 | { | |
| 1225 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1226 | result, element_qname); | |
| 1227 | } | |
| 1228 | ||
| 1229 | 0 | exit: |
| 1230 | ||
| 1231 | 0 | GlobusSoapMessageDebugExit(); |
| 1232 | 0 | return result; |
| 1233 | } | |
| 1234 | /* xsd_boolean_list_deserialize() */ | |
| 1235 | ||
| 1236 | ||
| 1237 | ||
| 1238 | globus_result_t | |
| 1239 | xsd_boolean_list_deserialize_contents( | |
| 1240 | xsd_boolean_array * ip, | |
| 1241 | globus_soap_message_handle_t message_handle, | |
| 1242 | globus_xsd_element_options_t options) | |
| 1243 | 0 | { |
| 1244 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1245 | GlobusFuncName(xsd_boolean_list_deserialize_contents); | |
| 1246 | 0 | GlobusSoapMessageDebugEnter(); |
| 1247 | ||
| 1248 | 0 | result = |
| 1249 | globus_soap_message_deserialize_boolean_list( | |
| 1250 | message_handle, ip); | |
| 1251 | if(result != GLOBUS_SUCCESS) | |
| 1252 | { | |
| 1253 | 0 | goto exit; |
| 1254 | } | |
| 1255 | ||
| 1256 | 0 | exit: |
| 1257 | ||
| 1258 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1259 | result, &xsd_boolean_qname); | |
| 1260 | 0 | return result; |
| 1261 | } | |
| 1262 | /* xsd_boolean_list_deserialize_contents() */ | |
| 1263 | ||
| 1264 | ||
| 1265 | ||
| 1266 | globus_result_t | |
| 1267 | globus_soap_message_serialize_boolean( | |
| 1268 | globus_soap_message_handle_t handle, | |
| 1269 | const xsd_boolean * val) | |
| 1270 | 11405 | { |
| 1271 | 11405 | int res = 0; |
| 1272 | 11405 | globus_result_t result = GLOBUS_SUCCESS; |
| 1273 | GlobusFuncName(globus_soap_message_serialize_boolean); | |
| 1274 | 11405 | GlobusSoapMessageDebugEnter(); |
| 1275 | ||
| 1276 | ||
| 1277 | 11405 | res = xmlTextWriterWriteString( |
| 1278 | handle->writer, | |
| 1279 | (xmlChar *) (*val ? "true" : "false")); | |
| 1280 | 11405 | if(res < 0) |
| 1281 | { | |
| 1282 | 0 | xmlErrorPtr err = xmlGetLastError(); |
| 1283 | 0 | GlobusSoapMessageErrorSerializeFailed( |
| 1284 | GLOBUS_SUCCESS, (err ? err->message : ""), | |
| 1285 | &xsd_boolean_qname); | |
| 1286 | 0 | goto exit; |
| 1287 | } | |
| 1288 | ||
| 1289 | ||
| 1290 | 11405 | exit: |
| 1291 | ||
| 1292 | 11405 | GlobusSoapMessageDebugExit(); |
| 1293 | 11405 | return result; |
| 1294 | } | |
| 1295 | /* globus_soap_message_serialize_boolean() */ | |
| 1296 | ||
| 1297 | globus_result_t | |
| 1298 | globus_soap_message_deserialize_boolean( | |
| 1299 | globus_soap_message_handle_t handle, | |
| 1300 | xsd_boolean * val) | |
| 1301 | 12 | { |
| 1302 | 12 | globus_result_t result = GLOBUS_SUCCESS; |
| 1303 | const xmlChar * content; | |
| 1304 | const xmlChar * content_save; | |
| 1305 | GlobusFuncName(globus_soap_message_deserialize_boolean); | |
| 1306 | 12 | GlobusSoapMessageDebugEnter(); |
| 1307 | ||
| 1308 | 12 | result = globus_i_soap_message_deserialize_next_content(handle); |
| 1309 | 12 | if(result != GLOBUS_SUCCESS) |
| 1310 | { | |
| 1311 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1312 | result, &xsd_boolean_qname); | |
| 1313 | 0 | goto exit; |
| 1314 | } | |
| 1315 | ||
| 1316 | 12 | content = xmlTextReaderConstValue(handle->reader); |
| 1317 | 12 | if (!content) |
| 1318 | { | |
| 1319 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1320 | GLOBUS_SUCCESS, &xsd_boolean_qname); | |
| 1321 | } | |
| 1322 | 12 | content_save = content; |
| 1323 | { | |
| 1324 | ||
| 1325 | { | |
| 1326 | 12 | if(!xmlStrcmp(content, (xmlChar *) "false")) |
| 1327 | { | |
| 1328 | 9 | *val = 0; |
| 1329 | } | |
| 1330 | else | |
| 1331 | { | |
| 1332 | 3 | *val = 1; |
| 1333 | } | |
| 1334 | } | |
| 1335 | ||
| 1336 | } | |
| 1337 | ||
| 1338 | 12 | exit: |
| 1339 | 12 | GlobusSoapMessageDebugExit(); |
| 1340 | 12 | return result; |
| 1341 | } | |
| 1342 | /* globus_soap_message_deserialize_boolean() */ | |
| 1343 | ||
| 1344 | globus_result_t | |
| 1345 | globus_soap_message_serialize_boolean_list( | |
| 1346 | globus_soap_message_handle_t handle, | |
| 1347 | const xsd_boolean_array * inst) | |
| 1348 | 0 | { |
| 1349 | 0 | int i = 0; |
| 1350 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1351 | int res; | |
| 1352 | GlobusFuncName(globus_soap_message_serialize_string_list); | |
| 1353 | 0 | GlobusSoapMessageDebugEnter(); |
| 1354 | ||
| 1355 | 0 | for(i = 0; i < inst->length; ++i) |
| 1356 | { | |
| 1357 | 0 | result = globus_soap_message_serialize_boolean( |
| 1358 | handle, | |
| 1359 | &inst->elements[i]); | |
| 1360 | ||
| 1361 | 0 | if (result != GLOBUS_SUCCESS) |
| 1362 | { | |
| 1363 | 0 | goto exit; |
| 1364 | } | |
| 1365 | ||
| 1366 | 0 | if (i != (inst->length-1)) |
| 1367 | { | |
| 1368 | 0 | res = xmlTextWriterWriteString(handle->writer, (xmlChar *) " "); |
| 1369 | 0 | if(res < 0) |
| 1370 | { | |
| 1371 | 0 | xmlErrorPtr err = xmlGetLastError(); |
| 1372 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1373 | (handle->result ? handle->result : GLOBUS_SUCCESS), | |
| 1374 | (err ? err->message : ""), | |
| 1375 | &xsd_boolean_qname); | |
| 1376 | 0 | goto exit; |
| 1377 | } | |
| 1378 | } | |
| 1379 | } | |
| 1380 | ||
| 1381 | 0 | exit: |
| 1382 | ||
| 1383 | 0 | GlobusSoapMessageDebugExit(); |
| 1384 | 0 | return result; |
| 1385 | } | |
| 1386 | /* globus_soap_message_serialize_boolean_list() */ | |
| 1387 | ||
| 1388 | globus_result_t | |
| 1389 | globus_soap_message_deserialize_boolean_list( | |
| 1390 | globus_soap_message_handle_t handle, | |
| 1391 | xsd_boolean_array * array_val) | |
| 1392 | 0 | { |
| 1393 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1394 | 0 | xmlChar * content_value = NULL; |
| 1395 | 0 | xmlChar * content = NULL; |
| 1396 | char * saveptr; | |
| 1397 | xsd_boolean * val; | |
| 1398 | GlobusFuncName(globus_soap_message_deserialize_boolean_list); | |
| 1399 | 0 | GlobusSoapMessageDebugEnter(); |
| 1400 | ||
| 1401 | 0 | result = globus_i_soap_message_deserialize_next_content(handle); |
| 1402 | 0 | if(result != GLOBUS_SUCCESS) |
| 1403 | { | |
| 1404 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1405 | result, &xsd_boolean_qname); | |
| 1406 | 0 | goto exit; |
| 1407 | } | |
| 1408 | ||
| 1409 | 0 | content_value = xmlTextReaderValue(handle->reader); |
| 1410 | 0 | if (!content_value) |
| 1411 | { | |
| 1412 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1413 | GLOBUS_SUCCESS, &xsd_boolean_qname); | |
| 1414 | 0 | goto exit; |
| 1415 | } | |
| 1416 | ||
| 1417 | 0 | for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n", &saveptr); |
| 1418 | 0 | content != NULL; |
| 1419 | 0 | content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr)) |
| 1420 | { | |
| 1421 | 0 | val = xsd_boolean_array_push(array_val); |
| 1422 | { | |
| 1423 | ||
| 1424 | { | |
| 1425 | 0 | if(!xmlStrcmp(content, (xmlChar *) "false")) |
| 1426 | { | |
| 1427 | 0 | *val = 0; |
| 1428 | } | |
| 1429 | else | |
| 1430 | { | |
| 1431 | 0 | *val = 1; |
| 1432 | } | |
| 1433 | } | |
| 1434 | ||
| 1435 | } | |
| 1436 | } | |
| 1437 | ||
| 1438 | 0 | exit: |
| 1439 | 0 | if (content_value != NULL) |
| 1440 | { | |
| 1441 | 0 | xmlFree(content_value); |
| 1442 | } | |
| 1443 | 0 | if (result != GLOBUS_SUCCESS) |
| 1444 | { | |
| 1445 | 0 | xsd_boolean_array_destroy_contents(array_val); |
| 1446 | } | |
| 1447 | 0 | GlobusSoapMessageDebugExit(); |
| 1448 | 0 | return result; |
| 1449 | } | |
| 1450 | /* globus_soap_message_deserialize_boolean_list() */ | |
| 1451 | ||
| 1452 | globus_result_t | |
| 1453 | globus_soap_message_serialize_boolean_attribute( | |
| 1454 | globus_soap_message_handle_t handle, | |
| 1455 | const xsd_QName * attr_name, | |
| 1456 | const xsd_boolean * val) | |
| 1457 | 11364 | { |
| 1458 | 11364 | globus_result_t result = GLOBUS_SUCCESS; |
| 1459 | GlobusFuncName(globus_soap_message_serialize_boolean_attribute); | |
| 1460 | 11364 | GlobusSoapMessageDebugEnter(); |
| 1461 | ||
| 1462 | 11364 | if (val == NULL) |
| 1463 | { | |
| 1464 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1465 | ||
| 1466 | 0 | goto exit; |
| 1467 | } | |
| 1468 | ||
| 1469 | 11364 | result = globus_soap_message_serialize_attribute( |
| 1470 | handle, | |
| 1471 | attr_name); | |
| 1472 | 11364 | if (result != GLOBUS_SUCCESS) |
| 1473 | { | |
| 1474 | 0 | goto exit; |
| 1475 | } | |
| 1476 | ||
| 1477 | 11364 | result = globus_soap_message_serialize_boolean( |
| 1478 | handle, | |
| 1479 | val); | |
| 1480 | 11364 | if(result != GLOBUS_SUCCESS) |
| 1481 | { | |
| 1482 | 0 | goto exit; |
| 1483 | } | |
| 1484 | ||
| 1485 | 11364 | result = globus_soap_message_serialize_attribute_end( |
| 1486 | handle, | |
| 1487 | attr_name); | |
| 1488 | ||
| 1489 | 11364 | exit: |
| 1490 | ||
| 1491 | 11364 | GlobusSoapMessageDebugExit(); |
| 1492 | 11364 | return result; |
| 1493 | } | |
| 1494 | /* globus_soap_message_serialize_boolean_attribute() */ | |
| 1495 | ||
| 1496 | globus_result_t | |
| 1497 | globus_soap_message_deserialize_boolean_attribute( | |
| 1498 | globus_soap_message_handle_t handle, | |
| 1499 | const xsd_QName * attr_qname, | |
| 1500 | xsd_boolean * val) | |
| 1501 | 504 | { |
| 1502 | 504 | globus_result_t result = GLOBUS_SUCCESS; |
| 1503 | 504 | xmlChar * content = NULL; |
| 1504 | 504 | xmlChar * content_save = NULL; |
| 1505 | GlobusFuncName(globus_soap_message_deserialize_boolean_attribute); | |
| 1506 | 504 | GlobusSoapMessageDebugEnter(); |
| 1507 | ||
| 1508 | 504 | if (val == NULL || attr_qname == NULL || attr_qname->local == NULL) |
| 1509 | { | |
| 1510 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1511 | ||
| 1512 | 0 | goto exit; |
| 1513 | } | |
| 1514 | ||
| 1515 | 504 | result = globus_soap_message_deserialize_attribute( |
| 1516 | handle, | |
| 1517 | attr_qname, | |
| 1518 | &content); | |
| 1519 | 504 | if (result != GLOBUS_SUCCESS) |
| 1520 | { | |
| 1521 | 180 | goto exit; |
| 1522 | } | |
| 1523 | 324 | content_save = content; |
| 1524 | ||
| 1525 | { | |
| 1526 | ||
| 1527 | { | |
| 1528 | 324 | if(!xmlStrcmp(content, (xmlChar *) "false")) |
| 1529 | { | |
| 1530 | 228 | *val = 0; |
| 1531 | } | |
| 1532 | else | |
| 1533 | { | |
| 1534 | 96 | *val = 1; |
| 1535 | } | |
| 1536 | } | |
| 1537 | ||
| 1538 | } | |
| 1539 | 504 | exit: |
| 1540 | 504 | if (content_save != NULL) |
| 1541 | { | |
| 1542 | 324 | xmlFree(content_save); |
| 1543 | } | |
| 1544 | ||
| 1545 | 504 | GlobusSoapMessageDebugExit(); |
| 1546 | 504 | return result; |
| 1547 | } | |
| 1548 | /* globus_soap_message_deserialize_boolean_attribute() */ | |
| 1549 | ||
| 1550 | globus_result_t | |
| 1551 | globus_soap_message_serialize_boolean_attribute_list( | |
| 1552 | globus_soap_message_handle_t handle, | |
| 1553 | const xsd_QName * attr_name, | |
| 1554 | const xsd_boolean_array * val) | |
| 1555 | 0 | { |
| 1556 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1557 | GlobusFuncName(globus_soap_message_serialize_boolean_attribute_list); | |
| 1558 | 0 | GlobusSoapMessageDebugEnter(); |
| 1559 | ||
| 1560 | 0 | if (val == NULL) |
| 1561 | { | |
| 1562 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1563 | ||
| 1564 | 0 | goto exit; |
| 1565 | } | |
| 1566 | ||
| 1567 | 0 | result = globus_soap_message_serialize_attribute( |
| 1568 | handle, | |
| 1569 | attr_name); | |
| 1570 | 0 | if (result != GLOBUS_SUCCESS) |
| 1571 | { | |
| 1572 | 0 | goto exit; |
| 1573 | } | |
| 1574 | ||
| 1575 | 0 | result = globus_soap_message_serialize_boolean_list( |
| 1576 | handle, | |
| 1577 | val); | |
| 1578 | ||
| 1579 | 0 | if(result != GLOBUS_SUCCESS) |
| 1580 | { | |
| 1581 | 0 | goto exit; |
| 1582 | } | |
| 1583 | ||
| 1584 | 0 | result = globus_soap_message_serialize_attribute_end( |
| 1585 | handle, | |
| 1586 | attr_name); | |
| 1587 | ||
| 1588 | 0 | exit: |
| 1589 | ||
| 1590 | 0 | GlobusSoapMessageDebugExit(); |
| 1591 | 0 | return result; |
| 1592 | } | |
| 1593 | /* globus_soap_message_serialize_boolean_attribute_list() */ | |
| 1594 | ||
| 1595 | globus_result_t | |
| 1596 | globus_soap_message_deserialize_boolean_attribute_list( | |
| 1597 | globus_soap_message_handle_t handle, | |
| 1598 | const xsd_QName * attr_qname, | |
| 1599 | xsd_boolean_array * list_val) | |
| 1600 | 0 | { |
| 1601 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1602 | 0 | xmlChar * content_value = NULL; |
| 1603 | 0 | xmlChar * content = NULL; |
| 1604 | char * saveptr; | |
| 1605 | xsd_boolean * val; | |
| 1606 | GlobusFuncName(globus_soap_message_deserialize_boolean_attribute_list); | |
| 1607 | 0 | GlobusSoapMessageDebugEnter(); |
| 1608 | ||
| 1609 | 0 | if (list_val == NULL || attr_qname == NULL || attr_qname->local == NULL) |
| 1610 | { | |
| 1611 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1612 | ||
| 1613 | 0 | goto exit; |
| 1614 | } | |
| 1615 | ||
| 1616 | 0 | result = globus_soap_message_deserialize_attribute( |
| 1617 | handle, | |
| 1618 | attr_qname, | |
| 1619 | &content_value); | |
| 1620 | 0 | if (result != GLOBUS_SUCCESS) |
| 1621 | { | |
| 1622 | 0 | goto exit; |
| 1623 | } | |
| 1624 | ||
| 1625 | for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n", | |
| 1626 | 0 | &saveptr); |
| 1627 | 0 | content != NULL; |
| 1628 | 0 | content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr)) |
| 1629 | { | |
| 1630 | 0 | val = xsd_boolean_array_push(list_val); |
| 1631 | { | |
| 1632 | ||
| 1633 | { | |
| 1634 | 0 | if(!xmlStrcmp(content, (xmlChar *) "false")) |
| 1635 | { | |
| 1636 | 0 | *val = 0; |
| 1637 | } | |
| 1638 | else | |
| 1639 | { | |
| 1640 | 0 | *val = 1; |
| 1641 | } | |
| 1642 | } | |
| 1643 | ||
| 1644 | } | |
| 1645 | } | |
| 1646 | 0 | exit: |
| 1647 | 0 | if (content_value != NULL) |
| 1648 | { | |
| 1649 | 0 | xmlFree(content_value); |
| 1650 | } | |
| 1651 | 0 | if (result != GLOBUS_SUCCESS) |
| 1652 | { | |
| 1653 | 0 | xsd_boolean_array_destroy_contents(list_val); |
| 1654 | } | |
| 1655 | ||
| 1656 | 0 | GlobusSoapMessageDebugExit(); |
| 1657 | 0 | return result; |
| 1658 | } |