#include "mz_header.hpp" #include "parse.hpp" #include "output.hpp" #include #include #include BOOST_FUSION_ADAPT_STRUCT( mz::Header, (binparse::Magic16, magic) (binparse::Value16, bytes_in_last_block) (binparse::Value16, blocks_in_file) (binparse::Value16, num_relocs) (binparse::Value16, header_paragraphs) (binparse::Value16, min_extra_paragraphs) (binparse::Value16, max_extra_paragraphs) (binparse::Offset16, ss) (binparse::Offset16, sp) (binparse::Value16, checksum) (binparse::Offset16, ip) (binparse::Offset16, cs) (binparse::Offset16, reloc_table_offset) (binparse::Value16, overlay_number) ) namespace mz { NotAMZFileException::NotAMZFileException() : std::runtime_error("This stream does not contain a valid MZ executable") {} Header parse_header(std::istream& is) { using binparse::parse; return parse
(is); } std::ostream& operator<<(std::ostream& os, Header const& header) { return binparse::operator<<(os, header); } }