diff options
author | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-13 15:43:12 +0200 |
---|---|---|
committer | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-13 15:43:12 +0200 |
commit | 8e3a8af1a6ddcb4c9b42df962fdc6fb14b0671ea (patch) | |
tree | 89aec458a2647162ad1acc7ccb221cdc0b96499e /docs/examples/tutorial/clibraries/cqueue.pxd | |
parent | 5fadf79efd37273873c1be2353969445118ed903 (diff) | |
download | cython-8e3a8af1a6ddcb4c9b42df962fdc6fb14b0671ea.tar.gz |
Added tests for some of the code snippets in "calling C libraries". Fixed a forgotten import.
Diffstat (limited to 'docs/examples/tutorial/clibraries/cqueue.pxd')
-rw-r--r-- | docs/examples/tutorial/clibraries/cqueue.pxd | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/examples/tutorial/clibraries/cqueue.pxd b/docs/examples/tutorial/clibraries/cqueue.pxd new file mode 100644 index 000000000..13a07d317 --- /dev/null +++ b/docs/examples/tutorial/clibraries/cqueue.pxd @@ -0,0 +1,19 @@ +# cqueue.pxd
+
+cdef extern from "c-algorithms/src/queue.h":
+ ctypedef struct Queue:
+ pass
+ ctypedef void* QueueValue
+
+ Queue* queue_new()
+ void queue_free(Queue* queue)
+
+ int queue_push_head(Queue* queue, QueueValue data)
+ QueueValue queue_pop_head(Queue* queue)
+ QueueValue queue_peek_head(Queue* queue)
+
+ int queue_push_tail(Queue* queue, QueueValue data)
+ QueueValue queue_pop_tail(Queue* queue)
+ QueueValue queue_peek_tail(Queue* queue)
+
+ bint queue_is_empty(Queue* queue)
|