HPGCC3 Documentation 3.0 R003

decPacked.h

Go to the documentation of this file.
00001 /* ------------------------------------------------------------------ */
00002 /* Packed Decimal conversion module header                            */
00003 /* ------------------------------------------------------------------ */
00004 /* Copyright (c) IBM Corporation, 2000, 2005.  All rights reserved.   */
00005 /*                                                                    */
00006 /* This software is made available under the terms of the             */
00007 /* ICU License -- ICU 1.8.1 and later.                                */
00008 /*                                                                    */
00009 /* The description and User's Guide ("The decNumber C Library") for   */
00010 /* this software is called decNumber.pdf.  This document is           */
00011 /* available, together with arithmetic and format specifications,     */
00012 /* testcases, and Web links, on the General Decimal Arithmetic page.  */
00013 /*                                                                    */
00014 /* Please send comments, suggestions, and corrections to the author:  */
00015 /*   mfc@uk.ibm.com                                                   */
00016 /*   Mike Cowlishaw, IBM Fellow                                       */
00017 /*   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         */
00018 /* ------------------------------------------------------------------ */
00019 
00020 #if !defined(DECPACKED)
00021   #define DECPACKED
00022   #define DECPNAME     "decPacked"                      /* Short name */
00023   #define DECPFULLNAME "Packed Decimal conversions"   /* Verbose name */
00024   #define DECPAUTHOR   "Mike Cowlishaw"               /* Who to blame */
00025 
00026   #define DECPACKED_DefP 32             /* default precision          */
00027 
00028   #ifndef  DECNUMDIGITS
00029     #define DECNUMDIGITS DECPACKED_DefP /* size if not already defined*/
00030   #endif
00031   #include "decNumber.h"                /* context and number library */
00032 
00033   /* Sign nibble constants                                            */
00034   #if !defined(DECPPLUSALT)
00035     #define DECPPLUSALT  0x0A /* alternate plus  nibble               */
00036     #define DECPMINUSALT 0x0B /* alternate minus nibble               */
00037     #define DECPPLUS     0x0C /* preferred plus  nibble               */
00038     #define DECPMINUS    0x0D /* preferred minus nibble               */
00039     #define DECPPLUSALT2 0x0E /* alternate plus  nibble               */
00040     #define DECPUNSIGNED 0x0F /* alternate plus  nibble (unsigned)    */
00041   #endif
00042 
00043   /* ---------------------------------------------------------------- */
00044   /* decPacked public routines                                        */
00045   /* ---------------------------------------------------------------- */
00046   /* Conversions                                                      */
00047   uint8_t * decPackedFromNumber(uint8_t *, int32_t, int32_t *,
00048                                 const decNumber *);
00049   decNumber * decPackedToNumber(const uint8_t *, int32_t, const int32_t *,
00050                                 decNumber *);
00051 
00052 #endif