Rev 4765: some whitespace and expose the rest of the C api in the .pxd file. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-simple-set
John Arbash Meinel
john at arbash-meinel.com
Thu Oct 8 05:40:35 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1-simple-set
------------------------------------------------------------
revno: 4765
revision-id: john at arbash-meinel.com-20091008044016-p23bjw6vmqneqyz9
parent: john at arbash-meinel.com-20091008043501-8fgotm1vbt1zp4g6
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-simple-set
timestamp: Wed 2009-10-07 23:40:16 -0500
message:
some whitespace and expose the rest of the C api in the .pxd file.
Putting it in .pyx is only necessary if we will have other Pyrex code that wants
to use it, because declaring it 'api' is sufficient to expose it at the C level.
-------------- next part --------------
=== modified file 'bzrlib/_simple_set_pyx.pxd'
--- a/bzrlib/_simple_set_pyx.pxd 2009-10-07 19:31:39 +0000
+++ b/bzrlib/_simple_set_pyx.pxd 2009-10-08 04:40:16 +0000
@@ -27,6 +27,7 @@
ctypedef struct PyObject:
pass
+
cdef public api class SimpleSet [object SimpleSetObject, type SimpleSet_Type]:
"""A class similar to PySet, but with simpler implementation.
@@ -53,7 +54,14 @@
cdef int _insert_clean(self, PyObject *key) except -1
cdef Py_ssize_t _resize(self, Py_ssize_t min_unused) except -1
+
# TODO: might want to export the C api here, though it is all available from
# the class object...
cdef api object SimpleSet_Add(object self, object key)
cdef api SimpleSet SimpleSet_New()
+cdef api object SimpleSet_Add(object self, object key)
+cdef api int SimpleSet_Contains(object self, object key) except -1
+cdef api int SimpleSet_Discard(object self, object key) except -1
+cdef api PyObject *SimpleSet_Get(SimpleSet self, object key) except? NULL
+cdef api Py_ssize_t SimpleSet_Size(object self) except -1
+cdef api int SimpleSet_Next(object self, Py_ssize_t *pos, PyObject **key)
=== modified file 'bzrlib/_simple_set_pyx.pyx'
--- a/bzrlib/_simple_set_pyx.pyx 2009-10-07 21:17:47 +0000
+++ b/bzrlib/_simple_set_pyx.pyx 2009-10-08 04:40:16 +0000
@@ -38,6 +38,7 @@
void PyMem_Free(void *)
void memset(void *, int, size_t)
+
cdef object _dummy_obj
cdef PyObject *_dummy
_dummy_obj = object()
More information about the bazaar-commits
mailing list