+ write!(w, "{} {{ inner: ObjOps::heap_alloc(", struct_name).unwrap();
+ match &s.fields {
+ syn::Fields::Named(fields) => {
+ writeln!(w, "native{} {{", s.ident).unwrap();
+ for field in fields.named.iter() {
+ write!(w, "\t\t{}: ", field.ident.as_ref().unwrap()).unwrap();
+ types.write_from_c_conversion_prefix(w, &field.ty, Some(&gen_types));
+ write!(w, "{}_arg", field.ident.as_ref().unwrap()).unwrap();
+ types.write_from_c_conversion_suffix(w, &field.ty, Some(&gen_types));
+ writeln!(w, ",").unwrap();
+ }
+ write!(w, "\t}}").unwrap();
+ },
+ syn::Fields::Unnamed(fields) => {
+ assert!(s.generics.lt_token.is_none());
+ writeln!(w, "{} (", types.maybe_resolve_ident(&s.ident).unwrap()).unwrap();
+ for (idx, field) in fields.unnamed.iter().enumerate() {
+ write!(w, "\t\t").unwrap();
+ types.write_from_c_conversion_prefix(w, &field.ty, Some(&gen_types));
+ write!(w, "{}_arg", ('a' as u8 + idx as u8) as char).unwrap();
+ types.write_from_c_conversion_suffix(w, &field.ty, Some(&gen_types));
+ writeln!(w, ",").unwrap();
+ }
+ write!(w, "\t)").unwrap();
+ },
+ _ => unreachable!()
+ }
+ writeln!(w, "), is_owned: true }}\n}}").unwrap();