summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/clibraries/cqueue.pxd
diff options
context:
space:
mode:
authorgabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-13 15:43:12 +0200
committergabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-13 15:43:12 +0200
commit8e3a8af1a6ddcb4c9b42df962fdc6fb14b0671ea (patch)
tree89aec458a2647162ad1acc7ccb221cdc0b96499e /docs/examples/tutorial/clibraries/cqueue.pxd
parent5fadf79efd37273873c1be2353969445118ed903 (diff)
downloadcython-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.pxd19
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)