本文整理汇总了C++中DirectFunctionCall2函数的典型用法代码示例。如果您正苦于以下问题:C++ DirectFunctionCall2函数的具体用法?C++ DirectFunctionCall2怎么用?C++ DirectFunctionCall2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DirectFunctionCall2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: to_tsquery
Datum
to_tsquery(PG_FUNCTION_ARGS)
{
text *in = PG_GETARG_TEXT_P(0);
Oid cfgId;
cfgId = getTSCurrentConfig(true);
PG_RETURN_DATUM(DirectFunctionCall2(to_tsquery_byid,
ObjectIdGetDatum(cfgId),
PointerGetDatum(in)));
}
示例2: similarity_op
Datum
similarity_op(PG_FUNCTION_ARGS)
{
float4 res = DatumGetFloat4(DirectFunctionCall2(
similarity,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)
));
PG_RETURN_BOOL(res >= trgm_limit);
}
示例3: gpupreagg_psum_x2_numeric
Datum
gpupreagg_psum_x2_numeric(PG_FUNCTION_ARGS)
{
Assert(PG_NARGS() == 1);
if (PG_ARGISNULL(0))
PG_RETURN_NULL();
PG_RETURN_NUMERIC(DirectFunctionCall2(numeric_mul,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(0)));
}
示例4: compareNumeric
static int
compareNumeric(Numeric a, Numeric b)
{
return DatumGetInt32(
DirectFunctionCall2(
numeric_cmp,
PointerGetDatum(a),
PointerGetDatum(b)
)
);
}
示例5: _int_different
Datum
_int_different(PG_FUNCTION_ARGS)
{
PG_RETURN_BOOL(!DatumGetBool(
DirectFunctionCall2(
_int_same,
PointerGetDatum(PG_GETARG_POINTER(0)),
PointerGetDatum(PG_GETARG_POINTER(1))
)
));
}
示例6: tsq_mcontained
Datum
tsq_mcontained(PG_FUNCTION_ARGS)
{
PG_RETURN_DATUM(
DirectFunctionCall2(
tsq_mcontains,
PG_GETARG_DATUM(1),
PG_GETARG_DATUM(0)
)
);
}
示例7: tskey_cmp
static int
tskey_cmp(const void *a, const void *b)
{
return DatumGetInt32(
DirectFunctionCall2(
timestamp_cmp,
TimestampGetDatumFast(((TSKEY *) (((RIX *) a)->r))->lower),
TimestampGetDatumFast(((TSKEY *) (((RIX *) b)->r))->lower)
)
);
}
示例8: pg_xlog_location_diff
/*
* Compute the difference in bytes between two WAL locations.
*/
Datum
pg_xlog_location_diff(PG_FUNCTION_ARGS)
{
Datum result;
result = DirectFunctionCall2(pg_lsn_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1));
PG_RETURN_NUMERIC(result);
}
示例9: gbt_macadkey_cmp
static int
gbt_macadkey_cmp(const void *a, const void *b)
{
return DatumGetInt32(
DirectFunctionCall2(
macaddr_cmp,
PointerGetDatum(&((Nsrt *) a)->t[0]),
PointerGetDatum(&((Nsrt *) b)->t[0])
)
);
}
示例10: gbt_time_penalty
Datum
gbt_time_penalty(PG_FUNCTION_ARGS)
{
timeKEY *origentry = (timeKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
timeKEY *newentry = (timeKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(1))->key);
float *result = (float *) PG_GETARG_POINTER(2);
Interval *intr;
double res;
double res2;
intr = DatumGetIntervalP(DirectFunctionCall2(
time_mi_time,
P_TimeADTGetDatum(newentry->upper),
P_TimeADTGetDatum(origentry->upper)));
res = INTERVAL_TO_SEC(intr);
res = Max(res, 0);
intr = DatumGetIntervalP(DirectFunctionCall2(
time_mi_time,
P_TimeADTGetDatum(origentry->lower),
P_TimeADTGetDatum(newentry->lower)));
res2 = INTERVAL_TO_SEC(intr);
res2 = Max(res2, 0);
res += res2;
*result = 0.0;
if (res > 0)
{
intr = DatumGetIntervalP(DirectFunctionCall2(
time_mi_time,
P_TimeADTGetDatum(origentry->upper),
P_TimeADTGetDatum(origentry->lower)));
*result += FLT_MIN;
*result += (float) (res / (res + INTERVAL_TO_SEC(intr)));
*result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1));
}
PG_RETURN_POINTER(result);
}
示例11: gbt_time_dist
static float8
gbt_time_dist(const void *a, const void *b)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
Interval *i;
i = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
TimeADTGetDatumFast(*aa),
TimeADTGetDatumFast(*bb)));
return (float8) Abs(INTERVAL_TO_SEC(i));
}
示例12: gist_box_penalty
/*
* The GiST Penalty method for boxes (also used for points)
*
* As in the R-tree paper, we use change in area as our penalty metric
*/
Datum
gist_box_penalty(PG_FUNCTION_ARGS)
{
GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1);
float *result = (float *) PG_GETARG_POINTER(2);
Datum ud;
ud = DirectFunctionCall2(rt_box_union, origentry->key, newentry->key);
*result = (float) (size_box(ud) - size_box(origentry->key));
PG_RETURN_POINTER(result);
}
示例13: tsa_plainto_tsquery_name
/* plainto_tsquery(text, text) */
Datum
tsa_plainto_tsquery_name(PG_FUNCTION_ARGS)
{
text *cfgname = PG_GETARG_TEXT_P(0);
Datum arg1 = PG_GETARG_DATUM(1);
Oid config_oid;
config_oid = TextGetObjectId(regconfigin, cfgname);
return DirectFunctionCall2(plainto_tsquery_byid,
ObjectIdGetDatum(config_oid), arg1);
}
示例14: spheretrans_point_inverse
Datum
spheretrans_point_inverse(PG_FUNCTION_ARGS)
{
Datum sp = PG_GETARG_DATUM(0);
SEuler *se = (SEuler *) PG_GETARG_POINTER(1);
SEuler tmp;
Datum ret;
spheretrans_inverse(&tmp, se);
ret = DirectFunctionCall2(spheretrans_point,
sp, PointerGetDatum(&tmp));
PG_RETURN_DATUM(ret);
}
示例15: abs_interval
Interval *
abs_interval(Interval *a)
{
static Interval zero = {0, 0, 0};
if (DatumGetBool(DirectFunctionCall2(interval_lt,
IntervalPGetDatum(a),
IntervalPGetDatum(&zero))))
a = DatumGetIntervalP(DirectFunctionCall1(interval_um,
IntervalPGetDatum(a)));
return a;
}