1997-04-09 10:36:21 +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
|
1997-09-07 07:04:48 +02:00
|
|
|
* and handle it as int4.
|
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
|
|
|
|
1997-08-22 09:13:01 +02:00
|
|
|
/* if we store this as 4 bytes, we better make it int, not long, bjm */
|
|
|
|
typedef signed int Cash;
|
1997-04-09 10:36:21 +02:00
|
|
|
|
2000-08-03 18:35:08 +02:00
|
|
|
extern Datum cash_in(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_out(PG_FUNCTION_ARGS);
|
1997-09-08 04:41:22 +02:00
|
|
|
|
2000-08-03 18:35:08 +02:00
|
|
|
extern Datum cash_eq(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_ne(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_lt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_le(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_gt(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_ge(PG_FUNCTION_ARGS);
|
1997-09-08 04:41:22 +02:00
|
|
|
|
2000-08-03 18:35:08 +02:00
|
|
|
extern Datum cash_pl(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_mi(PG_FUNCTION_ARGS);
|
1997-09-20 18:23:47 +02:00
|
|
|
|
2000-08-01 20:29:35 +02:00
|
|
|
extern Datum cash_mul_flt8(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_div_flt8(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum flt8_mul_cash(PG_FUNCTION_ARGS);
|
1997-09-20 18:23:47 +02:00
|
|
|
|
2000-08-01 20:29:35 +02:00
|
|
|
extern Datum cash_mul_flt4(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_div_flt4(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum flt4_mul_cash(PG_FUNCTION_ARGS);
|
1997-09-20 18:23:47 +02:00
|
|
|
|
2000-06-13 09:35:40 +02:00
|
|
|
extern Datum cash_mul_int4(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_div_int4(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum int4_mul_cash(PG_FUNCTION_ARGS);
|
1997-09-20 18:23:47 +02:00
|
|
|
|
2000-06-05 09:29:25 +02:00
|
|
|
extern Datum cash_mul_int2(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum int2_mul_cash(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cash_div_int2(PG_FUNCTION_ARGS);
|
1997-09-08 04:41:22 +02:00
|
|
|
|
2000-08-03 18:35:08 +02:00
|
|
|
extern Datum cashlarger(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum cashsmaller(PG_FUNCTION_ARGS);
|
1997-04-18 04:59:26 +02:00
|
|
|
|
2000-07-07 20:49:56 +02:00
|
|
|
extern Datum cash_words(PG_FUNCTION_ARGS);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* CASH_H */
|