(
in_import: bool,
resolve: &Resolve,
world: &str,
interface_id: Option<&WorldKey>,
func: &Function,
renamed_interfaces: &HashMap<WorldKey, String>,
)
| 1279 | } |
| 1280 | |
| 1281 | pub fn c_func_name( |
| 1282 | in_import: bool, |
| 1283 | resolve: &Resolve, |
| 1284 | world: &str, |
| 1285 | interface_id: Option<&WorldKey>, |
| 1286 | func: &Function, |
| 1287 | renamed_interfaces: &HashMap<WorldKey, String>, |
| 1288 | ) -> String { |
| 1289 | let mut name = String::new(); |
| 1290 | match interface_id { |
| 1291 | Some(id) => name.push_str(&interface_identifier( |
| 1292 | id, |
| 1293 | resolve, |
| 1294 | !in_import, |
| 1295 | renamed_interfaces, |
| 1296 | )), |
| 1297 | None => { |
| 1298 | if !in_import { |
| 1299 | name.push_str("exports_"); |
| 1300 | } |
| 1301 | name.push_str(&world.to_snake_case()); |
| 1302 | } |
| 1303 | } |
| 1304 | name.push_str("_"); |
| 1305 | name.push_str(&func.name.to_snake_case().replace('.', "_")); |
| 1306 | name |
| 1307 | } |
| 1308 | |
| 1309 | struct InterfaceGenerator<'a> { |
| 1310 | src: Source, |
no test coverage detected