Пример #1
0
 def wrapper(func):
     if lib.Cryptography_STATIC_CALLBACKS:
         # def_extern() returns a decorator that sets the internal
         # function pointer and returns the original function unmodified.
         ffi.def_extern(name=name, **kwargs)(func)
         callback = getattr(lib, name)
     else:
         # callback() wraps the function in a cdata function.
         callback = ffi.callback(signature, **kwargs)(func)
     return callback
Пример #2
0
 def wrapper(func):
     if lib.Cryptography_STATIC_CALLBACKS:
         # def_extern() returns a decorator that sets the internal
         # function pointer and returns the original function unmodified.
         ffi.def_extern(name=name, **kwargs)(func)
         callback = getattr(lib, name)
     else:
         # callback() wraps the function in a cdata function.
         callback = ffi.callback(signature, **kwargs)(func)
     return callback