decPacked.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Packed decimal conversion module header for the decNumber C Library.
  2. Copyright (C) 2007-2018 Free Software Foundation, Inc.
  3. Contributed by IBM Corporation. Author Mike Cowlishaw.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. /* ------------------------------------------------------------------ */
  21. /* Packed Decimal conversion module header */
  22. /* ------------------------------------------------------------------ */
  23. #if !defined(DECPACKED)
  24. #define DECPACKED
  25. #define DECPNAME "decPacked" /* Short name */
  26. #define DECPFULLNAME "Packed Decimal conversions" /* Verbose name */
  27. #define DECPAUTHOR "Mike Cowlishaw" /* Who to blame */
  28. #define DECPACKED_DefP 32 /* default precision */
  29. #ifndef DECNUMDIGITS
  30. #define DECNUMDIGITS DECPACKED_DefP /* size if not already defined*/
  31. #endif
  32. #include "decNumber.h" /* context and number library */
  33. /* Sign nibble constants */
  34. #if !defined(DECPPLUSALT)
  35. #define DECPPLUSALT 0x0A /* alternate plus nibble */
  36. #define DECPMINUSALT 0x0B /* alternate minus nibble */
  37. #define DECPPLUS 0x0C /* preferred plus nibble */
  38. #define DECPMINUS 0x0D /* preferred minus nibble */
  39. #define DECPPLUSALT2 0x0E /* alternate plus nibble */
  40. #define DECPUNSIGNED 0x0F /* alternate plus nibble (unsigned) */
  41. #endif
  42. /* ---------------------------------------------------------------- */
  43. /* decPacked public routines */
  44. /* ---------------------------------------------------------------- */
  45. #include "decPackedSymbols.h"
  46. /* Conversions */
  47. uint8_t * decPackedFromNumber(uint8_t *, int32_t, int32_t *,
  48. const decNumber *);
  49. decNumber * decPackedToNumber(const uint8_t *, int32_t, const int32_t *,
  50. decNumber *);
  51. #endif