Lines Matching defs:roff

1 /* $Id: roff.c,v 1.400 2023/10/24 20:53:12 schwarze Exp $ */
18 * Implementation of the roff(7) parser for mandoc(1).
36 #include "roff.h"
102 struct roff {
144 #define ROFF_ARGS struct roff *r, /* parse ctx */ \
172 static int roffnode_cleanscope(struct roff *);
173 static int roffnode_pop(struct roff *);
174 static void roffnode_push(struct roff *, enum roff_tok,
184 static int roff_ccond(struct roff *, int, int);
193 static int roff_eqndelim(struct roff *, struct buf *, int);
194 static int roff_evalcond(struct roff *, int, char *, int *);
195 static int roff_evalnum(struct roff *, int,
197 static int roff_evalpar(struct roff *, int,
200 static int roff_expand(struct roff *, struct buf *,
204 static void roff_free1(struct roff *);
207 static size_t roff_getname(struct roff *, char **, int, int);
210 static int roff_getregn(struct roff *,
212 static int roff_getregro(const struct roff *,
214 static const char *roff_getstrn(struct roff *,
216 static int roff_hasregn(const struct roff *,
229 static enum roff_tok roff_parse(struct roff *, char *, int *,
231 static int roff_parse_comment(struct roff *, struct buf *,
233 static int roff_parsetext(struct roff *, struct buf *,
241 static void roff_setregn(struct roff *, const char *,
243 static void roff_setstr(struct roff *,
693 * Pop the current node off of the stack of roff instructions currently
697 roffnode_pop(struct roff *r)
712 * Push a roff node onto the instruction stack. This must later be
716 roffnode_push(struct roff *r, enum roff_tok tok, const char *name,
733 /* --- roff parser state data management ---------------------------------- */
736 roff_free1(struct roff *r)
773 roff_reset(struct roff *r)
787 roff_free(struct roff *r)
799 struct roff *
802 struct roff *r;
804 r = mandoc_calloc(1, sizeof(struct roff));
839 roff_setreg(man->roff, "nS", 0, '=');
868 roff_man_alloc(struct roff *roff, const char *os_s, int quick)
873 man->roff = roff;
877 roff->man = man;
971 n->string = roff_strdup(man->roff, word);
984 addstr = roff_strdup(man->roff, word);
1229 /* --- main functions of the roff parser ---------------------------------- */
1239 roff_parse_comment(struct roff *r, struct buf *buf, int ln, int pos, char ec)
1359 roff_expand(struct roff *r, struct buf *buf, int ln, int pos, char ec)
1617 * Parse a quoted or unquoted roff-style request or macro argument.
1626 roff_getarg(struct roff *r, char **cpp, int ln, int *pos)
1732 roff_parsetext(struct roff *r, struct buf *buf, int pos, int *offs)
1798 roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs, size_t len)
1933 * This is neither a roff request nor a user-defined macro.
1940 /* Execute a roff request or a user-defined macro. */
1946 * Internal interface function to tell the roff parser that execution
1951 roff_userret(struct roff *r)
1965 roff_endparse(struct roff *r)
1991 roff_parse(struct roff *r, char *buf, int *pos, int ln, int ppos)
2086 roffnode_cleanscope(struct roff *r)
2105 roff_ccond(struct roff *r, int ln, int ppos)
2549 roff_evalcond(struct roff *r, int ln, char *v, int *pos)
2865 roff_evalpar(struct roff *r, int ln,
2895 roff_evalnum(struct roff *r, int ln, const char *v,
3005 roff_setreg(struct roff *r, const char *name, int val, char sign)
3011 roff_setregn(struct roff *r, const char *name, size_t len,
3051 roff_getregro(const struct roff *r, const char *name)
3075 roff_getreg(struct roff *r, const char *name)
3081 roff_getregn(struct roff *r, const char *name, size_t len, char sign)
3114 roff_hasregn(const struct roff *r, const char *name, size_t len)
3208 /* --- handler functions for roff requests -------------------------------- */
3324 roff_eqndelim(struct roff *r, struct buf *buf, int pos)
4025 * Measure the length in bytes of the roff identifier at *cpp
4029 roff_getname(struct roff *r, char **cpp, int ln, int pos)
4099 roff_setstr(struct roff *r, const char *name, const char *string,
4166 * Rudimentary roff copy mode:
4183 roff_getstrn(struct roff *r, const char *name, size_t len,
4297 roff_strdup(const struct roff *r, const char *p)
4385 roff_getformat(const struct roff *r)
4402 roff_getcontrol(const struct roff *r, const char *cp, int *ppos)