Lines Matching refs:n

304 	struct roff_node *n, *np;  in mdoc_validate()  local
313 n = mdoc->last; in mdoc_validate()
314 switch (n->tok) { in mdoc_validate()
316 n->tok = MDOC_Pp; in mdoc_validate()
320 n->tok = MDOC_Ft; in mdoc_validate()
334 if (mdoc->last == n) in mdoc_validate()
342 mdoc->last = n; in mdoc_validate()
344 switch (n->type) { in mdoc_validate()
346 np = n->parent; in mdoc_validate()
347 if (n->sec != SEC_SYNOPSIS || in mdoc_validate()
349 check_text(mdoc, n->line, n->pos, n->string); in mdoc_validate()
350 if ((n->flags & NODE_NOFILL) == 0 && in mdoc_validate()
353 check_text_em(mdoc, n->line, n->pos, n->string); in mdoc_validate()
356 check_toptext(mdoc, n->line, n->pos, n->string); in mdoc_validate()
374 if (n->child != NULL) in mdoc_validate()
375 n->child->flags &= ~NODE_DELIMC; in mdoc_validate()
376 if (n->last != NULL) in mdoc_validate()
377 n->last->flags &= ~NODE_DELIMO; in mdoc_validate()
381 if (n->tok < ROFF_MAX) { in mdoc_validate()
386 assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); in mdoc_validate()
387 p = mdoc_valids + (n->tok - MDOC_Dd); in mdoc_validate()
390 if (mdoc->last == n) in mdoc_validate()
391 mdoc_state(mdoc, n); in mdoc_validate()
397 check_args(struct roff_man *mdoc, struct roff_node *n) in check_args() argument
401 if (NULL == n->args) in check_args()
404 assert(n->args->argc); in check_args()
405 for (i = 0; i < (int)n->args->argc; i++) in check_args()
406 check_argv(mdoc, n, &n->args->argv[i]); in check_args()
410 check_argv(struct roff_man *mdoc, struct roff_node *n, struct mdoc_argv *v) in check_argv() argument
640 struct roff_node *n; in post_bl_norm() local
646 n = mdoc->last->parent; in post_bl_norm()
647 n->norm->Bl.type = LIST__NONE; in post_bl_norm()
655 wa = (n->args == NULL) ? NULL : n->args->argv; in post_bl_norm()
657 for (i = 0; n->args && i < (int)n->args->argc; i++) { in post_bl_norm()
658 argv = n->args->argv + i; in post_bl_norm()
697 if (n->norm->Bl.comp) in post_bl_norm()
700 n->norm->Bl.comp = 1; in post_bl_norm()
707 n->norm->Bl.width = "0n"; in post_bl_norm()
710 if (NULL != n->norm->Bl.width) in post_bl_norm()
715 n->norm->Bl.width = argv->value[0]; in post_bl_norm()
723 if (NULL != n->norm->Bl.offs) in post_bl_norm()
728 n->norm->Bl.offs = argv->value[0]; in post_bl_norm()
739 if (LIST__NONE != n->norm->Bl.type) { in post_bl_norm()
740 mandoc_msg(MANDOCERR_BL_REP, n->line, n->pos, in post_bl_norm()
747 if (n->norm->Bl.width || in post_bl_norm()
748 n->norm->Bl.offs || in post_bl_norm()
749 n->norm->Bl.comp) in post_bl_norm()
751 n->line, n->pos, "Bl -%s", in post_bl_norm()
752 mdoc_argnames[n->args->argv[0].arg]); in post_bl_norm()
754 n->norm->Bl.type = lt; in post_bl_norm()
756 n->norm->Bl.ncols = argv->sz; in post_bl_norm()
757 n->norm->Bl.cols = (void *)argv->value; in post_bl_norm()
763 if (LIST__NONE == n->norm->Bl.type) { in post_bl_norm()
764 mandoc_msg(MANDOCERR_BL_NOTYPE, n->line, n->pos, "Bl"); in post_bl_norm()
765 n->norm->Bl.type = LIST_item; in post_bl_norm()
776 switch (n->norm->Bl.type) { in post_bl_norm()
778 if (n->norm->Bl.width == NULL) in post_bl_norm()
780 n->line, n->pos, "Bl -tag"); in post_bl_norm()
787 if (n->norm->Bl.width != NULL) in post_bl_norm()
790 n->norm->Bl.width = NULL; in post_bl_norm()
795 if (n->norm->Bl.width == NULL) in post_bl_norm()
796 n->norm->Bl.width = "2n"; in post_bl_norm()
799 if (n->norm->Bl.width == NULL) in post_bl_norm()
800 n->norm->Bl.width = "3n"; in post_bl_norm()
810 struct roff_node *n; in post_bd() local
815 n = mdoc->last; in post_bd()
816 for (i = 0; n->args && i < (int)n->args->argc; i++) { in post_bd()
817 argv = n->args->argv + i; in post_bd()
837 mandoc_msg(MANDOCERR_BD_FILE, n->line, n->pos, NULL); in post_bd()
845 if (NULL != n->norm->Bd.offs) in post_bd()
850 n->norm->Bd.offs = argv->value[0]; in post_bd()
853 if (n->norm->Bd.comp) in post_bd()
856 n->norm->Bd.comp = 1; in post_bd()
864 if (DISP__NONE == n->norm->Bd.type) in post_bd()
865 n->norm->Bd.type = dt; in post_bd()
867 mandoc_msg(MANDOCERR_BD_REP, n->line, n->pos, in post_bd()
871 if (DISP__NONE == n->norm->Bd.type) { in post_bd()
872 mandoc_msg(MANDOCERR_BD_NOTYPE, n->line, n->pos, "Bd"); in post_bd()
873 n->norm->Bd.type = DISP_ragged; in post_bd()
884 struct roff_node *n; in post_an_norm() local
888 n = mdoc->last; in post_an_norm()
889 if (n->args == NULL) in post_an_norm()
892 for (i = 1; i < n->args->argc; i++) { in post_an_norm()
893 argv = n->args->argv + i; in post_an_norm()
898 argv = n->args->argv; in post_an_norm()
900 n->norm->An.auth = AUTH_split; in post_an_norm()
902 n->norm->An.auth = AUTH_nosplit; in post_an_norm()
910 struct roff_node *n; in post_eoln() local
913 n = mdoc->last; in post_eoln()
914 if (n->child != NULL) in post_eoln()
915 mandoc_msg(MANDOCERR_ARG_SKIP, n->line, in post_eoln()
916 n->pos, "%s %s", roff_name[n->tok], n->child->string); in post_eoln()
918 while (n->child != NULL) in post_eoln()
919 roff_node_delete(mdoc, n->child); in post_eoln()
921 roff_word_alloc(mdoc, n->line, n->pos, n->tok == MDOC_Bt ? in post_eoln()
924 mdoc->last = n; in post_eoln()
930 struct roff_node *n; in build_list() local
933 n = mdoc->last->next; in build_list()
935 roff_elem_alloc(mdoc, n->line, n->pos, tok); in build_list()
937 roff_node_relink(mdoc, n); in build_list()
938 n = mdoc->last = mdoc->last->parent; in build_list()
940 if (n->next == NULL) in build_list()
942 if (ic > 1 || n->next->next != NULL) { in build_list()
943 roff_word_alloc(mdoc, n->line, n->pos, ","); in build_list()
946 n = mdoc->last->next; in build_list()
947 if (n->next == NULL) { in build_list()
948 roff_word_alloc(mdoc, n->line, n->pos, "and"); in build_list()
957 struct roff_node *n; in post_ex() local
962 n = mdoc->last; in post_ex()
964 roff_word_alloc(mdoc, n->line, n->pos, "The"); in post_ex()
970 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Nm); in post_ex()
972 roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); in post_ex()
978 mandoc_msg(MANDOCERR_EX_NONAME, n->line, n->pos, "Ex"); in post_ex()
982 roff_word_alloc(mdoc, n->line, n->pos, in post_ex()
985 roff_word_alloc(mdoc, n->line, n->pos, in post_ex()
988 mdoc->last = n; in post_ex()
994 struct roff_node *n; in post_lb() local
999 n = mdoc->last; in post_lb()
1000 assert(n->child->type == ROFFT_TEXT); in post_lb()
1003 if ((p = mdoc_a2lib(n->child->string)) != NULL) { in post_lb()
1004 n->child->flags |= NODE_NOPRT; in post_lb()
1005 roff_word_alloc(mdoc, n->line, n->pos, p); in post_lb()
1007 mdoc->last = n; in post_lb()
1011 mandoc_msg(MANDOCERR_LB_BAD, n->child->line, in post_lb()
1012 n->child->pos, "Lb %s", n->child->string); in post_lb()
1014 roff_word_alloc(mdoc, n->line, n->pos, "library"); in post_lb()
1016 roff_word_alloc(mdoc, n->line, n->pos, "\\(lq"); in post_lb()
1019 roff_word_alloc(mdoc, n->line, n->pos, "\\(rq"); in post_lb()
1021 mdoc->last = n; in post_lb()
1027 struct roff_node *n; in post_rv() local
1032 n = mdoc->last; in post_rv()
1034 if (n->child != NULL) { in post_rv()
1035 roff_word_alloc(mdoc, n->line, n->pos, "The"); in post_rv()
1038 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1041 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1044 roff_word_alloc(mdoc, n->line, n->pos, "Upon successful " in post_rv()
1048 roff_word_alloc(mdoc, n->line, n->pos, "otherwise " in post_rv()
1051 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Va); in post_rv()
1053 roff_word_alloc(mdoc, n->line, n->pos, "errno"); in post_rv()
1057 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1060 mdoc->last = n; in post_rv()
1066 struct roff_node *n; in post_std() local
1070 n = mdoc->last; in post_std()
1071 if (n->args && n->args->argc == 1) in post_std()
1072 if (n->args->argv[0].arg == MDOC_Std) in post_std()
1075 mandoc_msg(MANDOCERR_ARG_STD, n->line, n->pos, in post_std()
1076 "%s", roff_name[n->tok]); in post_std()
1082 struct roff_node *n, *nch; in post_st() local
1085 n = mdoc->last; in post_st()
1086 nch = n->child; in post_st()
1092 roff_node_delete(mdoc, n); in post_st()
1100 mdoc->last= n; in post_st()
1106 struct roff_node *n; /* The .Tg node. */ in post_tg() local
1114 n = mdoc->last; in post_tg()
1115 for (nn = n; nn != NULL; nn = nn->parent) { in post_tg()
1123 nt = nch = n->child; in post_tg()
1130 mandoc_msg(MANDOCERR_MACRO_EMPTY, n->line, n->pos, "Tg"); in post_tg()
1132 roff_node_delete(mdoc, n); in post_tg()
1150 roff_node_delete(mdoc, n); in post_tg()
1156 nn = n; in post_tg()
1163 nn = nn->head->child == NULL ? n : nn->head; in post_tg()
1184 nn = nn->body->child == NULL ? n : nn->body; in post_tg()
1194 nn = nn->body->child == NULL ? n : nn->body; in post_tg()
1211 nn = n; in post_tg()
1214 nn = n; in post_tg()
1218 if (nn != n) in post_tg()
1219 n->flags |= NODE_NOPRT; in post_tg()
1225 struct roff_node *n; in post_obsolete() local
1227 n = mdoc->last; in post_obsolete()
1228 if (n->type == ROFFT_ELEM || n->type == ROFFT_BLOCK) in post_obsolete()
1229 mandoc_msg(MANDOCERR_MACRO_OBS, n->line, n->pos, in post_obsolete()
1230 "%s", roff_name[n->tok]); in post_obsolete()
1236 struct roff_node *n; in post_useless() local
1238 n = mdoc->last; in post_useless()
1239 mandoc_msg(MANDOCERR_MACRO_USELESS, n->line, n->pos, in post_useless()
1240 "%s", roff_name[n->tok]); in post_useless()
1314 struct roff_node *n, *nch; in post_fname() local
1318 n = mdoc->last; in post_fname()
1319 nch = n->child; in post_fname()
1328 if (n->sec == SEC_DESCRIPTION || in post_fname()
1329 n->sec == SEC_CUSTOM) in post_fname()
1330 tag_put(NULL, fn_prio++, n); in post_fname()
1347 const struct roff_node *n; in post_fo() local
1349 n = mdoc->last; in post_fo()
1351 if (n->type != ROFFT_HEAD) in post_fo()
1354 if (n->child == NULL) { in post_fo()
1355 mandoc_msg(MANDOCERR_FO_NOHEAD, n->line, n->pos, "Fo"); in post_fo()
1358 if (n->child != n->last) { in post_fo()
1360 n->child->next->line, n->child->next->pos, in post_fo()
1361 "Fo ... %s", n->child->next->string); in post_fo()
1362 while (n->child != n->last) in post_fo()
1363 roff_node_delete(mdoc, n->last); in post_fo()
1373 const struct roff_node *n; in post_fa() local
1376 for (n = mdoc->last->child; n != NULL; n = n->next) { in post_fa()
1377 for (cp = n->string; *cp != '\0'; cp++) { in post_fa()
1383 mandoc_msg(MANDOCERR_FA_COMMA, n->line, in post_fa()
1384 n->pos + (int)(cp - n->string), "%s", n->string); in post_fa()
1394 struct roff_node *n; in post_nm() local
1396 n = mdoc->last; in post_nm()
1398 if (n->sec == SEC_NAME && n->child != NULL && in post_nm()
1399 n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) in post_nm()
1400 mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); in post_nm()
1402 if (n->last != NULL && n->last->tok == MDOC_Pp) in post_nm()
1403 roff_node_relink(mdoc, n->last); in post_nm()
1406 deroff(&mdoc->meta.name, n); in post_nm()
1409 (mdoc->lastsec == SEC_NAME && n->child == NULL)) in post_nm()
1410 mandoc_msg(MANDOCERR_NM_NONAME, n->line, n->pos, "Nm"); in post_nm()
1412 switch (n->type) { in post_nm()
1423 if ((n->child != NULL && n->child->type == ROFFT_TEXT) || in post_nm()
1428 roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); in post_nm()
1430 mdoc->last = n; in post_nm()
1436 struct roff_node *n; in post_nd() local
1438 n = mdoc->last; in post_nd()
1440 if (n->type != ROFFT_BODY) in post_nd()
1443 if (n->sec != SEC_NAME) in post_nd()
1444 mandoc_msg(MANDOCERR_ND_LATE, n->line, n->pos, "Nd"); in post_nd()
1446 if (n->child == NULL) in post_nd()
1447 mandoc_msg(MANDOCERR_ND_EMPTY, n->line, n->pos, "Nd"); in post_nd()
1457 struct roff_node *n, *np; in post_display() local
1459 n = mdoc->last; in post_display()
1460 switch (n->type) { in post_display()
1462 if (n->end != ENDBODY_NOT) { in post_display()
1463 if (n->tok == MDOC_Bd && in post_display()
1464 n->body->parent->args == NULL) in post_display()
1465 roff_node_delete(mdoc, n); in post_display()
1466 } else if (n->child == NULL) in post_display()
1467 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, in post_display()
1468 "%s", roff_name[n->tok]); in post_display()
1469 else if (n->tok == MDOC_D1) in post_display()
1473 if (n->tok == MDOC_Bd) { in post_display()
1474 if (n->args == NULL) { in post_display()
1476 n->line, n->pos, "Bd"); in post_display()
1478 while (n->body->child != NULL) in post_display()
1480 n->body->child); in post_display()
1481 roff_node_delete(mdoc, n); in post_display()
1487 for (np = n->parent; np != NULL; np = np->parent) { in post_display()
1489 mandoc_msg(MANDOCERR_BD_NEST, n->line, in post_display()
1490 n->pos, "%s in Bd", roff_name[n->tok]); in post_display()
1503 struct roff_node *n; in post_defaults() local
1505 n = mdoc->last; in post_defaults()
1506 if (n->child != NULL) { in post_defaults()
1511 switch (n->tok) { in post_defaults()
1513 roff_word_alloc(mdoc, n->line, n->pos, "file"); in post_defaults()
1515 roff_word_alloc(mdoc, n->line, n->pos, "..."); in post_defaults()
1519 roff_word_alloc(mdoc, n->line, n->pos, "~"); in post_defaults()
1525 mdoc->last = n; in post_defaults()
1531 struct roff_node *n, *nch; in post_at() local
1534 n = mdoc->last; in post_at()
1535 nch = n->child; in post_at()
1553 roff_word_alloc(mdoc, n->line, n->pos, "AT&T UNIX"); in post_at()
1555 mdoc->last = n; in post_at()
1596 struct roff_node *n; in post_er() local
1598 n = mdoc->last; in post_er()
1599 if (n->sec == SEC_ERRORS && in post_er()
1600 (n->parent->tok == MDOC_It || in post_er()
1601 (n->parent->tok == MDOC_Bq && in post_er()
1602 n->parent->parent->parent->tok == MDOC_It))) in post_er()
1603 tag_put(NULL, TAG_STRONG, n); in post_er()
1610 struct roff_node *n; in post_tag() local
1612 n = mdoc->last; in post_tag()
1613 if ((n->prev == NULL || in post_tag()
1614 (n->prev->type == ROFFT_TEXT && in post_tag()
1615 strcmp(n->prev->string, "|") == 0)) && in post_tag()
1616 (n->parent->tok == MDOC_It || in post_tag()
1617 (n->parent->tok == MDOC_Xo && in post_tag()
1618 n->parent->parent->prev == NULL && in post_tag()
1619 n->parent->parent->parent->tok == MDOC_It))) in post_tag()
1620 tag_put(NULL, TAG_STRONG, n); in post_tag()
1634 struct roff_node *n; in post_fl() local
1642 n = mdoc->last; in post_fl()
1643 if (n->prev != NULL && n->prev->tok == MDOC_Fl && in post_fl()
1644 n->prev->child == NULL && n->child != NULL && in post_fl()
1645 (n->flags & NODE_LINE) == 0) { in post_fl()
1646 mandoc_asprintf(&cp, "\\-%s", n->child->string); in post_fl()
1647 free(n->child->string); in post_fl()
1648 n->child->string = cp; in post_fl()
1649 roff_node_delete(mdoc, n->prev); in post_fl()
1657 struct roff_node *n; in post_xx() local
1663 n = mdoc->last; in post_xx()
1664 switch (n->tok) { in post_xx()
1676 if (n->child == NULL) in post_xx()
1678 v = n->child->string; in post_xx()
1683 n->child->flags |= NODE_NOPRT; in post_xx()
1685 roff_word_alloc(mdoc, n->child->line, n->child->pos, v); in post_xx()
1689 mdoc->last = n; in post_xx()
1701 roff_word_alloc(mdoc, n->line, n->pos, os); in post_xx()
1703 mdoc->last = n; in post_xx()
1786 struct roff_node *n, *ni, *nc; in post_bl_block() local
1790 n = mdoc->last; in post_bl_block()
1791 for (ni = n->body->child; ni != NULL; ni = ni->next) { in post_bl_block()
1808 } else if (n->norm->Bl.comp == 0 && in post_bl_block()
1809 n->norm->Bl.type != LIST_column) { in post_bl_block()
2033 struct roff_node *n; in post_bk() local
2035 n = mdoc->last; in post_bk()
2037 if (n->type == ROFFT_BLOCK && n->body->child == NULL) { in post_bk()
2038 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "Bk"); in post_bk()
2039 roff_node_delete(mdoc, n); in post_bk()
2075 struct roff_node *n; in post_root() local
2101 n = mdoc->meta.first->child; in post_root()
2102 while (n->tok != MDOC_Dt || in post_root()
2103 n->child == NULL || in post_root()
2104 n->child->next == NULL || in post_root()
2105 n->child->next->next == NULL) in post_root()
2106 n = n->next; in post_root()
2107 n = n->child->next->next; in post_root()
2108 mandoc_msg(MANDOCERR_ARCH_BAD, n->line, n->pos, in post_root()
2116 n = mdoc->meta.first->child; in post_root()
2117 while (n != NULL && in post_root()
2118 (n->type == ROFFT_COMMENT || in post_root()
2119 (n->tok >= MDOC_Dd && in post_root()
2120 mdoc_macro(n->tok)->flags & MDOC_PROLOGUE))) in post_root()
2121 n = n->next; in post_root()
2123 if (n == NULL) in post_root()
2125 else if (n->tok != MDOC_Sh) in post_root()
2126 mandoc_msg(MANDOCERR_SEC_BEFORE, n->line, n->pos, in post_root()
2127 "%s", roff_name[n->tok]); in post_root()
2225 struct roff_node *n, *nch; in post_hyph() local
2228 n = mdoc->last; in post_hyph()
2229 for (nch = n->child; nch != NULL; nch = nch->next) { in post_hyph()
2239 if (n->tag == NULL && n->flags & NODE_ID) in post_hyph()
2240 n->tag = mandoc_strdup(nch->string); in post_hyph()
2249 struct roff_node *n; in post_ns() local
2251 n = mdoc->last; in post_ns()
2252 if (n->flags & NODE_LINE || in post_ns()
2253 (n->next != NULL && n->next->flags & NODE_DELIMC)) in post_ns()
2254 mandoc_msg(MANDOCERR_NS_SKIP, n->line, n->pos, NULL); in post_ns()
2296 struct roff_node *n; in post_sh_name() local
2301 for (n = mdoc->last->child; n != NULL; n = n->next) { in post_sh_name()
2302 switch (n->tok) { in post_sh_name()
2304 if (hasnm && n->child != NULL) in post_sh_name()
2306 n->line, n->pos, in post_sh_name()
2307 "Nm %s", n->child->string); in post_sh_name()
2312 if (n->next != NULL) in post_sh_name()
2314 n->line, n->pos, NULL); in post_sh_name()
2317 if (n->type == ROFFT_TEXT && in post_sh_name()
2318 n->string[0] == ',' && n->string[1] == '\0' && in post_sh_name()
2319 n->next != NULL && n->next->tok == MDOC_Nm) { in post_sh_name()
2320 n = n->next; in post_sh_name()
2326 n->line, n->pos, "%s", roff_name[n->tok]); in post_sh_name()
2343 const struct roff_node *n; in post_sh_see_also() local
2348 n = mdoc->last->child; in post_sh_see_also()
2350 while (n != NULL) { in post_sh_see_also()
2351 if (n->tok != MDOC_Xr || in post_sh_see_also()
2352 n->child == NULL || in post_sh_see_also()
2353 n->child->next == NULL) in post_sh_see_also()
2358 name = n->child->string; in post_sh_see_also()
2359 sec = n->child->next->string; in post_sh_see_also()
2362 mandoc_msg(MANDOCERR_XR_PUNCT, n->line, in post_sh_see_also()
2363 n->pos, "%s before %s(%s)", in post_sh_see_also()
2367 mandoc_msg(MANDOCERR_XR_ORDER, n->line, in post_sh_see_also()
2368 n->pos, "%s(%s) after %s(%s)", in post_sh_see_also()
2372 mandoc_msg(MANDOCERR_XR_ORDER, n->line, in post_sh_see_also()
2373 n->pos, "%s after %s", name, lastname); in post_sh_see_also()
2380 n = n->next; in post_sh_see_also()
2381 if (n == NULL) in post_sh_see_also()
2383 if (n->tok == MDOC_Xr) { in post_sh_see_also()
2387 if (n->type != ROFFT_TEXT) in post_sh_see_also()
2389 for (name = n->string; *name != '\0'; name++) in post_sh_see_also()
2392 lastpunct = n->string; in post_sh_see_also()
2393 if (n->next == NULL || n->next->tok == MDOC_Rs) in post_sh_see_also()
2394 mandoc_msg(MANDOCERR_XR_PUNCT, n->line, in post_sh_see_also()
2395 n->pos, "%s after %s(%s)", in post_sh_see_also()
2397 n = n->next; in post_sh_see_also()
2402 child_an(const struct roff_node *n) in child_an() argument
2405 for (n = n->child; n != NULL; n = n->next) in child_an()
2406 if ((n->tok == MDOC_An && n->child != NULL) || child_an(n)) in child_an()
2583 struct roff_node *n, *nch; in post_xr() local
2585 n = mdoc->last; in post_xr()
2586 nch = n->child; in post_xr()
2589 n->line, n->pos, "Xr %s", nch->string); in post_xr()
2591 assert(nch->next == n->last); in post_xr()
2604 struct roff_node *n, *nch; in post_section() local
2607 n = mdoc->last; in post_section()
2608 switch (n->type) { in post_section()
2614 deroff(&tag, n); in post_section()
2619 if ((nch = n->child) != NULL && in post_section()
2622 tag_put(NULL, TAG_STRONG, n); in post_section()
2624 tag_put(tag, TAG_FALLBACK, n); in post_section()
2635 if ((nch = n->child) != NULL && in post_section()
2640 roff_name[n->tok]); in post_section()
2643 if ((nch = n->last) != NULL && in post_section()
2647 roff_name[n->tok]); in post_section()
2655 struct roff_node *n, *np; in post_prevpar() local
2657 n = mdoc->last; in post_prevpar()
2658 if (n->type != ROFFT_ELEM && n->type != ROFFT_BLOCK) in post_prevpar()
2660 if ((np = roff_node_prev(n)) == NULL) in post_prevpar()
2670 if (n->tok == MDOC_Bl && n->norm->Bl.comp) in post_prevpar()
2672 if (n->tok == MDOC_Bd && n->norm->Bd.comp) in post_prevpar()
2674 if (n->tok == MDOC_It && n->parent->norm->Bl.comp) in post_prevpar()
2678 "%s before %s", roff_name[np->tok], roff_name[n->tok]); in post_prevpar()
2699 struct roff_node *n; in post_dd() local
2701 n = mdoc->last; in post_dd()
2702 n->flags |= NODE_NOPRT; in post_dd()
2705 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dd"); in post_dd()
2708 mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Dd"); in post_dd()
2711 n->line, n->pos, "Dd after Dt"); in post_dd()
2714 n->line, n->pos, "Dd after Os"); in post_dd()
2716 if (mdoc->quick && n != NULL) in post_dd()
2719 mdoc->meta.date = mandoc_normdate(n->child, n); in post_dd()
2725 struct roff_node *nn, *n; in post_dt() local
2729 n = mdoc->last; in post_dt()
2730 n->flags |= NODE_NOPRT; in post_dt()
2733 mandoc_msg(MANDOCERR_DT_LATE, n->line, n->pos, "Dt"); in post_dt()
2738 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dt"); in post_dt()
2741 n->line, n->pos, "Dt after Os"); in post_dt()
2755 nn = n->child; in post_dt()
2757 mandoc_msg(MANDOCERR_DT_NOTITLE, n->line, n->pos, "Dt"); in post_dt()
2779 mandoc_msg(MANDOCERR_MSEC_MISSING, n->line, n->pos, in post_dt()
2822 struct roff_node *n, *nch; in post_bx() local
2827 n = mdoc->last; in post_bx()
2828 nch = n->child; in post_bx()
2837 n->line, n->pos, "%s", macro); in post_bx()
2841 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2846 roff_word_alloc(mdoc, n->line, n->pos, "BSD"); in post_bx()
2850 mdoc->last = n; in post_bx()
2854 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2857 roff_word_alloc(mdoc, n->line, n->pos, "-"); in post_bx()
2859 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2861 mdoc->last = n; in post_bx()
2879 struct roff_node *n; in post_os() local
2881 n = mdoc->last; in post_os()
2882 n->flags |= NODE_NOPRT; in post_os()
2885 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Os"); in post_os()
2887 mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Os"); in post_os()
2902 deroff(&mdoc->meta.os, n); in post_os()
2916 mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); in post_os()
2939 if (n->child != NULL) in post_os()
2940 mandoc_msg(MANDOCERR_OS_ARG, n->child->line, n->child->pos, in post_os()
2941 "Os %s (%s)", n->child->string, in post_os()
2945 while (n->tok != MDOC_Dd) in post_os()
2946 if ((n = n->prev) == NULL) in post_os()
2948 if ((n = n->child) == NULL) in post_os()
2950 if (strncmp(n->string, "$" "Mdocdate", 9)) { in post_os()
2952 mandoc_msg(MANDOCERR_MDOCDATE_MISSING, n->line, in post_os()
2953 n->pos, "Dd %s (OpenBSD)", n->string); in post_os()
2956 mandoc_msg(MANDOCERR_MDOCDATE, n->line, in post_os()
2957 n->pos, "Dd %s (NetBSD)", n->string); in post_os()