Commit 3acae75d authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(main): Handle command "b", for testing backwards iterators. ("r",

	"R", and "I" were all taken).
parent bca63748
......@@ -60,6 +60,7 @@
w m write
i m iterate through all texts
i m f e iterate through f..e-1
b m f e reverse iterate through f..e-1
q quit
*/
int
......@@ -234,6 +235,34 @@ main(void)
ok = 1;
}
break;
case 'b':
if (n == 1 && num[0] < MAXMAPS)
{
/* This is not yet implemented by local-to-global.c. */
#if 0
L2g_reverse_iterator iter;
for (l2gi_searchall_reverse(&iter, &maps[num[0]]);
!iter.search_ended;
l2gi_prev(&iter))
printf("%lu:%lu\n",
(unsigned long)iter.lno,
(unsigned long)iter.tno);
ok = 1;
#endif
}
else if (n == 3 && num[0] < MAXMAPS)
{
L2g_reverse_iterator iter;
for (l2gi_searchsome_reverse(&iter, &maps[num[0]],
num[1], num[2]);
!iter.search_ended;
l2gi_prev(&iter))
printf("%lu:%lu\n",
(unsigned long)iter.lno,
(unsigned long)iter.tno);
ok = 1;
}
break;
case 'u':
if (n == 1 && num[0] < MAXMAPS)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment