Lines Matching defs:man

1 /*	$Id: man.c,v 1.166 2015/10/22 21:54:23 schwarze Exp $ */
33 #include "man.h"
59 man_parseln(struct roff_man *man, int ln, char *buf, int offs)
62 if (man->last->type != ROFFT_EQN || ln > man->last->line)
63 man->flags |= MAN_NEWLINE;
65 return roff_getcontrol(man->roff, buf, &offs) ?
66 man_pmacro(man, ln, buf, offs) :
67 man_ptext(man, ln, buf, offs);
71 man_descope(struct roff_man *man, int line, int offs)
79 if (man->flags & MAN_ELINE) {
80 man->flags &= ~MAN_ELINE;
81 man_unscope(man, man->last->parent);
83 if ( ! (man->flags & MAN_BLINE))
85 man->flags &= ~MAN_BLINE;
86 man_unscope(man, man->last->parent);
87 roff_body_alloc(man, line, offs, man->last->tok);
91 man_ptext(struct roff_man *man, int line, char *buf, int offs)
97 if (man->flags & MAN_LITERAL) {
98 roff_word_alloc(man, line, offs, buf + offs);
99 man_descope(man, line, offs);
113 if (man->last->tok != MAN_SH &&
114 man->last->tok != MAN_SS) {
115 roff_elem_alloc(man, line, offs, MAN_sp);
116 man->next = ROFF_NEXT_SIBLING;
131 mandoc_msg(MANDOCERR_SPACE_EOL, man->parse,
142 roff_word_alloc(man, line, offs, buf + offs);
152 man->last->flags |= MAN_EOS;
154 man_descope(man, line, offs);
159 man_pmacro(struct roff_man *man, int ln, char *buf, int offs)
184 mandoc_msg(MANDOCERR_MACRO, man->parse,
215 mandoc_msg(MANDOCERR_SPACE_EOL, man->parse,
223 man_breakscope(man, tok);
224 bline = man->flags & MAN_BLINE;
229 (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf);
233 if (man->quick && tok == MAN_SH) {
234 n = man->last;
246 if ( ! bline || man->flags & MAN_ELINE ||
250 assert(man->flags & MAN_BLINE);
251 man->flags &= ~MAN_BLINE;
253 man_unscope(man, man->last->parent);
254 roff_body_alloc(man, ln, ppos, man->last->tok);
259 man_breakscope(struct roff_man *man, int tok)
269 if (man->flags & MAN_ELINE && (tok == TOKEN_NONE ||
271 n = man->last;
276 mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
281 roff_node_delete(man, n);
282 man->flags &= ~MAN_ELINE;
290 if (man->flags & MAN_BLINE &&
292 (man->last->tok == MAN_SH || man->last->tok == MAN_SS)) {
293 n = man->last;
294 man_unscope(man, n);
295 roff_body_alloc(man, n->line, n->pos, n->tok);
296 man->flags &= ~MAN_BLINE;
305 if (man->flags & MAN_BLINE && (tok == TOKEN_NONE ||
307 n = man->last;
318 mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
323 roff_node_delete(man, n);
324 man->flags &= ~MAN_BLINE;
329 man_mparse(const struct roff_man *man)
332 assert(man && man->parse);
333 return man->parse;
337 man_state(struct roff_man *man, struct roff_node *n)
343 if (man->flags & MAN_LITERAL && ! (n->flags & MAN_VALID))
344 mandoc_msg(MANDOCERR_NF_SKIP, man->parse,
346 man->flags |= MAN_LITERAL;
350 if ( ! (man->flags & MAN_LITERAL) &&
352 mandoc_msg(MANDOCERR_FI_SKIP, man->parse,
354 man->flags &= ~MAN_LITERAL;
359 man->last->flags |= MAN_VALID;
363 man_validate(struct roff_man *man)
366 man->last = man->first;
367 man_node_validate(man);
368 man->flags &= ~MAN_LITERAL;