42#include "general/meos_catalog.h"
62#define DatumGetSpanP(X) ((Span *) DatumGetPointer(X))
63#define SpanPGetDatum(X) PointerGetDatum(X)
64#define PG_GETARG_SPAN_P(X) DatumGetSpanP(PG_GETARG_POINTER(X))
65#define PG_RETURN_SPAN_P(X) PG_RETURN_POINTER(X)
68 #define DatumGetSpanSetP(X) ((SpanSet *) DatumGetPointer(X))
70 #define DatumGetSpanSetP(X) ((SpanSet *) PG_DETOAST_DATUM(X))
72#define SpanSetPGetDatum(X) PointerGetDatum(X)
73#define PG_GETARG_SPANSET_P(X) ((SpanSet *) PG_GETARG_VARLENA_P(X))
74#define PG_RETURN_SPANSET_P(X) PG_RETURN_POINTER(X)
int span_upper_cmp(const Span *a, const Span *b)
Compare the upper bounds of two spans, returning <0, 0, or >0 according to whether the first bound is...
Definition: span.c:179
Span ** spanarr_normalize(Span **spans, int count, bool sort, int *newcount)
Normalize an array of spans.
Definition: span.c:210
uint8_t * span_to_wkb_buf(const Span *s, uint8_t *buf, uint8_t variant)
Write into the buffer a span represented in Well-Known Binary (WKB) format as follows.
Definition: type_out.c:1842
int span_bound_qsort_cmp(const void *a1, const void *a2)
Comparison function for sorting span bounds.
Definition: span.c:138
void span_deserialize(const Span *s, SpanBound *lower, SpanBound *upper)
General functions for spans (a.k.a.
Definition: span.c:63
void span_bounds(const Span *s, double *xmin, double *xmax)
size_t span_to_wkb_size(const Span *s)
Return the size in bytes of a span represented in Well-Known Binary (WKB) format.
Definition: type_out.c:1170
Span * span_serialize(SpanBound *lower, SpanBound *upper)
int span_bound_cmp(const SpanBound *b1, const SpanBound *b2)
Compare two span boundary points, returning <0, 0, or >0 according to whether the first one is less t...
Definition: span.c:105
int span_lower_cmp(const Span *a, const Span *b)
Compare the lower bounds of two spans, returning <0, 0, or >0 according to whether the first bound is...
Definition: span.c:153
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
unsigned char uint8
Definition: pg_ext_defs.in.h:11
uint8 basetype
span basetype
Definition: span.h:55
bool lower
this is the lower (vs upper) bound
Definition: span.h:53
Datum val
bound value
Definition: span.h:51
uint8 spantype
span type
Definition: span.h:54
bool inclusive
bound is inclusive (vs exclusive)
Definition: span.h:52
Basic routines for spans (a.k.a.
Definition: span.h:50
Structure to represent spans (a.k.a.
Definition: meos.h:70