#include "roff.h"
#include "man.h"
#include "libmandoc.h"
+#include "roff_int.h"
#include "libman.h"
-#define CHKARGS struct man *man, struct man_node *n
+#define CHKARGS struct roff_man *man, struct roff_node *n
typedef void (*v_check)(CHKARGS);
void
-man_valid_post(struct man *man)
+man_valid_post(struct roff_man *man)
{
- struct man_node *n;
+ struct roff_node *n;
v_check *cp;
n = man->last;
check_root(man, n);
break;
case ROFFT_EQN:
- /* FALLTHROUGH */
case ROFFT_TBL:
break;
default:
cp = n->child->string;
switch (*cp) {
case '1':
- /* FALLTHROUGH */
case '2':
- /* FALLTHROUGH */
case '3':
- /* FALLTHROUGH */
case '4':
- /* FALLTHROUGH */
case 'I':
- /* FALLTHROUGH */
case 'P':
- /* FALLTHROUGH */
case 'R':
if ('\0' == cp[1])
ok = 1;
switch (n->type) {
case ROFFT_BLOCK:
if (0 == n->body->nchild)
- man_node_delete(man, n);
+ roff_node_delete(man, n);
break;
case ROFFT_BODY:
if (0 == n->nchild)
switch (n->type) {
case ROFFT_BLOCK:
if (0 == n->head->nchild && 0 == n->body->nchild)
- man_node_delete(man, n);
+ roff_node_delete(man, n);
break;
case ROFFT_BODY:
if (0 == n->parent->head->nchild && 0 == n->nchild)
static void
post_TH(CHKARGS)
{
- struct man_node *nb;
+ struct roff_node *nb;
const char *p;
free(man->meta.title);
free(man->meta.vol);
- free(man->meta.source);
+ free(man->meta.os);
free(man->meta.msec);
free(man->meta.date);
man->meta.title = man->meta.vol = man->meta.date =
- man->meta.msec = man->meta.source = NULL;
+ man->meta.msec = man->meta.os = NULL;
nb = n;
- /* ->TITLE<- MSEC DATE SOURCE VOL */
+ /* ->TITLE<- MSEC DATE OS VOL */
n = n->child;
if (n && n->string) {
nb->line, nb->pos, "TH");
}
- /* TITLE ->MSEC<- DATE SOURCE VOL */
+ /* TITLE ->MSEC<- DATE OS VOL */
if (n)
n = n->next;
nb->line, nb->pos, "TH %s", man->meta.title);
}
- /* TITLE MSEC ->DATE<- SOURCE VOL */
+ /* TITLE MSEC ->DATE<- OS VOL */
if (n)
n = n->next;
n ? n->pos : nb->pos, "TH");
}
- /* TITLE MSEC DATE ->SOURCE<- VOL */
+ /* TITLE MSEC DATE ->OS<- VOL */
if (n && (n = n->next))
- man->meta.source = mandoc_strdup(n->string);
+ man->meta.os = mandoc_strdup(n->string);
else if (man->defos != NULL)
- man->meta.source = mandoc_strdup(man->defos);
+ man->meta.os = mandoc_strdup(man->defos);
- /* TITLE MSEC DATE SOURCE ->VOL<- */
+ /* TITLE MSEC DATE OS ->VOL<- */
/* If missing, use the default VOL name for MSEC. */
if (n && (n = n->next))
* Remove the `TH' node after we've processed it for our
* meta-data.
*/
- man_node_delete(man, man->last);
+ roff_node_delete(man, man->last);
}
static void
p = bsd_versions[0];
}
- free(man->meta.source);
- man->meta.source = mandoc_strdup(p);
+ free(man->meta.os);
+ man->meta.os = mandoc_strdup(p);
}
static void
"System V Release 2",
};
+ struct roff_node *nn;
const char *p, *s;
- struct man_node *nn;
n = n->child;
p = unix_versions[0];
}
- free(man->meta.source);
- man->meta.source = mandoc_strdup(p);
+ free(man->meta.os);
+ man->meta.os = mandoc_strdup(p);
}
static void
switch (n->parent->tok) {
case MAN_SH:
- /* FALLTHROUGH */
case MAN_SS:
mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos,
"%s after %s", man_macronames[n->tok],
man_macronames[n->parent->tok]);
/* FALLTHROUGH */
- case MAN_MAX:
+ case TOKEN_NONE:
/*
* Don't warn about this because it occurs in pod2man
* and would cause considerable (unfixable) warnage.
*/
- man_node_delete(man, n);
+ roff_node_delete(man, n);
break;
default:
break;