Commit 19eaac56 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cc1a98cb
......@@ -25,6 +25,7 @@
from libcpp cimport nullptr_t, nullptr as nil
from libcpp.string cimport string
from libcpp.utility cimport pair
cdef extern from *:
ctypedef bint cbool "bool"
......@@ -36,16 +37,31 @@ cdef extern from "wcfs_misc.h" nogil:
cbool operator==(const error&) const
cbool operator!=(const error&) const
cdef extern from "wcfs_watchlink.h" nogil:
cppclass WatchLink:
error close()
ctypedef WatchLink *pWatchLink # https://github.com/cython/cython/issues/534
cdef extern from "wcfs.h" nogil:
cppclass WCFS:
pair[pWatchLink, error] _openwatch() # XXX pair instead of tuple
from golang cimport topyexc
cdef class PyWCFS:
cdef WCFS *wc
cdef class PyWatchLink:
cdef WatchLink *wlink
def __xinit__(PyWatchLink pywlink, PyWCFS pywc):
_ = wcfs_openwatch_pyexc(pywc.wc)
# XXX
def close(PyWatchLink pywlink):
with nogil:
err = wlink_close_pyexc(pywlink.wlink)
......@@ -63,5 +79,8 @@ cdef class PyPinReq:
cdef nogil:
error wlink_close_pyexc(WatchLink *wlink) except +topyexc:
error wlink_close_pyexc(WatchLink *wlink) except +topyexc:
return wlink.close()
pair[pWatchLink, error] wcfs_openwatch_pyexc(WCFS *wcfs) except +topyexc:
return wcfs._openwatch()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment