Lines Matching refs:n

86 tag_put(const char *s, int prio, struct roff_node *n)  in tag_put()  argument
97 if (n->child == NULL || n->child->type != ROFFT_TEXT) in tag_put()
99 s = n->child->string; in tag_put()
181 entry->nodes[entry->nnodes++] = n; in tag_put()
183 n->flags |= NODE_ID; in tag_put()
184 if (n->child == NULL || n->child->string != s || *se != '\0') { in tag_put()
185 assert(n->tag == NULL); in tag_put()
186 n->tag = mandoc_strndup(s, len); in tag_put()
201 tag_move_id(struct roff_node *n) in tag_move_id() argument
205 np = n; in tag_move_id()
233 np->tag = mandoc_strdup(n->tag == NULL ? in tag_move_id()
234 n->child->string : n->tag); in tag_move_id()
236 n->flags &= ~NODE_ID; in tag_move_id()
263 tag_move_href(struct roff_man *man, struct roff_node *n, const char *tag) in tag_move_href() argument
267 if (n == NULL || n->type != ROFFT_TEXT || in tag_move_href()
268 *n->string == '\0' || *n->string == ' ') in tag_move_href()
271 cp = n->string; in tag_move_href()
272 while (cp != NULL && cp - n->string < 5) in tag_move_href()
278 man->last = n; in tag_move_href()
280 roff_word_alloc(man, n->line, in tag_move_href()
281 n->pos + (cp - n->string), cp + 1); in tag_move_href()
282 man->last->flags = n->flags & ~NODE_LINE; in tag_move_href()
286 assert(n->tag == NULL); in tag_move_href()
287 n->tag = mandoc_strdup(tag); in tag_move_href()
288 n->flags |= NODE_HREF; in tag_move_href()
297 tag_postprocess(struct roff_man *man, struct roff_node *n) in tag_postprocess() argument
299 if (n->flags & NODE_ID) { in tag_postprocess()
300 switch (n->tok) { in tag_postprocess()
302 tag_move_href(man, n->next, n->tag); in tag_postprocess()
307 tag_move_href(man, n->child, n->tag); in tag_postprocess()
313 if (n->type == ROFFT_ELEM || n->tok == MDOC_Fo) in tag_postprocess()
314 tag_move_id(n); in tag_postprocess()
315 if (n->tok != MDOC_Tg) in tag_postprocess()
316 n->flags |= NODE_HREF; in tag_postprocess()
317 else if ((n->flags & NODE_ID) == 0) { in tag_postprocess()
318 n->flags |= NODE_NOPRT; in tag_postprocess()
319 free(n->tag); in tag_postprocess()
320 n->tag = NULL; in tag_postprocess()
325 for (n = n->child; n != NULL; n = n->next) in tag_postprocess()
326 tag_postprocess(man, n); in tag_postprocess()