-static int roffargs(int, char *, char **);
-static int roffparse(struct rofftree *, char *, size_t);
-static int textparse(const struct rofftree *,
- const char *, size_t);
-
-
-static const struct rofftok tokens[ROFF_MAX] = {
- { NULL, ROFF_COMMENT, 0 },
- { roff_Dd, ROFF_TEXT, 0 }, /* Dd */
- { roff_Dt, ROFF_TEXT, 0 }, /* Dt */
- { roff_Os, ROFF_TEXT, 0 }, /* Os */
- { roff_layout, ROFF_LAYOUT, ROFF_PARSED }, /* Sh */
- { roff_layout, ROFF_LAYOUT, ROFF_PARSED }, /* Ss XXX */
- { roff_layout, ROFF_LAYOUT, 0 }, /* Pp */
- { roff_layout, ROFF_LAYOUT, 0 }, /* D1 */
- { roff_layout, ROFF_LAYOUT, 0 }, /* Dl */
- { roff_layout, ROFF_LAYOUT, 0 }, /* Bd */
- { roff_layout, ROFF_LAYOUT, 0 }, /* Ed */
- { roff_layout, ROFF_LAYOUT, 0 }, /* Bl */
- { roff_layout, ROFF_LAYOUT, 0 }, /* El */
- { roff_layout, ROFF_LAYOUT, 0 }, /* It */
- { roff_text, ROFF_TEXT, ROFF_PARSED }, /* An */
- { roff_text, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Li */
-};
-
-/* FIXME: multiple owners? */
-
-static const struct roffarg tokenargs[ROFF_ARGMAX] = {
- { ROFF_An, 0 }, /* split */
- { ROFF_An, 0 }, /* nosplit */
- { ROFF_Bd, 0 }, /* ragged */
- { ROFF_Bd, 0 }, /* unfilled */
- { ROFF_Bd, 0 }, /* literal */
- { ROFF_Bd, ROFF_VALUE }, /* file */
- { ROFF_Bd, ROFF_VALUE }, /* offset */
- { ROFF_Bl, 0 }, /* bullet */
- { ROFF_Bl, 0 }, /* dash */
- { ROFF_Bl, 0 }, /* hyphen */
- { ROFF_Bl, 0 }, /* item */
- { ROFF_Bl, 0 }, /* enum */
- { ROFF_Bl, 0 }, /* tag */
- { ROFF_Bl, 0 }, /* diag */
- { ROFF_Bl, 0 }, /* hang */
- { ROFF_Bl, 0 }, /* ohang */
- { ROFF_Bl, 0 }, /* inset */
- { ROFF_Bl, 0 }, /* column */
-};
-
-static const char *const toknames[ROFF_MAX] = ROFF_NAMES;
-static const char *const tokargnames[ROFF_ARGMAX] = ROFF_ARGNAMES;
-
+static int roffargs(const struct rofftree *,
+ int, char *, char **);
+static int roffargok(int, int);
+static int roffnextopt(const struct rofftree *,
+ int, char ***, char **);
+static int roffparseopts(struct rofftree *, int,
+ char ***, int *, char **);
+static int roffcall(struct rofftree *, int, char **);
+static int roffparse(struct rofftree *, char *);
+static int textparse(struct rofftree *, char *);
+static int roffdata(struct rofftree *, int, char *);
+static int roffspecial(struct rofftree *, int,
+ const char *, size_t, char **);
+static int roffsetname(struct rofftree *, char **);
+
+#ifdef __linux__
+extern size_t strlcat(char *, const char *, size_t);
+extern size_t strlcpy(char *, const char *, size_t);
+extern int vsnprintf(char *, size_t,
+ const char *, va_list);
+extern char *strptime(const char *, const char *,
+ struct tm *);
+#endif