github.com/matrixorigin/matrixone@v0.7.0/cgo/external/decNumber/decPacked.h (about) 1 /* ------------------------------------------------------------------ */ 2 /* Packed Decimal conversion module header */ 3 /* ------------------------------------------------------------------ */ 4 /* Copyright (c) IBM Corporation, 2000, 2005. All rights reserved. */ 5 /* */ 6 /* This software is made available under the terms of the */ 7 /* ICU License -- ICU 1.8.1 and later. */ 8 /* */ 9 /* The description and User's Guide ("The decNumber C Library") for */ 10 /* this software is called decNumber.pdf. This document is */ 11 /* available, together with arithmetic and format specifications, */ 12 /* testcases, and Web links, on the General Decimal Arithmetic page. */ 13 /* */ 14 /* Please send comments, suggestions, and corrections to the author: */ 15 /* mfc@uk.ibm.com */ 16 /* Mike Cowlishaw, IBM Fellow */ 17 /* IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK */ 18 /* ------------------------------------------------------------------ */ 19 20 #if !defined(DECPACKED) 21 #define DECPACKED 22 #define DECPNAME "decPacked" /* Short name */ 23 #define DECPFULLNAME "Packed Decimal conversions" /* Verbose name */ 24 #define DECPAUTHOR "Mike Cowlishaw" /* Who to blame */ 25 26 #define DECPACKED_DefP 32 /* default precision */ 27 28 #ifndef DECNUMDIGITS 29 #define DECNUMDIGITS DECPACKED_DefP /* size if not already defined*/ 30 #endif 31 #include "decNumber.h" /* context and number library */ 32 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 /* ---------------------------------------------------------------- */ 44 /* decPacked public routines */ 45 /* ---------------------------------------------------------------- */ 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 52 #endif