From da302548a58ff17d53b0d3e89bf0739d9ce61f10 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 17 Jul 2011 12:13:37 +0000 Subject: Add initial `define' support for eqn(7). This works by iterating over a simple list. It's a slow, auditable early implementation. Data is read (the reading function will be reused) then parsed, then the line re-run if remaining stuff exists. Note this function isn't the same as mandoc_getarg(), as eqn(7) uses a different system for reading quoted strings. This doesn't actually use the defines. --- roff.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index b6fa4682..f2b2a743 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.145 2011/07/12 21:32:43 kristaps Exp $ */ +/* $Id: roff.c,v 1.146 2011/07/17 12:13:37 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -519,18 +519,18 @@ roff_parseln(struct roff *r, int ln, char **bufp, if (ROFF_CONT != e) return(e); if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, pos)); + return(eqn_read(&r->eqn, ln, *bufp, pos, offs)); if (r->tbl) return(tbl_read(r->tbl, ln, *bufp, pos)); return(ROFF_CONT); } else if ( ! ctl) { if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, pos)); + return(eqn_read(&r->eqn, ln, *bufp, pos, offs)); if (r->tbl) return(tbl_read(r->tbl, ln, *bufp, pos)); return(ROFF_CONT); } else if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, ppos)); + return(eqn_read(&r->eqn, ln, *bufp, ppos, offs)); /* * If a scope is open, go to the child handler for that macro, -- cgit v1.2.3-56-ge451