#ifndef TSMAPI_H
#define TSMAPI_H
#include "nodes/execnodes.h"
#include "nodes/pathnodes.h"
typedef void (*SampleScanGetSampleSize_function) (PlannerInfo *root,
RelOptInfo *baserel,
List *paramexprs,
BlockNumber *pages,
double *tuples);
typedef void (*InitSampleScan_function) (SampleScanState *node,
int eflags);
typedef void (*BeginSampleScan_function) (SampleScanState *node,
Datum *params,
int nparams,
uint32 seed);
typedef BlockNumber (*NextSampleBlock_function) (SampleScanState *node,
BlockNumber nblocks);
typedef OffsetNumber (*NextSampleTuple_function) (SampleScanState *node,
BlockNumber blockno,
OffsetNumber maxoffset);
typedef void (*EndSampleScan_function) (SampleScanState *node);
typedef struct TsmRoutine
{
NodeTag type;
List *parameterTypes;
bool repeatable_across_queries;
bool repeatable_across_scans;
SampleScanGetSampleSize_function SampleScanGetSampleSize;
InitSampleScan_function InitSampleScan;
BeginSampleScan_function BeginSampleScan;
NextSampleBlock_function NextSampleBlock;
NextSampleTuple_function NextSampleTuple;
EndSampleScan_function EndSampleScan;
} TsmRoutine;
extern TsmRoutine *GetTsmRoutine(Oid tsmhandler);
#endif