-/* $Id: mdoc_action.c,v 1.39 2009/09/24 15:01:06 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.43 2009/10/24 05:52:13 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
{ NULL, NULL }, /* %Q */
{ NULL, NULL }, /* br */
{ NULL, NULL }, /* sp */
+ { NULL, NULL }, /* %U */
};
#define RSORD_MAX 13
post_os(POST_ARGS)
{
char buf[64];
+#ifndef OSNAME
struct utsname utsname;
+#endif
+
+ /*
+ * Setting OSNAME to be the name of the target operating system,
+ * e.g., "OpenBSD 4.4", will result in the compile-time constant
+ * by supplied instead of the value in uname().
+ */
if (m->meta.os)
free(m->meta.os);
return(0);
if (0 == buf[0]) {
+#ifdef OSNAME
+ if (strlcat(buf, OSNAME, 64) >= 64)
+ return(mdoc_nerr(m, n, EUTSNAME));
+#else
if (-1 == uname(&utsname))
return(mdoc_nerr(m, n, EUTSNAME));
if (strlcat(buf, utsname.sysname, 64) >= 64)
return(mdoc_nerr(m, n, ETOOLONG));
if (strlcat(buf, utsname.release, 64) >= 64)
return(mdoc_nerr(m, n, ETOOLONG));
+#endif
}
if (NULL == (m->meta.os = strdup(buf)))
}
+/* ARGSUSED */
static int
post_rs(POST_ARGS)
{
if (MDOC_BLOCK != n->type)
return(1);
+ assert(n->body->child);
for (next = NULL, nn = n->body->child->next; nn; nn = next) {
o = order_rs(nn->tok);