int xinverted (keyinfo, rowkey, rowfile)
keystruct *keyinfo;
rowstruct *rowkey;
rowstruct *rowfile;
int sinverted (keyinfo, rowkey, rowfile)
keystruct *keyinfo;
rowstruct *rowkey;
rowstruct *rowfile;
xinverted creates a secondary index table from the key columns in the rowkey->p_columns array found in the table or list named by key->p_filename. For each row in key->p_filename xinverted writes a row in the index table composed of an initial Offset column indicating the row position and the key column values. It ignores case if key->flags&FOLDCASE is not zero. The resulting index table is named tableorlist.i and sorted left-to-right by key columns.
sinverted uses the same search algorithm as sbinary, except that sinverted switches the file pointers from the main table to the secondary index table created by xinverted before processing the search request, and then restores them when it's finished. The result is faster access on larger tables.
sinverted returns the number of matches found or -1 for a myriad of system and file errors.