From 52cb62f9976a2e63c610790cea3ecc1645534c70 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 20 Mar 2011 16:05:21 +0000 Subject: 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. --- main.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index fcad33cd..d97c8551 100644 --- a/main.c +++ b/main.c @@ -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 * Copyright (c) 2010, 2011 Ingo Schwarze @@ -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) -- cgit v1.2.3