summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:05:21 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:05:21 +0000
commit002654087a2649b42224713c7386f9c9d3b71435 (patch)
tree0deca47fa43559ea06eeb65f1dc893083709506d /read.c
parent80339b751a1833d9bbbf9856e7f48f56d91ba1d3 (diff)
downloadmandoc-002654087a2649b42224713c7386f9c9d3b71435.tar.gz
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 'read.c')
-rw-r--r--read.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/read.c b/read.c
index 8f401733..054086c4 100644
--- a/read.c
+++ b/read.c
@@ -58,8 +58,6 @@ struct mparse {
int reparse_count; /* finite interp. stack */
mandocmsg mmsg; /* warning/error message handler */
void *arg; /* argument to mmsg */
- mevt_open evt_open; /* file-open event */
- mevt_close evt_close; /* file-close event */
const char *file;
};
@@ -518,11 +516,6 @@ mparse_readfd_r(struct mparse *curp, int fd, const char *file, int re)
{
const char *svfile;
- if ( ! (*curp->evt_open)(curp->arg, file)) {
- curp->file_status = MANDOCLEVEL_SYSERR;
- return;
- }
-
if (-1 == fd)
if (-1 == (fd = open(file, O_RDONLY, 0))) {
perror(file);
@@ -541,7 +534,6 @@ mparse_readfd_r(struct mparse *curp, int fd, const char *file, int re)
if (STDIN_FILENO != fd && -1 == close(fd))
perror(file);
- (*curp->evt_close)(curp->arg, file);
curp->file = svfile;
}
@@ -554,8 +546,7 @@ mparse_readfd(struct mparse *curp, int fd, const char *file)
}
struct mparse *
-mparse_alloc(enum mparset inttype, mevt_open eopen,
- mevt_close eclose, enum mandoclevel wlevel, mandocmsg mmsg, void *arg)
+mparse_alloc(enum mparset inttype, enum mandoclevel wlevel, mandocmsg mmsg, void *arg)
{
struct mparse *curp;
@@ -565,8 +556,6 @@ mparse_alloc(enum mparset inttype, mevt_open eopen,
curp->mmsg = mmsg;
curp->arg = arg;
curp->inttype = inttype;
- curp->evt_open = eopen;
- curp->evt_close = eclose;
curp->roff = roff_alloc(&curp->regs, curp);
return(curp);