/
githubmirror
/
postgres
Обзор
Документация
Войти
/
githubmirror
/
postgres
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/include/utils/cash.h
35 строк
595 B
Peter Eisentraut
Convert *GetDatum() and DatumGet*() macros to inline functions
27 сен 2022, 21:50
27 сен 2022, 21:50
c8b2ef0
Код
Авторство
О чём код?
/* * src/include/utils/cash.h * * * cash.h * Written by D'Arcy J.M. Cain * * Functions to allow input and output of money normally but store * and handle it as 64 bit integer. */ #ifndef CASH_H #define CASH_H #include "fmgr.h" typedef int64 Cash; /* Cash is pass-by-reference if and only if int64 is */ static inline Cash DatumGetCash(Datum X) { return DatumGetInt64(X); } static inline Datum CashGetDatum(Cash X) { return Int64GetDatum(X); } #define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n)) #define PG_RETURN_CASH(x) return CashGetDatum(x) #endif /* CASH_H */