You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. duration.h
  3. Custom serializer for xsd:duration stored in a LONG64 with ms precision
  4. - a LONG64 int can represent 106751991167 days forward and backward
  5. - LONG64 is long long int under Unix/Linux
  6. - millisecond resolution (1/1000 sec) means 1 second = 1000
  7. - when adding to a time_t value, conversion may be needed since time_t
  8. may (or may) not have seconds resolution
  9. - durations longer than a month are always output in days, rather than
  10. months to avoid days-per-month conversion inacurracies
  11. - durations expressed in years and months are not well defined, since
  12. there is no reference starting time; the decoder assumes 30 days per
  13. month and conversion of P4M gives 120 days and therefore the duration
  14. P4M and P120D are assumed identical, while they should give different
  15. results depending on the reference starting time
  16. #import this file into your gSOAP .h file
  17. To automate the wsdl2h-mapping of xsd:dateTime to struct tm, add this
  18. line to the typemap.dat file:
  19. xsd__duration = #import "custom/duration.h" | xsd__duration
  20. The typemap.dat file is used by wsdl2h to map types (wsdl2h option -t).
  21. Compile and link your code with custom/duration.c
  22. gSOAP XML Web services tools
  23. Copyright (C) 2000-2009, Robert van Engelen, Genivia Inc., All Rights Reserved.
  24. This part of the software is released under ONE of the following licenses:
  25. GPL, the gSOAP public license, OR Genivia's license for commercial use.
  26. --------------------------------------------------------------------------------
  27. gSOAP public license.
  28. The contents of this file are subject to the gSOAP Public License Version 1.3
  29. (the "License"); you may not use this file except in compliance with the
  30. License. You may obtain a copy of the License at
  31. http://www.cs.fsu.edu/~engelen/soaplicense.html
  32. Software distributed under the License is distributed on an "AS IS" basis,
  33. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  34. for the specific language governing rights and limitations under the License.
  35. The Initial Developer of the Original Code is Robert A. van Engelen.
  36. Copyright (C) 2000-2009, Robert van Engelen, Genivia, Inc., All Rights Reserved.
  37. --------------------------------------------------------------------------------
  38. GPL license.
  39. This program is free software; you can redistribute it and/or modify it under
  40. the terms of the GNU General Public License as published by the Free Software
  41. Foundation; either version 2 of the License, or (at your option) any later
  42. version.
  43. This program is distributed in the hope that it will be useful, but WITHOUT ANY
  44. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  45. PARTICULAR PURPOSE. See the GNU General Public License for more details.
  46. You should have received a copy of the GNU General Public License along with
  47. this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  48. Place, Suite 330, Boston, MA 02111-1307 USA
  49. Author contact information:
  50. engelen@genivia.com / engelen@acm.org
  51. This program is released under the GPL with the additional exemption that
  52. compiling, linking, and/or using OpenSSL is allowed.
  53. --------------------------------------------------------------------------------
  54. A commercial use license is available from Genivia, Inc., contact@genivia.com
  55. --------------------------------------------------------------------------------
  56. */
  57. extern typedef long long xsd__duration; /* duration in ms (1/1000 sec) */