-
-/* ARGSUSED */
-static void
-list(struct res *res, size_t sz, void *arg)
-{
- size_t i;
-
- qsort(res, sz, sizeof(struct res), cmp);
-
- if (EMPTYSET(res, sz) || SINGLETON(res, sz))
- return;
-
- if ( ! isatty(STDOUT_FILENO))
- for (i = 0; i < sz && res[i].matched; i++)
- printf("%s(%s%s%s) - %.70s\n",
- res[i].title, res[i].cat,
- *res[i].arch ? "/" : "",
- *res[i].arch ? res[i].arch : "",
- res[i].desc);
- else
- for (i = 0; i < sz && res[i].matched; i++)
- printf("[%zu] %s(%s%s%s) - %.70s\n", i + 1,
- res[i].title, res[i].cat,
- *res[i].arch ? "/" : "",
- *res[i].arch ? res[i].arch : "",
- res[i].desc);
-}
-
-static int
-cmp(const void *p1, const void *p2)
-{
- const struct res *r1 = p1;
- const struct res *r2 = p2;
-
- if (0 == r1->matched)
- return(1);
- else if (0 == r2->matched)
- return(1);
-
- return(strcasecmp(r1->title, r2->title));
-}
-
-static void
-usage(void)
-{
-
- fprintf(stderr, "usage: %s "
- "[-C file] "
- "[-M manpath] "
- "[-m manpath] "
- "[-S arch] "
- "[-s section] "
- "expression ...\n",
- progname);
-}