A simple intrusive Queue structure for Zig
Zig 100.0%
3 1 0

Clone this repository

https://tangled.org/pci.express/Queue.zig
git@knot.sydney.blue:pci.express/Queue.zig

For self-hosted knots, clone URLs may differ based on your setup.

README.md

Queue.zig#

A simple intrusive Queue for Zig, similar to SinglyLinkedList. There's a nice example of how to use intrusive structures at https://www.openmymind.net/Zigs-New-LinkedList-API/.

Adding to project#

First, add the package to your build.zig.zon: zig fetch --save git+https://tangled.sh/@sydney.blue/Queue.zig#dev Then, add the following to your build.zig:

const queue_dep = b.dependency("Queue", .{});
const queue_mod = queue_dep.module("Queue");
exe.root_module.addImport("Queue", queue);

Now, you can import the Queue module. You can find a code example in example.zig.