summaryrefslogtreecommitdiffstats
path: root/cython/property_list_client.pxi
blob: 718b07f38cbae3ba54b2aea2181b4de2a3f9b1e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cdef class PropertyListClient(Base):
    cpdef send(self, plist.Node node):
        self.handle_error(self._send(node._c_node))

    cpdef object receive(self):
        cdef:
            plist.plist_t c_node = NULL
            int16_t err
        err = self._receive(&c_node)
        try:
            self.handle_error(err)
        except BaseError, e:
            if c_node != NULL:
                plist.plist_free(c_node)
            raise

        return plist.plist_t_to_node(c_node)

    cdef inline int16_t _send(self, plist.plist_t node): pass
    cdef inline int16_t _receive(self, plist.plist_t* c_node): pass