22#define DatumGetSegP(X) ((SEG *) DatumGetPointer(X))
23#define PG_GETARG_SEG_P(n) DatumGetSegP(PG_GETARG_DATUM(n))
99static int restore(
char *result,
float val,
int n);
115 if (
seg_yyparse(result, fcinfo->context, scanner) != 0)
116 seg_yyerror(result, fcinfo->context, scanner,
"bogus input");
130 p = result = (
char *)
palloc(40);
144 if (seg->
l_ext !=
'-')
151 if (seg->
u_ext !=
'-')
350 for (
i = 1;
i <= maxoff;
i++)
441#ifdef GIST_QUERY_DEBUG
485#ifdef GIST_QUERY_DEBUG
582 ((
b->upper >=
a->upper) && (
b->lower <=
a->upper)));
639 if (
a->upper >
b->upper)
653 if (
a->lower <
b->lower)
679 if (
a->upper <
b->upper)
693 if (
a->lower >
b->lower)
712 if (
a == (
SEG *)
NULL ||
a->upper <=
a->lower)
715 *size =
fabsf(
a->upper -
a->lower);
739 if (
a->lower <
b->lower)
741 if (
a->lower >
b->lower)
751 if (
a->l_ext !=
b->l_ext)
770 if (
a->l_sigd <
b->l_sigd)
772 if (
a->l_sigd >
b->l_sigd)
780 if (
a->l_ext !=
b->l_ext)
787 elog(
ERROR,
"bogus lower boundary types %d %d",
788 (
int)
a->l_ext, (
int)
b->l_ext);
796 if (
a->upper <
b->upper)
798 if (
a->upper >
b->upper)
808 if (
a->u_ext !=
b->u_ext)
828 if (
a->u_sigd <
b->u_sigd)
830 if (
a->u_sigd >
b->u_sigd)
838 if (
a->u_ext !=
b->u_ext)
845 elog(
ERROR,
"bogus upper boundary types %d %d",
846 (
int)
a->u_ext, (
int)
b->u_ext);
922 '0',
'0',
'0',
'0',
'0',
923 '0',
'0',
'0',
'0',
'0',
924 '0',
'0',
'0',
'0',
'0',
925 '0',
'0',
'0',
'0',
'0',
926 '0',
'0',
'0',
'0',
'\0'
971 for (p = result +
sign,
i = 10,
dp = 0; *p !=
'e'; p++,
i++)
985 if (
dp - 10 +
exp >= n)
999 for (
i = 23;
i >
dp;
i--)
1024 for (
i = 23;
i >
dp;
i--)
1078 for (
c = *p; (
c ==
'0' ||
c ==
'+' ||
c ==
'-') &&
c != 0;
c = *(++p));
1081 for (
c = *p; (
c ==
'0' ||
c ==
'.') &&
c != 0;
c = *(++p))
1088 for (
c = *p, n = 0;
c != 0;
c = *(++p))
1090 if (!((
c >=
'0' &&
c <=
'9') || (
c ==
'.')))
#define fprintf(file, fmt, msg)
#define palloc_object(type)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define PG_MODULE_MAGIC_EXT(...)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_CSTRING(n)
#define PG_FUNCTION_INFO_V1(funcname)
#define PG_GETARG_UINT16(n)
#define PG_RETURN_INT32(x)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_FLOAT4(x)
#define PG_RETURN_BOOL(x)
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define qsort(a, b, c, d)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Datum BoolGetDatum(bool X)
static int32 DatumGetInt32(Datum X)
static int cmp(const chr *x, const chr *y, size_t len)
Datum seg_le(PG_FUNCTION_ARGS)
Datum gseg_decompress(PG_FUNCTION_ARGS)
Datum seg_gt(PG_FUNCTION_ARGS)
static Datum gseg_leaf_consistent(Datum key, Datum query, StrategyNumber strategy)
Datum gseg_penalty(PG_FUNCTION_ARGS)
Datum gseg_union(PG_FUNCTION_ARGS)
Datum gseg_consistent(PG_FUNCTION_ARGS)
Datum seg_center(PG_FUNCTION_ARGS)
Datum seg_over_right(PG_FUNCTION_ARGS)
Datum seg_contained(PG_FUNCTION_ARGS)
Datum seg_overlap(PG_FUNCTION_ARGS)
Datum seg_right(PG_FUNCTION_ARGS)
#define PG_GETARG_SEG_P(n)
Datum gseg_same(PG_FUNCTION_ARGS)
static int gseg_picksplit_item_cmp(const void *a, const void *b)
Datum seg_lt(PG_FUNCTION_ARGS)
Datum seg_size(PG_FUNCTION_ARGS)
Datum seg_union(PG_FUNCTION_ARGS)
int significant_digits(const char *s)
Datum seg_upper(PG_FUNCTION_ARGS)
static Datum gseg_internal_consistent(Datum key, Datum query, StrategyNumber strategy)
Datum seg_ge(PG_FUNCTION_ARGS)
Datum seg_lower(PG_FUNCTION_ARGS)
Datum gseg_picksplit(PG_FUNCTION_ARGS)
Datum seg_in(PG_FUNCTION_ARGS)
Datum seg_cmp(PG_FUNCTION_ARGS)
static int restore(char *result, float val, int n)
Datum seg_inter(PG_FUNCTION_ARGS)
Datum seg_left(PG_FUNCTION_ARGS)
static void rt_seg_size(SEG *a, float *size)
Datum seg_out(PG_FUNCTION_ARGS)
static Datum gseg_binary_union(Datum r1, Datum r2, int *sizep)
Datum seg_over_left(PG_FUNCTION_ARGS)
Datum gseg_compress(PG_FUNCTION_ARGS)
Datum seg_contains(PG_FUNCTION_ARGS)
Datum seg_same(PG_FUNCTION_ARGS)
Datum seg_different(PG_FUNCTION_ARGS)
void seg_yyerror(SEG *result, struct Node *escontext, yyscan_t yyscanner, const char *message)
void seg_scanner_init(const char *str, yyscan_t *yyscannerp)
int seg_yyparse(SEG *result, struct Node *escontext, yyscan_t yyscanner)
void seg_scanner_finish(yyscan_t yyscanner)
#define RTOldContainsStrategyNumber
#define RTOverlapStrategyNumber
#define RTLeftStrategyNumber
#define RTOverRightStrategyNumber
#define RTRightStrategyNumber
#define RTSameStrategyNumber
#define RTContainsStrategyNumber
#define RTOverLeftStrategyNumber
#define RTOldContainedByStrategyNumber
#define RTContainedByStrategyNumber