Metadata-Version: 2.0
Name: pywrap
Version: 0.1.0
Summary: Ctypes made easy.
Home-page: https://github.com/tmr232/pywrap
Author: Tamir Bahar
Author-email: UNKNOWN
License: MIT
Platform: UNKNOWN

pywrap
======

Simple function-wrapping API with ctypes.

Usage
-----

Replace this:

.. code:: python

    prototype = ctypes.WINFUNCTYPE(wintypes.HANDLE, wintypes.UINT, wintypes.HANDLE)
    paramflags = (1, "uFormat"), (1, "hMem")
    SetClipboardData = prototype(("SetClipboardData", user32), paramflags)
    SetClipboardData.errcheck = null_errcheck

With this:

.. code:: python

    SetClipboardData = pywrap.wrap_winapi(name="SetClipboardData",
                                            library=user32,
                                            restype=wintypes.BOOL,
                                            params=[
                                                Parameter("uFormat", wintypes.UINT),
                                                Parameter("hMem", wintypes.HANDLE)
                                            ],
                                            errcheck=null_errcheck)


