pub fn export_ascii(link_section:&str, l_pub: bool, ident: &str, ascii: &str) -> String {
let pub_part = if l_pub {
"pub"
}
else {
""
};
format!(
r#"
#[link_section="{LINK_SECTION}"]
{pub_part} static {IDENT}: [u8; {ASCII_LEN}] = *b"{ASCII}\0";
"#
,LINK_SECTION=link_section,IDENT=ident,ASCII=ascii,ASCII_LEN=ascii.len() + 1)
}
pub fn export_name_attrs(link_section: &str, export_name_1: &str, export_name_2: &str) -> String {
format!(
r#"
#[link_section="{LINK_SECTION}"]
#[export_name="{EXPORT_NAME_1}{EXPORT_NAME_2}"]
"#
,LINK_SECTION=link_section,EXPORT_NAME_1=export_name_1, EXPORT_NAME_2=export_name_2
)
}
pub fn export_name_attrs3(link_section: &str, export_name_1: &str, export_name_2: &str,export_name_3: &str) -> String {
format!(
r#"
#[link_section="{LINK_SECTION}"]
#[export_name="{EXPORT_NAME_1}{EXPORT_NAME_2}{EXPORT_NAME_3}"]
"#
,LINK_SECTION=link_section,EXPORT_NAME_1=export_name_1, EXPORT_NAME_2=export_name_2,EXPORT_NAME_3=export_name_3
)
}