-
- nn = n;
- m->next = MDOC_NEXT_CHILD;
- assert(m->meta.name);
- if ( ! mdoc_word_alloc(m, n->line, n->pos, m->meta.name))
- return(0);
- m->last = nn;
-
- return(1);
-}
-
-
-static int
-post_nm(POST_ARGS)
-{
- char buf[64];
-
- if (m->meta.name)
- return(1);
-
- buf[0] = 0;
- if ( ! concat(m, n->child, buf, sizeof(buf)))
- return(0);
- if (NULL == (m->meta.name = strdup(buf)))
- return(mdoc_nerr(m, n, EMALLOC));
-
- return(1);
-}
-
-
-static int
-post_lb(POST_ARGS)
-{
- const char *p;
- char *buf;
- size_t sz;
-
- assert(MDOC_TEXT == n->child->type);
- p = mdoc_a2lib(n->child->string);
- if (NULL == p) {
- sz = strlen(n->child->string) +
- 2 + strlen("\\(lqlibrary\\(rq");
- buf = malloc(sz);
- if (NULL == buf)
- return(mdoc_nerr(m, n, EMALLOC));
- (void)snprintf(buf, sz, "library \\(lq%s\\(rq",
- n->child->string);
- free(n->child->string);
- n->child->string = buf;
- return(1);
- }
-
- free(n->child->string);
- n->child->string = strdup(p);
- if (NULL == n->child->string)
- return(mdoc_nerr(m, n, EMALLOC));
-
- return(1);
-}
-
-
-static int
-post_st(POST_ARGS)
-{
- const char *p;
-
- assert(MDOC_TEXT == n->child->type);
- p = mdoc_a2st(n->child->string);
- assert(p);
- free(n->child->string);
- n->child->string = strdup(p);
- if (NULL == n->child->string)
- return(mdoc_nerr(m, n, EMALLOC));
-
- return(1);
-}
-
-
-static int
-post_at(POST_ARGS)
-{
- struct mdoc_node *nn;
- const char *p;
-
- if (n->child) {
- assert(MDOC_TEXT == n->child->type);
- p = mdoc_a2att(n->child->string);
- assert(p);
- free(n->child->string);
- n->child->string = strdup(p);
- if (NULL == n->child->string)
- return(mdoc_nerr(m, n, EMALLOC));