+mandoc_normdate(struct mparse *parse, char *in, int ln, int pos)
+{
+ time_t t;
+
+ /* No date specified: use today's date. */
+
+ if (in == NULL || *in == '\0' || strcmp(in, "$" "Mdocdate$") == 0) {
+ mandoc_msg(MANDOCERR_DATE_MISSING, parse, ln, pos, NULL);
+ return time2a(time(NULL));
+ }
+
+ /* Valid mdoc(7) date format. */
+
+ if (a2time(&t, "$" "Mdocdate: %b %d %Y $", in) ||
+ a2time(&t, "%b %d, %Y", in))
+ return time2a(t);
+
+ /* Do not warn about the legacy man(7) format. */
+
+ if ( ! a2time(&t, "%Y-%m-%d", in))
+ mandoc_msg(MANDOCERR_DATE_BAD, parse, ln, pos, in);
+
+ /* Use any non-mdoc(7) date verbatim. */
+
+ return mandoc_strdup(in);
+}
+
+int
+mandoc_eos(const char *p, size_t sz)