1997-04-09 10:36:21 +02:00
|
|
|
/*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/utils/cash.h
|
2008-05-17 03:28:26 +02:00
|
|
|
*
|
|
|
|
*
|
1997-04-15 19:41:44 +02:00
|
|
|
* cash.h
|
|
|
|
* Written by D'Arcy J.M. Cain
|
|
|
|
*
|
|
|
|
* Functions to allow input and output of money normally but store
|
2007-01-03 02:19:51 +01:00
|
|
|
* and handle it as 64 bit integer.
|
1997-04-15 19:41:44 +02:00
|
|
|
*/
|
1997-04-09 10:36:21 +02:00
|
|
|
|
1997-04-15 19:41:44 +02:00
|
|
|
#ifndef CASH_H
|
|
|
|
#define CASH_H
|
1997-04-09 10:36:21 +02:00
|
|
|
|
2006-07-13 18:49:20 +02:00
|
|
|
#include "fmgr.h"
|
|
|
|
|
2007-01-03 02:19:51 +01:00
|
|
|
typedef int64 Cash;
|
1997-04-09 10:36:21 +02:00
|
|
|
|
2008-04-21 02:26:47 +02:00
|
|
|
/* Cash is pass-by-reference if and only if int64 is */
|
|
|
|
#define DatumGetCash(X) ((Cash) DatumGetInt64(X))
|
|
|
|
#define CashGetDatum(X) Int64GetDatum(X)
|
|
|
|
#define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n))
|
|
|
|
#define PG_RETURN_CASH(x) return CashGetDatum(x)
|
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* CASH_H */
|