2008-12-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[official-gcc.git] / libdecnumber / decPacked.h
blobc76aa09631e701c98e94a29ce2ef214878131514
1 /* Packed decimal conversion module header for the decNumber C Library.
2 Copyright (C) 2007 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 2, or (at your option) any later
10 version.
12 In addition to the permissions in the GNU General Public License,
13 the Free Software Foundation gives you unlimited permission to link
14 the compiled version of this file into combinations with other
15 programs, and to distribute those combinations without any
16 restriction coming from the use of this file. (The General Public
17 License restrictions do apply in other respects; for example, they
18 cover modification of the file, and distribution when not linked
19 into a combine executable.)
21 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
22 WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 for more details.
26 You should have received a copy of the GNU General Public License
27 along with GCC; see the file COPYING. If not, write to the Free
28 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
29 02110-1301, USA. */
31 /* ------------------------------------------------------------------ */
32 /* Packed Decimal conversion module header */
33 /* ------------------------------------------------------------------ */
35 #if !defined(DECPACKED)
36 #define DECPACKED
37 #define DECPNAME "decPacked" /* Short name */
38 #define DECPFULLNAME "Packed Decimal conversions" /* Verbose name */
39 #define DECPAUTHOR "Mike Cowlishaw" /* Who to blame */
41 #define DECPACKED_DefP 32 /* default precision */
43 #ifndef DECNUMDIGITS
44 #define DECNUMDIGITS DECPACKED_DefP /* size if not already defined*/
45 #endif
46 #include "decNumber.h" /* context and number library */
48 /* Sign nibble constants */
49 #if !defined(DECPPLUSALT)
50 #define DECPPLUSALT 0x0A /* alternate plus nibble */
51 #define DECPMINUSALT 0x0B /* alternate minus nibble */
52 #define DECPPLUS 0x0C /* preferred plus nibble */
53 #define DECPMINUS 0x0D /* preferred minus nibble */
54 #define DECPPLUSALT2 0x0E /* alternate plus nibble */
55 #define DECPUNSIGNED 0x0F /* alternate plus nibble (unsigned) */
56 #endif
58 /* ---------------------------------------------------------------- */
59 /* decPacked public routines */
60 /* ---------------------------------------------------------------- */
62 #include "decPackedSymbols.h"
64 /* Conversions */
65 uint8_t * decPackedFromNumber(uint8_t *, int32_t, int32_t *,
66 const decNumber *);
67 decNumber * decPackedToNumber(const uint8_t *, int32_t, const int32_t *,
68 decNumber *);
70 #endif