| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#; |
| 2 | |
| 3 | use selfrust-analyzer cargo implib 0.3.3 def/::parserrust-analyzer cargo implib 0.3.3 def/parser/::Parserrust-analyzer cargo implib 0.3.3 def/parser/Parser#; |
| 4 | use craterust-analyzer cargo implib 0.3.3 crate/::MachineTyperust-analyzer cargo implib 0.3.3 MachineType#; |
| 5 | |
| 6 | mod parserrust-analyzer cargo implib 0.3.3 def/parser/; |
| 7 | |
| 8 | /// Simple .DEF file parser |
| 9 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)] |
| 10 | pub struct ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef# { |
| 11 | pub exportsrust-analyzer cargo implib 0.3.3 def/ModuleDef#exports.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport#>, |
| 12 | pub import_namerust-analyzer cargo implib 0.3.3 def/ModuleDef#import_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 13 | pub image_baserust-analyzer cargo implib 0.3.3 def/ModuleDef#image_base.: u64, |
| 14 | pub stack_reserverust-analyzer cargo implib 0.3.3 def/ModuleDef#stack_reserve.: u64, |
| 15 | pub stack_commitrust-analyzer cargo implib 0.3.3 def/ModuleDef#stack_commit.: u64, |
| 16 | pub heap_reserverust-analyzer cargo implib 0.3.3 def/ModuleDef#heap_reserve.: u64, |
| 17 | pub heap_commitrust-analyzer cargo implib 0.3.3 def/ModuleDef#heap_commit.: u64, |
| 18 | pub major_image_versionrust-analyzer cargo implib 0.3.3 def/ModuleDef#major_image_version.: u32, |
| 19 | pub minor_image_versionrust-analyzer cargo implib 0.3.3 def/ModuleDef#minor_image_version.: u32, |
| 20 | pub major_os_versionrust-analyzer cargo implib 0.3.3 def/ModuleDef#major_os_version.: u32, |
| 21 | pub minor_os_versionrust-analyzer cargo implib 0.3.3 def/ModuleDef#minor_os_version.: u32, |
| 22 | } |
| 23 | |
| 24 | impl ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef# { |
| 25 | pub fn parserust-analyzer cargo implib 0.3.3 def/impl#[ModuleDef]parse().(def: &str, machine: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> { |
| 26 | Parserrust-analyzer cargo implib 0.3.3 def/parser/Parser#::newrust-analyzer cargo implib 0.3.3 def/parser/impl#[`Parser<'a>`]new().(def, machine).parserust-analyzer cargo implib 0.3.3 def/parser/impl#[`Parser<'a>`]parse().() |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /// COFF short export |
| 31 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)] |
| 32 | pub struct ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport# { |
| 33 | /// The name of the export as specified in the .def file or on the command |
| 34 | /// line, i.e. "foo" in "/EXPORT:foo", and "bar" in "/EXPORT:foo=bar" |
| 35 | pub namerust-analyzer cargo implib 0.3.3 def/ShortExport#name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 36 | /// The external, exported name. Only non-empty when export renaming is in |
| 37 | /// effect, i.e. "foo" in "/EXPORT:foo=bar". |
| 38 | pub ext_namerust-analyzer cargo implib 0.3.3 def/ShortExport#ext_name.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 39 | /// The real, mangled symbol name from the object file. |
| 40 | pub symbol_namerust-analyzer cargo implib 0.3.3 def/ShortExport#symbol_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 41 | /// Creates a weak alias. This is the name of the weak aliasee. In a .def |
| 42 | /// file, this is "baz" in "EXPORTS\nfoo = bar == baz". |
| 43 | pub alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 44 | pub ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal.: u16, |
| 45 | pub no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name.: bool, |
| 46 | pub datarust-analyzer cargo implib 0.3.3 def/ShortExport#data.: bool, |
| 47 | pub privaterust-analyzer cargo implib 0.3.3 def/ShortExport#private.: bool, |
| 48 | pub constantrust-analyzer cargo implib 0.3.3 def/ShortExport#constant.: bool, |
| 49 | } |