+static int man_convert(wchar_t *s, int maxlen,
+ char **result, int quote_props);
+
+typedef struct {
+ wchar_t *th;
+ int headnumbers;
+ int mindepth;
+} manconfig;
+
+static manconfig man_configure(paragraph *source) {
+ manconfig ret;
+
+ /*
+ * Defaults.
+ */
+ ret.th = NULL;
+ ret.headnumbers = FALSE;
+ ret.mindepth = 0;
+
+ for (; source; source = source->next) {
+ if (source->type == para_Config) {
+ if (!ustricmp(source->keyword, L"man-identity")) {
+ wchar_t *wp, *ep;
+
+ wp = uadv(source->keyword);
+ ep = wp;
+ while (*ep)
+ ep = uadv(ep);
+ ret.th = mknewa(wchar_t, ep - wp + 1);
+ memcpy(ret.th, wp, (ep - wp + 1) * sizeof(wchar_t));
+ } else if (!ustricmp(source->keyword, L"man-headnumbers")) {
+ ret.headnumbers = utob(uadv(source->keyword));
+ } else if (!ustricmp(source->keyword, L"man-mindepth")) {
+ ret.mindepth = utoi(uadv(source->keyword));
+ }
+ }
+ }
+
+ return ret;
+}
+
+static void man_conf_cleanup(manconfig cf)
+{
+ sfree(cf.th);
+}