need to estimate the cost of indexed scan
From documentation of postgresql, i understand
cost_qual_eval(&index_qual_cost, indexQuals, root);
*indexStartupCost = index_qual_cost.startup;
*indexTotalCost = seq_page_cost * numIndexPages +
(cpu_index_tuple_cost + index_qual_cost.per_tuple) * numIndexTuples;

Also there is a function defined as
void amcostestimate (PlannerInfo *root,indexOptInfo *index,List *indexQuals, RelOptInfo *outer_rel, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity,
double *indexCorrelation);

But i dont know how to call these c functions in sql and access these datastructures

please help?