-static void
-pg_search(const struct manpaths *ps, const struct req *req, char *path)
-{
- size_t tt;
- int i, sz, rc, whatis;
- const char *ep, *start;
- char **cp;
- struct opts opt;
- struct expr *expr;
-
- expr = NULL;
- cp = NULL;
- ep = NULL;
- sz = 0;
- whatis = 0;
-
- memset(&opt, 0, sizeof(struct opts));
-
- for (sz = i = 0; i < (int)req->fieldsz; i++)
- if (0 == strcmp(req->fields[i].key, "expr"))
- ep = req->fields[i].val;
- else if (0 == strcmp(req->fields[i].key, "query"))
- ep = req->fields[i].val;
- else if (0 == strcmp(req->fields[i].key, "sec"))
- opt.cat = req->fields[i].val;
- else if (0 == strcmp(req->fields[i].key, "sektion"))
- opt.cat = req->fields[i].val;
- else if (0 == strcmp(req->fields[i].key, "arch"))
- opt.arch = req->fields[i].val;
- else if (0 == strcmp(req->fields[i].key, "apropos"))
- whatis = 0 == strcmp
- (req->fields[i].val, "0");
- else if (0 == strcmp(req->fields[i].key, "op"))
- whatis = 0 == strcasecmp
- (req->fields[i].val, "whatis");
-
- if (NULL != opt.cat && 0 == strcmp(opt.cat, "0"))
- opt.cat = NULL;
+ search.arch = req->q.arch;
+ search.sec = req->q.sec;
+ search.deftype = TYPE_Nm | TYPE_Nd;
+ search.flags = 0;
+
+ paths.sz = 1;
+ paths.paths = mandoc_malloc(sizeof(char *));
+ paths.paths[0] = mandoc_strdup(".");