summaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-26 15:22:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-26 15:22:19 +0000
commit712ec41a30db9c8794ec92168b9d2b39f1dee6da (patch)
tree806d94fb8a0c37e22702bd3d39e6ebe9d45925e8 /main.c
parent3234ace1ba2fef84ad009e6822dd76699a34e344 (diff)
downloadmandoc-712ec41a30db9c8794ec92168b9d2b39f1dee6da.tar.gz
mandoc-712ec41a30db9c8794ec92168b9d2b39f1dee6da.tar.zst
mandoc-712ec41a30db9c8794ec92168b9d2b39f1dee6da.zip
First step of adding register support. This is inspired by a significant
patch by schwarze@. This commit adds support to libroff parsing `nr' into register set defined in regs.h. This will propogate into libmdoc and libman in later commits.
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.c b/main.c
index 4aeb99ec..a8e83824 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.89 2010/06/19 20:46:27 kristaps Exp $ */
+/* $Id: main.c,v 1.90 2010/06/26 15:22:19 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -30,10 +30,11 @@
#include <unistd.h>
#include "mandoc.h"
+#include "regs.h"
+#include "main.h"
#include "mdoc.h"
#include "man.h"
#include "roff.h"
-#include "main.h"
#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a))
@@ -450,11 +451,13 @@ fdesc(struct curparse *curp)
struct man *man;
struct mdoc *mdoc;
struct roff *roff;
+ struct regset regs;
man = NULL;
mdoc = NULL;
roff = NULL;
memset(&ln, 0, sizeof(struct buf));
+ memset(&regs, 0, sizeof(struct regset));
/*
* Two buffers: ln and buf. buf is the input file and may be
@@ -537,7 +540,7 @@ fdesc(struct curparse *curp)
of = 0;
do {
- re = roff_parseln(roff, lnn_start,
+ re = roff_parseln(roff, &regs, lnn_start,
&ln.buf, &ln.sz, of, &of);
} while (ROFF_RERUN == re);