- out_java.write(");\n")
- write_c(") {\n")
- write_c("\t" + struct_name + "* ret = MALLOC(sizeof(" + struct_name + "), \"" + struct_name + "\");\n")
- for idx, (line, _) in enumerate(field_lines):
- if idx != 0 and idx < len(field_lines) - 2:
- ty_info = type_mapping_generator.map_type(line.strip(';'), False, None, False, False)
- e = chr(ord('a') + idx - 1)
- if ty_info.arg_conv is not None:
- write_c("\t" + ty_info.arg_conv.replace("\n", "\n\t"))
- write_c("\n\tret->" + e + " = " + ty_info.arg_conv_name + ";\n")
- else:
- write_c("\tret->" + e + " = " + e + ";\n")
- if ty_info.arg_conv_cleanup is not None:
- write_c("\t//TODO: Really need to call " + ty_info.arg_conv_cleanup + " here\n")
- write_c("\treturn (uint64_t)ret;\n")
- write_c("}\n")