PostgreSQL Source Code
git master
|
#include <pgtypes.h>
Go to the source code of this file.
Data Structures | |
struct | numeric |
struct | decimal |
Macros | |
#define | NUMERIC_POS 0x0000 |
#define | NUMERIC_NEG 0x4000 |
#define | NUMERIC_NAN 0xC000 |
#define | NUMERIC_NULL 0xF000 |
#define | NUMERIC_MAX_PRECISION 1000 |
#define | NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION |
#define | NUMERIC_MIN_DISPLAY_SCALE 0 |
#define | NUMERIC_MIN_SIG_DIGITS 16 |
#define | DECSIZE 30 |
Typedefs | |
typedef unsigned char | NumericDigit |
#define DECSIZE 30 |
Definition at line 15 of file pgtypes_numeric.h.
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION |
Definition at line 11 of file pgtypes_numeric.h.
#define NUMERIC_MAX_PRECISION 1000 |
Definition at line 10 of file pgtypes_numeric.h.
#define NUMERIC_MIN_DISPLAY_SCALE 0 |
Definition at line 12 of file pgtypes_numeric.h.
#define NUMERIC_MIN_SIG_DIGITS 16 |
Definition at line 13 of file pgtypes_numeric.h.
#define NUMERIC_NAN 0xC000 |
Definition at line 8 of file pgtypes_numeric.h.
#define NUMERIC_NEG 0x4000 |
Definition at line 7 of file pgtypes_numeric.h.
#define NUMERIC_NULL 0xF000 |
Definition at line 9 of file pgtypes_numeric.h.
#define NUMERIC_POS 0x0000 |
Definition at line 6 of file pgtypes_numeric.h.
typedef unsigned char NumericDigit |
Definition at line 17 of file pgtypes_numeric.h.
void PGTYPESdecimal_free | ( | decimal * | var | ) |
decimal* PGTYPESdecimal_new | ( | void | ) |
Definition at line 59 of file numeric.c.
References pgtypes_alloc().
Referenced by main().
Definition at line 637 of file numeric.c.
References add_abs(), cmp_abs(), numeric::dscale, Max, NUMERIC_NEG, NUMERIC_POS, numeric::rscale, numeric::sign, sub_abs(), and zero_var().
Definition at line 1281 of file numeric.c.
References cmp_abs(), NUMERIC_NEG, NUMERIC_POS, PGTYPES_NUM_BAD_NUMERIC, and numeric::sign.
Definition at line 1388 of file numeric.c.
References alloc_var(), numeric::digits, numeric::dscale, i, numeric::ndigits, numeric::rscale, numeric::sign, numeric::weight, and zero_var().
Referenced by ecpg_get_data(), ecpg_store_input(), and main().
Definition at line 1053 of file numeric.c.
References buf, numeric::buf, cmp_abs(), digitbuf_alloc, digitbuf_free, digits, numeric::digits, numeric::dscale, err(), i, init_var, numeric::ndigits, NUMERIC_NEG, NUMERIC_POS, PGTYPES_NUM_DIVIDE_ZERO, numeric::rscale, select_div_scale(), numeric::sign, sub_abs(), numeric::weight, and zero_var().
void PGTYPESnumeric_free | ( | numeric * | var | ) |
Definition at line 385 of file numeric.c.
References numeric::buf, digitbuf_free, and free.
Referenced by deccall2(), deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), dectodbl(), dectoint(), dectolong(), ecpg_get_data(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), ecpg_store_input(), main(), and sqlda_common_total_size().
numeric* PGTYPESnumeric_from_asc | ( | char * | str, |
char ** | endptr | ||
) |
Definition at line 321 of file numeric.c.
References pgtypes_alloc(), PGTYPESnumeric_free(), set_var_from_str(), str, and value.
Referenced by deccvasc(), ecpg_get_data(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), main(), and sqlda_common_total_size().
Definition at line 1570 of file numeric.c.
References alloc_var(), numeric::digits, decimal::digits, numeric::dscale, decimal::dscale, i, decimal::ndigits, numeric::rscale, decimal::rscale, numeric::sign, decimal::sign, numeric::weight, decimal::weight, and zero_var().
Referenced by deccall2(), deccall3(), dectoasc(), dectodbl(), dectoint(), dectolong(), ecpg_store_input(), and main().
int PGTYPESnumeric_from_double | ( | double | d, |
numeric * | dst | ||
) |
Definition at line 1411 of file numeric.c.
References i, PGTYPESnumeric_copy(), PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), and sprintf.
Referenced by deccvdbl().
int PGTYPESnumeric_from_int | ( | signed int | int_val, |
numeric * | var | ||
) |
Definition at line 1309 of file numeric.c.
References PGTYPESnumeric_from_long().
Referenced by deccvint(), and main().
int PGTYPESnumeric_from_long | ( | signed long int | long_val, |
numeric * | var | ||
) |
Definition at line 1318 of file numeric.c.
References alloc_var(), numeric::digits, numeric::dscale, i, NUMERIC_NEG, NUMERIC_POS, numeric::rscale, numeric::sign, size, and numeric::weight.
Referenced by deccvlong(), and main().
Definition at line 896 of file numeric.c.
References numeric::buf, digitbuf_alloc, digitbuf_free, numeric::digits, numeric::dscale, i, numeric::ndigits, NUMERIC_NEG, NUMERIC_POS, numeric::rscale, numeric::sign, and numeric::weight.
numeric* PGTYPESnumeric_new | ( | void | ) |
Definition at line 42 of file numeric.c.
References alloc_var(), free, and pgtypes_alloc().
Referenced by deccall2(), deccall3(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), dectodbl(), dectoint(), dectolong(), ecpg_get_data(), ecpg_store_input(), and main().
Definition at line 765 of file numeric.c.
References add_abs(), cmp_abs(), numeric::dscale, Max, NUMERIC_NEG, NUMERIC_POS, numeric::rscale, numeric::sign, sub_abs(), and zero_var().
char* PGTYPESnumeric_to_asc | ( | numeric * | num, |
int | dscale | ||
) |
Definition at line 343 of file numeric.c.
References numeric::dscale, get_str_from_var(), PGTYPESnumeric_copy(), PGTYPESnumeric_free(), and PGTYPESnumeric_new().
Referenced by dectoasc(), ecpg_store_input(), and main().
Definition at line 1547 of file numeric.c.
References DECSIZE, numeric::digits, decimal::digits, numeric::dscale, decimal::dscale, i, numeric::ndigits, decimal::ndigits, PGTYPES_NUM_OVERFLOW, numeric::rscale, decimal::rscale, numeric::sign, decimal::sign, numeric::weight, and decimal::weight.
Referenced by deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), ecpg_get_data(), and main().
int PGTYPESnumeric_to_double | ( | numeric * | nv, |
double * | dp | ||
) |
Definition at line 1483 of file numeric.c.
References numericvar_to_double().
Referenced by dectodbl(), and main().
int PGTYPESnumeric_to_int | ( | numeric * | nv, |
int * | ip | ||
) |
Definition at line 1494 of file numeric.c.
References i, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_to_long().
Referenced by dectoint(), and main().
int PGTYPESnumeric_to_long | ( | numeric * | nv, |
long * | lp | ||
) |
Definition at line 1518 of file numeric.c.
References free, PGTYPES_NUM_OVERFLOW, PGTYPES_NUM_UNDERFLOW, and PGTYPESnumeric_to_asc().
Referenced by dectolong(), and main().