Add LOT of doc + play on vertored exception

This commit is contained in:
Clement Rouault
2015-04-13 15:56:25 +02:00
parent 481b8861f0
commit b459125f27
29 changed files with 2147 additions and 157 deletions
+7
View File
@@ -314,6 +314,13 @@ def generate_callback_stub(callback, types):
generate_callback_stub.l = []
def create_function(code, types):
"""Create a python function that call raw machine code
:param str code: Raw machine code that will be called
:param list types: Return type and parameters type (see :mod:`ctypes`)
:return: the created function
:rtype: function
"""
func_type = ctypes.CFUNCTYPE(*types)
addr = allocator.write_code(code)
return func_type(addr)