-/*
- * Read the whole file into memory and call the parsers.
- * Called recursively when an .so request is encountered.
- */
-void
-mparse_readfd(struct mparse *curp, int fd, const char *file)
-{
- struct buf blk;
- int with_mmap;
- int save_filenc;
-
- if (read_whole_file(curp, fd, &blk, &with_mmap)) {
- save_filenc = curp->filenc;
- curp->filenc = curp->options &
- (MPARSE_UTF8 | MPARSE_LATIN1);
- mparse_parse_buffer(curp, blk, file);
- curp->filenc = save_filenc;
- if (with_mmap)
- munmap(blk.buf, blk.sz);
- else
- free(blk.buf);
- }
+ if (with_mmap)
+ munmap(blk.buf, blk.sz);
+ else
+ free(blk.buf);
+
+ curp->primary = save_primary;
+ curp->filenc = save_filenc;
+ curp->line = save_lineno;
+ if (save_filename != NULL)
+ mandoc_msg_setinfilename(save_filename);