PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include <ctype.h>
#include <math.h>
#include "common/int.h"
#include "libpq/pqformat.h"
#include "utils/builtins.h"
#include "utils/cash.h"
#include "utils/float.h"
#include "utils/numeric.h"
#include "utils/pg_locale.h"
Go to the source code of this file.
|
static |
Definition at line 39 of file cash.c.
References appendStringInfo(), appendStringInfoString(), buf, and value.
Referenced by cash_words().
Datum cash_cmp | ( | PG_FUNCTION_ARGS | ) |
Datum cash_div_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 716 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_CASH, and PG_RETURN_FLOAT8.
Definition at line 130 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, float8_div(), FLOAT8_FITS_IN_INT64, res, and unlikely.
Referenced by cash_div_flt4(), and cash_div_flt8().
Datum cash_div_flt4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 802 of file cash.c.
References cash_div_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum cash_div_flt8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 762 of file cash.c.
References cash_div_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum cash_div_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 918 of file cash.c.
References cash_div_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum cash_div_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 880 of file cash.c.
References cash_div_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Definition at line 156 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, i, and unlikely.
Referenced by cash_div_int2(), cash_div_int4(), and cash_div_int8().
Datum cash_div_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 840 of file cash.c.
References cash_div_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
Datum cash_eq | ( | PG_FUNCTION_ARGS | ) |
Datum cash_ge | ( | PG_FUNCTION_ARGS | ) |
Datum cash_gt | ( | PG_FUNCTION_ARGS | ) |
Datum cash_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 173 of file cash.c.
References ereturn, errcode(), errmsg(), INT64_FORMAT, PG_GETARG_CSTRING, PG_INT64_MIN, pg_mul_s64_overflow(), PG_RETURN_CASH, pg_sub_s64_overflow(), PGLC_localeconv(), printf, str, and value.
Datum cash_le | ( | PG_FUNCTION_ARGS | ) |
Datum cash_lt | ( | PG_FUNCTION_ARGS | ) |
Datum cash_mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 703 of file cash.c.
References cash_mi_cash(), PG_GETARG_CASH, and PG_RETURN_CASH.
Definition at line 117 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, FLOAT8_FITS_IN_INT64, float8_mul(), res, and unlikely.
Referenced by cash_mul_flt4(), cash_mul_flt8(), flt4_mul_cash(), and flt8_mul_cash().
Datum cash_mul_flt4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 775 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum cash_mul_flt8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 736 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum cash_mul_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 893 of file cash.c.
References cash_mul_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum cash_mul_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 853 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Definition at line 143 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, i, pg_mul_s64_overflow(), res, and unlikely.
Referenced by cash_mul_int2(), cash_mul_int4(), cash_mul_int8(), int2_mul_cash(), int4_mul_cash(), and int8_mul_cash().
Datum cash_mul_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 815 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
Datum cash_ne | ( | PG_FUNCTION_ARGS | ) |
Datum cash_numeric | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1051 of file cash.c.
References DirectFunctionCall2, i, Int32GetDatum(), int64_to_numeric(), numeric_div(), numeric_round(), numeric_scale(), NumericGetDatum(), PG_GETARG_CASH, PG_RETURN_DATUM, PGLC_localeconv(), and scale.
Datum cash_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 387 of file cash.c.
References buf, if(), pg_abs_s64(), PG_GETARG_CASH, PG_RETURN_CSTRING, PGLC_localeconv(), psprintf(), and value.
Datum cash_pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 690 of file cash.c.
References cash_pl_cash(), PG_GETARG_CASH, and PG_RETURN_CASH.
Datum cash_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 592 of file cash.c.
References buf, PG_GETARG_POINTER, PG_RETURN_CASH, and pq_getmsgint64().
Datum cash_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 603 of file cash.c.
References buf, PG_GETARG_CASH, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint64().
Datum cash_words | ( | PG_FUNCTION_ARGS | ) |
Definition at line 961 of file cash.c.
References append_num_word(), appendStringInfoString(), buf, cstring_to_text_with_len(), initStringInfo(), pfree(), PG_GETARG_CASH, PG_RETURN_TEXT_P, pg_toupper(), res, val, and value.
Datum cashlarger | ( | PG_FUNCTION_ARGS | ) |
Datum cashsmaller | ( | PG_FUNCTION_ARGS | ) |
Datum flt4_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 788 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum flt8_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 749 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum int2_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 905 of file cash.c.
References cash_mul_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum int4_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1141 of file cash.c.
References DatumGetInt64(), DirectFunctionCall2, i, Int64GetDatum(), int8mul(), PG_GETARG_INT32, PG_RETURN_CASH, PGLC_localeconv(), and scale.
Datum int4_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 866 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Datum int8_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1171 of file cash.c.
References DatumGetInt64(), DirectFunctionCall2, i, Int64GetDatum(), int8mul(), PG_GETARG_INT64, PG_RETURN_CASH, PGLC_localeconv(), and scale.
Datum int8_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 828 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
Datum numeric_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1107 of file cash.c.
References DatumGetInt64(), DirectFunctionCall1, DirectFunctionCall2, i, int64_to_numeric(), numeric_int8(), numeric_mul(), numeric_scale(), NumericGetDatum(), PG_GETARG_DATUM, PG_RETURN_CASH, PGLC_localeconv(), and scale.