Crates.io | mangler |
lib.rs | mangler |
version | 0.2.0 |
source | src |
created_at | 2024-08-29 09:56:06.028835 |
updated_at | 2024-08-29 10:22:13.048858 |
description | A simple Rust program that mangles and parse C++ symbol names using Itanium ABI. |
homepage | https://github.com/NightProg/mangler |
repository | https://github.com/NightProg/mangler |
max_upload_size | |
id | 1355924 |
size | 12,785 |
A simple Rust program that mangles and parse C++ symbol names using Itanium ABI.
use mangler::*;
fn main() {
let mangled = mangle("foo::bar::hello(int, float, std::string)");
println!("{}", mangled); // _ZN3foo3bar5helloEifSs
let mangled = mangle(
Symbol::Function(
Box::new(
Symbol::Namespace(
vec![
Symbol::Type("hello".to_string()),
Symbol::Type("world".to_string()),
Symbol::Generic(
vec![
Symbol::Typed(
Box::new(
Symbol::Type("int".to_string())
),
vec![TypedElement::Ptr]
)
]
),
Symbol::Type("print".to_string())
]
)
),
vec![
Symbol::Type("int".to_string()),
Symbol::Type("float".to_string()),
Symbol::Type("std::string".to_string())
]
)
);
println!("{}", mangled); // _ZN5hello5worldIPiE5printEifSs
}