diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:05:21 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:05:21 +0000 |
commit | 52cb62f9976a2e63c610790cea3ecc1645534c70 (patch) | |
tree | e203a899f8dd1beb25a1b17facf00acb70c69ef2 /main.c | |
parent | 71ddcd873082a3c68ed2be7b7661075fb09d5849 (diff) | |
download | mandoc-52cb62f9976a2e63c610790cea3ecc1645534c70.tar.gz mandoc-52cb62f9976a2e63c610790cea3ecc1645534c70.tar.zst mandoc-52cb62f9976a2e63c610790cea3ecc1645534c70.zip |
Let read.c worry about the currently-open file instead of having this
information duplicated in main.c. For the time being, remove evt_close
and evt_open, as the only known mparse interface (main.c) doesn't need
them.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 24 |
1 files changed, 2 insertions, 22 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.155 2011/03/20 16:02:05 kristaps Exp $ */ +/* $Id: main.c,v 1.156 2011/03/20 16:05:21 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -54,7 +54,6 @@ enum outt { struct curparse { struct mparse *mp; - const char *file; /* current file-name */ enum mandoclevel wlevel; /* ignore messages below this */ int wstop; /* stop after a file with a warning */ enum outt outtype; /* which output to use */ @@ -182,8 +181,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "static buffer exhausted", }; -static void evt_close(void *, const char *); -static int evt_open(void *, const char *); static int moptions(enum mparset *, char *); static void mmsg(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); @@ -243,7 +240,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } - curp.mp = mparse_alloc(type, evt_open, evt_close, curp.wlevel, mmsg, &curp); + curp.mp = mparse_alloc(type, curp.wlevel, mmsg, &curp); argc -= optind; argv += optind; @@ -293,23 +290,6 @@ usage(void) exit((int)MANDOCLEVEL_BADARG); } -static int -evt_open(void *arg, const char *file) -{ - - evt_close(arg, file); - return(1); -} - -static void -evt_close(void *arg, const char *file) -{ - struct curparse *p; - - p = (struct curparse *)arg; - p->file = file; -} - static void parse(struct curparse *curp, int fd, const char *file, enum mandoclevel *level) |