int dbuntangle ( Dbptr db, Arr **table_records ); void dbfree_untangle ( Arr *table_records ) ;
The input is a database pointer, and the address of an array, table_records; this address should be initialized to zero for the first call. The returned table_records is an array (see arr(3)) indexed by table name of sorted lists (stbl(3)) of record numbers.
dbuntangle may be called repeatedly on different views, and will accumulate lists of all the referenced records.
The input db pointer may either be a pointer to a table, or may specify a range of records in the dbgroup sense, where the range of records is from record #db.record up to (but not including) record #db.field.
arr(3) stbl(3) dbunjoin(1) dbunjoin(3)