#![no_std]
use core::fmt;
pub mod elf32;
pub mod elf64;
pub mod types;
mod util;
pub use elf32::{Elf32, Elf32Ehdr, Elf32Phdr, Elf32Shdr};
pub use elf64::{Elf64, Elf64Ehdr, Elf64Phdr, Elf64Shdr};
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum Error {
InvalidMagicNumber,
InvalidIndex,
InvalidClass,
Corrupted,
}
impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match self {
Error::InvalidMagicNumber => "InvalidMagicNumber",
Error::InvalidIndex => "InvalidIndex",
Error::InvalidClass => "InvalidClass",
Error::Corrupted => "Corrupted",
};
f.write_fmt(format_args!("{}", name))
}
}