mod build;
use pgx::*;
#[pg_extern]
fn amhandler(_fcinfi: pg_sys::FunctionCallInfo) -> PgBox<pg_sys::IndexAmRoutine> {
let mut amroutine =
PgBox::<pg_sys::IndexAmRoutine>::alloc_node(pg_sys::NodeTag_T_IndexAmRoutine);
amroutine.amstrategies = 0;
amroutine.amsupport = 4;
amroutine.amcanorderbyop = true;
amroutine.amoptionalkey = true;
amroutine.amkeytype = pg_sys::InvalidOid; // InvalidOid = 0? https://www.postgresql.org/docs/9.6/lo-interfaces.html
amroutine.ambuild = Some(build::ambuild);
/*
amroutine.ambuildempty = todo!
amroutine.aminsert = todo!;
amroutine.ambulkdelete = todo!;
amroutine.amvacuumcleanup = todo!;
amroutine.amcostestimate = todo!;
amroutine.amoptions = todo!;
amroutine.amvalidate = todo!;
amroutine.ambeginscan = todo!;
amroutine.amrescan = todo!;
amroutine.amgettuple = todo!;
amroutine.amendscan = todo!;
*/
amroutine
}