- for (i = 0; i < (int)sz; i++)
- printf("%s(%s%s%s) - %s\n", 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)
-{
-
- return(strcmp(((const struct res *)p1)->title,
- ((const struct res *)p2)->title));
-}
-
-static void
-usage(void)
-{
-
- fprintf(stderr, "usage: %s "
- "[-m dirs] "
- "[-S arch] "
- "[-s section] "
- "expression...\n", progname);
-}
-
-/*
- * Parse a FULL pathname from a colon-separated list of arrays.
- */
-static void
-manpath_parse(struct manpaths *dirs, char *path)
-{
- char *dir;
-
- for (dir = strtok(path, ":"); dir; dir = strtok(NULL, ":"))
- manpath_add(dirs, dir);
-}
-
-/*
- * Add a directory to the array, ignoring bad directories.
- * Grow the array one-by-one for simplicity's sake.
- */
-static void
-manpath_add(struct manpaths *dirs, const char *dir)
-{
- char buf[PATH_MAX];
- char *cp;
-
- if (NULL == (cp = realpath(dir, buf)))
- return;
-
- dirs->paths = mandoc_realloc
- (dirs->paths,
- ((size_t)dirs->sz + 1) * sizeof(char *));
+ for (i = 0; i < sz; i++) {
+ printf("%s - %s\n", res[i].names,
+ NULL == res[i].output ? "" : res[i].output);
+ free(res[i].file);
+ free(res[i].names);
+ free(res[i].output);
+ }