34#ifndef __PG_SKIPLIST_H__
35#define __PG_SKIPLIST_H__
56#define INPUT_AGG_TRANS_STATE(fcinfo, state) \
58 MemoryContext ctx = set_aggregation_context(fcinfo); \
59 state = PG_ARGISNULL(0) ? NULL : (SkipList *) PG_GETARG_POINTER(0); \
60 if (PG_ARGISNULL(1)) \
63 PG_RETURN_POINTER(state); \
67 unset_aggregation_context(ctx); \
70#define INPUT_AGG_COMB_STATE(fcinfo, state1, state2) \
72 MemoryContext ctx = set_aggregation_context(fcinfo); \
73 state1 = PG_ARGISNULL(0) ? NULL : (SkipList *) PG_GETARG_POINTER(0); \
74 state2 = PG_ARGISNULL(1) ? NULL : (SkipList *) PG_GETARG_POINTER(1); \
75 if (! state1 && ! state2) \
77 unset_aggregation_context(ctx); \
External API of the Mobility Engine Open Source (MEOS) library.
FunctionCallInfo fetch_fcinfo(void)
Skiplist data structure used for performing aggregates.
Definition: temporal.c:104
MemoryContext set_aggregation_context(FunctionCallInfo fcinfo)
Switch to the memory context for aggregation.
Definition: skiplist.c:55
void store_fcinfo(FunctionCallInfo fcinfo)
Store in the cache the fcinfo of the external function.
Definition: temporal.c:114
void unset_aggregation_context(MemoryContext ctx)
Switch to the given memory context.
Definition: skiplist.c:68