Commit 9c370895 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8daa72b8
......@@ -85,11 +85,13 @@ cdef extern from "wcfs/internal/wcfs.h" namespace "wcfs" nogil:
cppclass _Conn:
pair[FileH, error] open(Oid foid)
error close()
error resync(Tid at)
cppclass Conn (refptr[_Conn]):
# Conn.X = Conn->X in C++
pair[FileH, error] open "_ptr()->open" (Oid foid)
error close "_ptr()->close" ()
error resync "_ptr()->resync" (Tid at)
cppclass _FileH:
# XXX add mmap?
......
......@@ -86,7 +86,13 @@ cdef class PyConn:
pywfileh.wfileh = wfileh
return pywfileh
# XXX resync
def resync(PyConn pywconn, pyat):
cdef Tid at = u64(at)
with nogil:
err = wconn_resync_pyexc(pywconn.wconn, at)
if err != nil:
raise pyerr(err)
cdef class PyFileH:
......@@ -227,6 +233,9 @@ cdef nogil:
pair[FileH, error] wconn_open_pyexc(Conn wconn, Oid foid) except +topyexc:
return wconn.open(foid)
error wconn_resync_pyexc(Conn wconn, Tid at) except +topyexc:
return wconn.resync(at)
error wlink_close_pyexc(WatchLink wlink) except +topyexc:
return wlink.close()
......
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