Module.add_typedef API, implemented only for C++ classes/structs for now.

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-07-15 00:28:58 +01:00
1 parent f26ed63f39
commit f3a0c9a33c
6 files changed
+63 -1

No files matched your search

+10
View File
@@ -1652,6 +1652,16 @@ static void
return tp_richcompare_function_name
def generate_typedef(self, module, alias):
"""
Generates the appropriate Module code to register the class
with a new name in that module (typedef alias).
"""
module.after_init.write_code(
'PyModule_AddObject(m, \"%s\", (PyObject *) &%s);' % (
alias, self.pytypestruct))
###
### ------------ C++ class parameter type handlers ------------
###