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