Code

RRTimeslice: Added cast from timestamptz to rrtimeslice.
[postrr.git] / src / postrr.h.in
index 3db5045169ffe7817244b9ce40137c71665faf64..bf93551c87af699e6ae00cee35e1168de8709aaf 100644 (file)
@@ -78,30 +78,96 @@ rrtimeslice_typmodout(PG_FUNCTION_ARGS);
 /* casts */
 Datum
 rrtimeslice_to_rrtimeslice(PG_FUNCTION_ARGS);
+Datum
+timestamptz_to_rrtimeslice(PG_FUNCTION_ARGS);
+Datum
+rrtimeslice_to_timestamptz(PG_FUNCTION_ARGS);
 
 /* comparison operators */
 Datum
-rrtimeslice_eq(PG_FUNCTION_ARGS);
+rrtimeslice_cmp(PG_FUNCTION_ARGS);
+
+/* sequence comparison operators */
 Datum
-rrtimeslice_ne(PG_FUNCTION_ARGS);
+rrtimeslice_seq_eq(PG_FUNCTION_ARGS);
 Datum
-rrtimeslice_lt(PG_FUNCTION_ARGS);
+rrtimeslice_seq_ne(PG_FUNCTION_ARGS);
 Datum
-rrtimeslice_le(PG_FUNCTION_ARGS);
+rrtimeslice_seq_lt(PG_FUNCTION_ARGS);
 Datum
-rrtimeslice_gt(PG_FUNCTION_ARGS);
+rrtimeslice_seq_le(PG_FUNCTION_ARGS);
 Datum
-rrtimeslice_ge(PG_FUNCTION_ARGS);
+rrtimeslice_seq_gt(PG_FUNCTION_ARGS);
 Datum
-rrtimeslice_cmp(PG_FUNCTION_ARGS);
+rrtimeslice_seq_ge(PG_FUNCTION_ARGS);
+Datum
+rrtimeslice_seq_cmp(PG_FUNCTION_ARGS);
+Datum
+rrtimeslice_seq_hash(PG_FUNCTION_ARGS);
 
 /*
  * internal (not fmgr-callable) functions
  */
 
+/*
+ * compare two RRTimeslices
+ *
+ * returns:
+ *  - -2 if ts1 < ts2 (sequence numbers don't match)
+ *  - -1 if ts1 < ts2 (sequence numbers match)
+ *  -  0 if ts1 = ts2
+ *  -  1 if ts1 > ts2 (sequence numbers match)
+ *  -  2 if ts1 > ts2 (sequence numbers don't match)
+ */
 int
 rrtimeslice_cmp_internal(rrtimeslice_t *ts1, rrtimeslice_t *ts2);
 
+/*
+ * compare sequence numbers of two RRTimeslices
+ *
+ * returns:
+ *  - -1 if ts1 < ts2
+ *  -  0 if ts1 = ts2
+ *  -  1 if ts1 > ts2
+ */
+int
+rrtimeslice_seq_cmp_internal(rrtimeslice_t *ts1, rrtimeslice_t *ts2);
+
+/*
+ * CData data type
+ */
+
+struct cdata;
+typedef struct cdata cdata_t;
+
+#define PG_GETARG_CDATA_P(n) (cdata_t *)PG_GETARG_POINTER(n)
+#define PG_RETURN_CDATA_P(p) PG_RETURN_POINTER(p)
+
+Datum
+cdata_validate(PG_FUNCTION_ARGS);
+
+/* I/O functions */
+Datum
+cdata_in(PG_FUNCTION_ARGS);
+Datum
+cdata_out(PG_FUNCTION_ARGS);
+Datum
+cdata_typmodin(PG_FUNCTION_ARGS);
+Datum
+cdata_typmodout(PG_FUNCTION_ARGS);
+
+/* casts */
+Datum
+cdata_to_cdata(PG_FUNCTION_ARGS);
+Datum
+int32_to_cdata(PG_FUNCTION_ARGS);
+Datum
+cdata_to_float8(PG_FUNCTION_ARGS);
+
+/* aux. functions */
+Datum
+cdata_update(PG_FUNCTION_ARGS);
+
 #endif /* ! POSTRR_H */
 
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */